aboutsummaryrefslogtreecommitdiff
path: root/src/dotwm.rs
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@gmail.com>2020-06-22 20:33:24 -0300
committerMatias Linares <matiaslina@gmail.com>2020-06-22 20:33:24 -0300
commit71e220b5f94c8af1ddfbc8e57182d9a51c1f6136 (patch)
tree2de62131f562224f4377a81961fc3c27bd28070e /src/dotwm.rs
parent0763564eedc459a98e63a65f7ffee8ad37100fe7 (diff)
downloaddotwm-master.tar.gz
Use MaybeUninit::uninit() in favor of mem::uninitialized()HEADmaster
Diffstat (limited to 'src/dotwm.rs')
-rw-r--r--src/dotwm.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dotwm.rs b/src/dotwm.rs
index 248e969..88951b8 100644
--- a/src/dotwm.rs
+++ b/src/dotwm.rs
@@ -20,7 +20,7 @@ use desktop::Desktop;
use std::ptr;
use std::process::exit;
-use std::mem::uninitialized;
+use std::mem::MaybeUninit;
use std::collections::HashMap;
use libc::c_int;
use libc::c_char;
@@ -86,7 +86,7 @@ impl DotWM {
let root = unsafe { xlib::XDefaultRootWindow(d) };
unsafe {
- let mut attrs: xlib::XSetWindowAttributes = uninitialized();
+ let mut attrs: xlib::XSetWindowAttributes = MaybeUninit::uninit().assume_init();
attrs.event_mask = xlib::SubstructureNotifyMask;
xlib::XChangeWindowAttributes(d, root, xlib::CWEventMask, &mut attrs);
}
@@ -134,7 +134,7 @@ impl DotWM {
pub fn current_desktop(&self) -> &Desktop {
self.desktops.get(self.desktop_idx).unwrap()
}
-
+
/// Add a window to the current desktop
pub fn add_window(&mut self, w: xlib::Window) {
self.current_desktop_mut().add_window(w);
@@ -212,14 +212,14 @@ impl DotWM {
let old_desktop = &self.desktops[self.desktop_idx];
new_desktop.show_windows();
- // let mut do_not_propagate: xlib::XSetWindowAttributes = unsafe { uninitialized() };
+ // let mut do_not_propagate: xlib::XSetWindowAttributes = unsafe { MaybeUninit::uninit().assume_init() };
// let root = root_window(self.display);
// do_not_propagate.do_not_propagate_mask = xlib::SubstructureNotifyMask;
// change_window_attributes(self.display, root, xlib::CWEventMask,
// &mut do_not_propagate);
old_desktop.hide_windows();
- // let mut root_mask: xlib::XSetWindowAttributes = unsafe { uninitialized() };
+ // let mut root_mask: xlib::XSetWindowAttributes = unsafe { MaybeUninit::uninit().assume_init() };
// root_mask.event_mask = xlib::SubstructureRedirectMask|xlib::ButtonPressMask|xlib::SubstructureNotifyMask|xlib::PropertyChangeMask;
// change_window_attributes(self.display, root, xlib::CWEventMask,
// &mut root_mask);