Mercurial > games > semicongine
comparison src/semicongine/platform/linux/window.nim @ 301:bf5982802e2c
fix: wrong flag value, dummy
author | Sam <sam@basx.dev> |
---|---|
date | Tue, 27 Jun 2023 00:01:36 +0700 |
parents | 21d6d20de754 |
children |
comparison
equal
deleted
inserted
replaced
300:b1fe29fe41fb | 301:bf5982802e2c |
---|---|
40 if display == nil: | 40 if display == nil: |
41 quit "Failed to open display" | 41 quit "Failed to open display" |
42 discard XSetErrorHandler(XErrorLogger) | 42 discard XSetErrorHandler(XErrorLogger) |
43 | 43 |
44 let rootWindow = display.XDefaultRootWindow() | 44 let rootWindow = display.XDefaultRootWindow() |
45 discard display.XkbSetDetectableAutoRepeat(true, nil) | |
45 var | 46 var |
46 attribs: XWindowAttributes | 47 attribs: XWindowAttributes |
47 width = cuint(800) | 48 width = cuint(800) |
48 height = cuint(600) | 49 height = cuint(600) |
49 checkXlibResult display.XGetWindowAttributes(rootWindow, addr(attribs)) | 50 checkXlibResult display.XGetWindowAttributes(rootWindow, addr(attribs)) |
50 | 51 |
51 var attrs = XSetWindowAttributes( | 52 var attrs = XSetWindowAttributes() |
52 # override_redirect: 1 | |
53 ) | |
54 let window = XCreateWindow( | 53 let window = XCreateWindow( |
55 display, | 54 display, |
56 rootWindow, | 55 rootWindow, |
57 (attribs.width - cint(width)) div 2, (attribs.height - cint(height)) div 2, | 56 (attribs.width - cint(width)) div 2, (attribs.height - cint(height)) div 2, |
58 width, height, | 57 width, height, |
104 window.display.DefaultRootWindow(), | 103 window.display.DefaultRootWindow(), |
105 0, | 104 0, |
106 SubstructureRedirectMask or SubstructureNotifyMask, | 105 SubstructureRedirectMask or SubstructureNotifyMask, |
107 addr xev | 106 addr xev |
108 ) | 107 ) |
109 discard window.display.XkbSetDetectableAutoRepeat(false, nil) | |
110 checkXlibResult window.display.XFlush() | 108 checkXlibResult window.display.XFlush() |
111 | 109 |
112 proc hideSystemCursor*(window: NativeWindow) = | 110 proc hideSystemCursor*(window: NativeWindow) = |
113 checkXlibResult XDefineCursor(window.display, window.window, window.emptyCursor) | 111 checkXlibResult XDefineCursor(window.display, window.window, window.emptyCursor) |
114 checkXlibResult window.display.XFlush() | 112 checkXlibResult window.display.XFlush() |