From d13723b49a8f01546d963a7e5992309f09abda43 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 22 Sep 2012 23:31:10 -0500 Subject: [PATCH] Attempt to minimize the time in which new notifications are displayed before being hidden (cherry picked from commit 1f33dc8fd2fc14c2abb74be4e27ef08fdda784d6) --- kdesktop/lock/lockprocess.cc | 1 + kdesktop/lock/main.cc | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc index d6e0d7452..d1b9c099f 100644 --- a/kdesktop/lock/lockprocess.cc +++ b/kdesktop/lock/lockprocess.cc @@ -980,6 +980,7 @@ void LockProcess::createSaverWindow() trinity_desktop_lock_hidden_window_list.append(children[i]); } XLowerWindow(x11Display(), children[i]); + XFlush(x11Display()); } } } diff --git a/kdesktop/lock/main.cc b/kdesktop/lock/main.cc index 5449fa050..86f72a3a5 100644 --- a/kdesktop/lock/main.cc +++ b/kdesktop/lock/main.cc @@ -90,6 +90,7 @@ bool MyApp::x11EventFilter( XEvent *ev ) trinity_desktop_lock_hidden_window_list.append(map_event.window); } XLowerWindow(map_event.display, map_event.window); + XFlush(map_event.display); } } } @@ -106,10 +107,27 @@ bool MyApp::x11EventFilter( XEvent *ev ) trinity_desktop_lock_hidden_window_list.append(visibility_event.window); } XLowerWindow(visibility_event.display, visibility_event.window); + XFlush(visibility_event.display); } } } } + else if (ev->type == CreateNotify) { + // HACK + // Close all tooltips and notification windows + XCreateWindowEvent create_event = ev->xcreatewindow; + XWindowAttributes childAttr; + Window childTransient; + if (XGetWindowAttributes(create_event.display, create_event.window, &childAttr) && XGetTransientForHint(create_event.display, create_event.window, &childTransient)) { + if ((childAttr.override_redirect) && (childTransient)) { + if (!trinity_desktop_lock_hidden_window_list.contains(create_event.window)) { + trinity_desktop_lock_hidden_window_list.append(create_event.window); + } + XLowerWindow(create_event.display, create_event.window); + XFlush(create_event.display); + } + } + } else if (ev->type == DestroyNotify) { XDestroyWindowEvent destroy_event = ev->xdestroywindow; if (trinity_desktop_lock_hidden_window_list.contains(destroy_event.window)) {