*fix* issue 272
*fix* correct transient window handling (f.ex window3 is transient for window2 and window2 transient for window1 and window1 is already in tint2, so window3 will not be added) git-svn-id: http://tint2.googlecode.com/svn/trunk@542 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
parent
95b35aefc0
commit
d7914dd0ad
3 changed files with 14 additions and 7 deletions
|
@ -374,9 +374,11 @@ gboolean add_icon(Window id)
|
|||
if ( XGetWindowAttributes(server.dsp, id, &attr) == False ) return FALSE;
|
||||
unsigned long mask = 0;
|
||||
XSetWindowAttributes set_attr;
|
||||
Visual* visual = server.visual;
|
||||
//printf("icon with depth: %d, width %d, height %d\n", attr.depth, attr.width, attr.height);
|
||||
printf("icon with depth: %d\n", attr.depth);
|
||||
if (attr.depth != server.depth || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) {
|
||||
visual = attr.visual;
|
||||
set_attr.colormap = attr.colormap;
|
||||
set_attr.background_pixel = 0;
|
||||
set_attr.border_pixel = 0;
|
||||
|
@ -387,7 +389,7 @@ gboolean add_icon(Window id)
|
|||
mask = CWBackPixmap;
|
||||
}
|
||||
Window parent_window;
|
||||
parent_window = XCreateWindow(server.dsp, panel->main_win, 0, 0, 30, 30, 0, attr.depth, InputOutput, attr.visual, mask, &set_attr);
|
||||
parent_window = XCreateWindow(server.dsp, panel->main_win, 0, 0, 30, 30, 0, attr.depth, InputOutput, visual, mask, &set_attr);
|
||||
old = XSetErrorHandler(window_error_handler);
|
||||
XReparentWindow(server.dsp, id, parent_window, 0, 0);
|
||||
XSync(server.dsp, False);
|
||||
|
|
|
@ -444,9 +444,11 @@ void active_task()
|
|||
//printf("Change active task %ld\n", w1);
|
||||
|
||||
if (w1) {
|
||||
if (!task_get_tasks(w1)) {
|
||||
Window w2;
|
||||
if (XGetTransientForHint(server.dsp, w1, &w2) != 0)
|
||||
if (w2 && !task_get_tasks(w1)) w1 = w2;
|
||||
while (XGetTransientForHint(server.dsp, w1, &w2))
|
||||
w1 = w2;
|
||||
}
|
||||
set_task_state((task_active = task_get_task(w1)), TASK_ACTIVE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,11 +87,14 @@ int window_is_hidden (Window win)
|
|||
return 1;
|
||||
}
|
||||
// do not add transient_for windows if the transient window is already in the taskbar
|
||||
if ( XGetTransientForHint(server.dsp, win, &window) && task_get_tasks(window) ) {
|
||||
window=win;
|
||||
while ( XGetTransientForHint(server.dsp, window, &window) ) {
|
||||
if ( task_get_tasks(window) ) {
|
||||
XFree(at);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
XFree(at);
|
||||
|
||||
at = server_get_property (win, server.atom._NET_WM_WINDOW_TYPE, XA_ATOM, &count);
|
||||
|
|
Loading…
Reference in a new issue