|
Lines 47-52
else { \
Link Here
|
| 47 |
} \ |
47 |
} \ |
| 48 |
tdmconfig->setGroup("X-*-Greeter"); |
48 |
tdmconfig->setGroup("X-*-Greeter"); |
| 49 |
|
49 |
|
|
|
50 |
TQXLibWindowList trinity_desktop_lock_hidden_window_list; |
| 51 |
|
| 50 |
// [FIXME] Add GUI configuration checkboxes for these three settings (see kdesktoprc [ScreenSaver] UseUnmanagedLockWindows, DelaySaverStart, and UseTDESAK) |
52 |
// [FIXME] Add GUI configuration checkboxes for these three settings (see kdesktoprc [ScreenSaver] UseUnmanagedLockWindows, DelaySaverStart, and UseTDESAK) |
| 51 |
bool trinity_desktop_lock_use_system_modal_dialogs = FALSE; |
53 |
bool trinity_desktop_lock_use_system_modal_dialogs = FALSE; |
| 52 |
bool trinity_desktop_lock_delay_screensaver_start = FALSE; |
54 |
bool trinity_desktop_lock_delay_screensaver_start = FALSE; |
|
Lines 78-93
bool MyApp::x11EventFilter( XEvent *ev )
Link Here
|
| 78 |
} |
80 |
} |
| 79 |
else if (ev->type == MapNotify) { |
81 |
else if (ev->type == MapNotify) { |
| 80 |
// HACK |
82 |
// HACK |
| 81 |
// Close all tooltips and notification windows |
83 |
// Hide all tooltips and notification windows |
| 82 |
XMapEvent map_event = ev->xmap; |
84 |
XMapEvent map_event = ev->xmap; |
| 83 |
XWindowAttributes childAttr; |
85 |
XWindowAttributes childAttr; |
| 84 |
Window childTransient; |
86 |
Window childTransient; |
| 85 |
if (XGetWindowAttributes(map_event.display, map_event.window, &childAttr) && XGetTransientForHint(map_event.display, map_event.window, &childTransient)) { |
87 |
if (XGetWindowAttributes(map_event.display, map_event.window, &childAttr) && XGetTransientForHint(map_event.display, map_event.window, &childTransient)) { |
| 86 |
if((childAttr.map_state == IsViewable) && (childAttr.override_redirect) && (childTransient)) { |
88 |
if((childAttr.map_state == IsViewable) && (childAttr.override_redirect) && (childTransient)) { |
| 87 |
XUnmapWindow(map_event.display, map_event.window); |
89 |
if (!trinity_desktop_lock_hidden_window_list.contains(map_event.window)) { |
|
|
90 |
trinity_desktop_lock_hidden_window_list.append(map_event.window); |
| 91 |
} |
| 92 |
XLowerWindow(map_event.display, map_event.window); |
| 88 |
} |
93 |
} |
| 89 |
} |
94 |
} |
| 90 |
} |
95 |
} |
|
|
96 |
else if (ev->type == VisibilityNotify) { |
| 97 |
// HACK |
| 98 |
// Hide all tooltips and notification windows |
| 99 |
XVisibilityEvent visibility_event = ev->xvisibility; |
| 100 |
XWindowAttributes childAttr; |
| 101 |
Window childTransient; |
| 102 |
if ((visibility_event.state == VisibilityUnobscured) || (visibility_event.state == VisibilityPartiallyObscured)) { |
| 103 |
if (XGetWindowAttributes(visibility_event.display, visibility_event.window, &childAttr) && XGetTransientForHint(visibility_event.display, visibility_event.window, &childTransient)) { |
| 104 |
if((childAttr.map_state == IsViewable) && (childAttr.override_redirect) && (childTransient)) { |
| 105 |
if (!trinity_desktop_lock_hidden_window_list.contains(visibility_event.window)) { |
| 106 |
trinity_desktop_lock_hidden_window_list.append(visibility_event.window); |
| 107 |
} |
| 108 |
XLowerWindow(visibility_event.display, visibility_event.window); |
| 109 |
} |
| 110 |
} |
| 111 |
} |
| 112 |
} |
| 113 |
else if (ev->type == DestroyNotify) { |
| 114 |
XDestroyWindowEvent destroy_event = ev->xdestroywindow; |
| 115 |
if (trinity_desktop_lock_hidden_window_list.contains(destroy_event.window)) { |
| 116 |
trinity_desktop_lock_hidden_window_list.remove(destroy_event.window); |
| 117 |
} |
| 118 |
} |
| 119 |
#if 0 |
| 91 |
else if (ev->type == CreateNotify) { |
120 |
else if (ev->type == CreateNotify) { |
| 92 |
// HACK |
121 |
// HACK |
| 93 |
// Close all tooltips and notification windows |
122 |
// Close all tooltips and notification windows |
|
Lines 100-105
bool MyApp::x11EventFilter( XEvent *ev )
Link Here
|
| 100 |
} |
129 |
} |
| 101 |
} |
130 |
} |
| 102 |
} |
131 |
} |
|
|
132 |
#endif |
| 103 |
return KApplication::x11EventFilter( ev ); |
133 |
return KApplication::x11EventFilter( ev ); |
| 104 |
} |
134 |
} |
| 105 |
|
135 |
|
|
Lines 114-119
static KCmdLineOptions options[] =
Link Here
|
| 114 |
KCmdLineLastOption |
144 |
KCmdLineLastOption |
| 115 |
}; |
145 |
}; |
| 116 |
|
146 |
|
|
|
147 |
void restore_hidden_override_redirect_windows() { |
| 148 |
TQXLibWindowList::iterator it; |
| 149 |
for (it = trinity_desktop_lock_hidden_window_list.begin(); it != trinity_desktop_lock_hidden_window_list.end(); ++it) { |
| 150 |
Window win = *it; |
| 151 |
XRaiseWindow(qt_xdisplay(), win); |
| 152 |
} |
| 153 |
} |
| 154 |
|
| 117 |
static void sigusr1_handler(int) |
155 |
static void sigusr1_handler(int) |
| 118 |
{ |
156 |
{ |
| 119 |
signalled_forcelock = TRUE; |
157 |
signalled_forcelock = TRUE; |
|
Lines 356-362
int main( int argc, char **argv )
Link Here
|
| 356 |
} |
394 |
} |
| 357 |
|
395 |
|
| 358 |
if (in_internal_mode == FALSE) { |
396 |
if (in_internal_mode == FALSE) { |
| 359 |
return app.exec(); |
397 |
trinity_desktop_lock_hidden_window_list.clear(); |
|
|
398 |
int ret = app.exec(); |
| 399 |
restore_hidden_override_redirect_windows(); |
| 400 |
return ret; |
| 360 |
} |
401 |
} |
| 361 |
else { |
402 |
else { |
| 362 |
pid_t kdesktop_pid = atoi(args->getOption( "internal" )); |
403 |
pid_t kdesktop_pid = atoi(args->getOption( "internal" )); |
|
Lines 364-370
int main( int argc, char **argv )
Link Here
|
| 364 |
// The controlling kdesktop process probably died. Commit suicide... |
405 |
// The controlling kdesktop process probably died. Commit suicide... |
| 365 |
return 12; |
406 |
return 12; |
| 366 |
} |
407 |
} |
|
|
408 |
trinity_desktop_lock_hidden_window_list.clear(); |
| 367 |
app.exec(); |
409 |
app.exec(); |
|
|
410 |
restore_hidden_override_redirect_windows(); |
| 368 |
if (kill(kdesktop_pid, SIGUSR1) < 0) { |
411 |
if (kill(kdesktop_pid, SIGUSR1) < 0) { |
| 369 |
// The controlling kdesktop process probably died. Commit suicide... |
412 |
// The controlling kdesktop process probably died. Commit suicide... |
| 370 |
return 12; |
413 |
return 12; |