Created
May 26, 2015 16:09
-
-
Save mmatyas/e1e2f06e97f43c4e4198 to your computer and use it in GitHub Desktop.
Glutin colormap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs | |
index 0c3700b..a14eeff 100644 | |
--- a/src/x11/window/mod.rs | |
+++ b/src/x11/window/mod.rs | |
@@ -421,10 +421,18 @@ impl Window { | |
builder.parent as ffi::Window | |
}; | |
+ // creating the color map | |
+ let cmap = unsafe { | |
+ let cmap = ffi::XCreateColormap(display, parent, | |
+ visual_infos.visual as *mut _, ffi::AllocNone); | |
+ // TODO: error checking? | |
+ cmap | |
+ }; | |
+ | |
// creating | |
let mut set_win_attr = { | |
let mut swa: ffi::XSetWindowAttributes = unsafe { mem::zeroed() }; | |
- swa.colormap = 0; | |
+ swa.colormap = cmap; | |
swa.event_mask = ffi::ExposureMask | ffi::StructureNotifyMask | | |
ffi::VisibilityChangeMask | ffi::KeyPressMask | ffi::PointerMotionMask | | |
ffi::KeyReleaseMask | ffi::ButtonPressMask | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment