X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fblackbox.cc;h=266d0e7318a6b1ffa807a48699e4e7b899eada73;hb=7a55323343635d8a29bb62cd49d8d6a5c103f317;hp=c93b28a6331683a727333f07ac746234483e31a1;hpb=b8ee3dbc4565efb19338c5cf1948f0f4e2f24fd6;p=chaz%2Fopenbox diff --git a/src/blackbox.cc b/src/blackbox.cc index c93b28a6..266d0e73 100644 --- a/src/blackbox.cc +++ b/src/blackbox.cc @@ -90,6 +90,8 @@ extern "C" { #endif // HAVE_LIBGEN_H } +#include + #include #include using std::string; @@ -559,11 +561,14 @@ void Blackbox::process_event(XEvent *e) { } case FocusIn: { - if (e->xfocus.detail != NotifyNonlinear) { + if (e->xfocus.detail != NotifyNonlinear && + e->xfocus.detail != NotifyAncestor) { /* don't process FocusIns when: 1. the new focus window isn't an ancestor or inferior of the old focus window (NotifyNonlinear) + make sure to allow the FocusIn when the old focus window was an + ancestor but didn't have a parent, such as root (NotifyAncestor) */ break; } @@ -650,7 +655,7 @@ void Blackbox::process_event(XEvent *e) { case ClientMessage: { if (e->xclient.format == 32) { - if (e->xclient.message_type == getWMChangeStateAtom()) { + if (e->xclient.message_type == xatom->getAtom(XAtom::wm_change_state)) { BlackboxWindow *win = searchWindow(e->xclient.window); if (! win || ! win->validateClient()) return; @@ -891,6 +896,18 @@ void Blackbox::shutdown(void) { } +void Blackbox::saveWindowToWindowSnap(bool s) { + resource.window_to_window_snap = s; + config.setValue("session.windowToWindowSnap", resource.window_to_window_snap); +} + + +void Blackbox::saveWindowCornerSnap(bool s) { + resource.window_corner_snap = s; + config.setValue("session.windowCornerSnap", resource.window_corner_snap); +} + + /* * Save all values as they are so that the defaults will be written to the rc * file @@ -908,6 +925,8 @@ void Blackbox::save_rc(void) { config.setValue("session.cacheMax", resource.cache_max); config.setValue("session.styleFile", resource.style_file); config.setValue("session.titlebarLayout", resource.titlebar_layout); + saveWindowToWindowSnap(resource.window_to_window_snap); + saveWindowCornerSnap(resource.window_corner_snap); std::for_each(screenList.begin(), screenList.end(), std::mem_fun(&BScreen::save_rc)); @@ -955,6 +974,14 @@ void Blackbox::load_rc(void) { if (! config.getValue("session.titlebarLayout", resource.titlebar_layout)) resource.titlebar_layout = "ILMC"; + + if (! config.getValue("session.windowToWindowSnap", + resource.window_to_window_snap)) + resource.window_to_window_snap = true; + + if (! config.getValue("session.windowCornerSnap", + resource.window_corner_snap)) + resource.window_corner_snap = true; }