aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/x11
diff options
context:
space:
mode:
authorAdam Badawy <adambada@buffalo.edu>2015-10-26 05:11:59 -0400
committerAdam Badawy <adambada@buffalo.edu>2015-10-26 05:33:01 -0400
commit23a51040982358b6de24b3a3f70c8cbd4c311543 (patch)
tree930a52fc8164cd27169665442b867ae33ea3ff17 /src/api/x11
parent47df0e9eaa7f1231a07f86fc44426936c7a2589a (diff)
downloadglutin-23a51040982358b6de24b3a3f70c8cbd4c311543.tar.gz
glutin-23a51040982358b6de24b3a3f70c8cbd4c311543.zip
Comment fullscreen XClientMessage code
Diffstat (limited to 'src/api/x11')
-rw-r--r--src/api/x11/window.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/api/x11/window.rs b/src/api/x11/window.rs
index 2a0bade..7ad2951 100644
--- a/src/api/x11/window.rs
+++ b/src/api/x11/window.rs
@@ -533,7 +533,7 @@ impl Window {
(display.xlib.XInternAtom)(display.display, state, 0)
)
};
- let fs_atom = unsafe {
+ let fullscreen_atom = unsafe {
with_c_str("_NET_WM_STATE_FULLSCREEN", |state_fullscreen|
(display.xlib.XInternAtom)(display.display, state_fullscreen, 0)
)
@@ -542,18 +542,21 @@ impl Window {
let client_message_event = ffi::XClientMessageEvent {
type_: ffi::ClientMessage,
serial: 0,
- send_event: 1,
+ send_event: 1, // true because we are sending this through `XSendEvent`
display: display.display,
window: window,
- message_type: state_atom,
- format: 32,
+ message_type: state_atom, // the _NET_WM_STATE atom is sent to change the state of a window
+ format: 32, // view `data` as `c_long`s
data: {
+ // TODO replace this with normal instantiation when x11-rs makes
+ // ClientMessageData instantiable.
let mut data = unsafe {
mem::transmute::<[libc::c_long; 5], ffi::ClientMessageData>([0; 5])
};
+ // This first `long` is the action; `1` means add/set following property.
data.set_long(0, 1);
- data.set_long(1, fs_atom as i64);
- data.set_long(2, 0);
+ // This second `long` is the property to set (fullscreen)
+ data.set_long(1, fullscreen_atom as i64);
data
}
};