X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Ftint.c;h=d0985622cdbc5d4b55d9620b096c96eb18622de7;hb=b0ff4722b169b9bc26240a0fdecbc2d911f7afb8;hp=c85bd1bac8f4cbb9dbd4358098c9ab769bb90513;hpb=f3b1fd65ceb474d5c51c8f516bc1ca87b4396bb3;p=chaz%2Ftint2 diff --git a/src/tint.c b/src/tint.c index c85bd1b..d098562 100644 --- a/src/tint.c +++ b/src/tint.c @@ -142,16 +142,14 @@ Taskbar *click_taskbar (Panel *panel, int x, int y) if (panel_horizontal) { for (i=0; i < panel->nb_desktop ; i++) { tskbar = &panel->taskbar[i]; - if (!tskbar->area.on_screen) continue; - if (x >= tskbar->area.posx && x <= (tskbar->area.posx + tskbar->area.width)) + if (tskbar->area.on_screen && x >= tskbar->area.posx && x <= (tskbar->area.posx + tskbar->area.width)) return tskbar; } } else { for (i=0; i < panel->nb_desktop ; i++) { tskbar = &panel->taskbar[i]; - if (!tskbar->area.on_screen) continue; - if (y >= tskbar->area.posy && y <= (tskbar->area.posy + tskbar->area.height)) + if (tskbar->area.on_screen && y >= tskbar->area.posy && y <= (tskbar->area.posy + tskbar->area.height)) return tskbar; } } @@ -293,13 +291,6 @@ void event_button_release (XEvent *e) Panel *panel = get_panel(e->xany.window); if (!panel) return; - if (wm_menu && click_padding(panel, e->xbutton.x, e->xbutton.y)) { - // forward the click to the desktop window (thanks conky) - e->xbutton.window = server.root_win; - XSendEvent(server.dsp, e->xbutton.window, False, ButtonReleaseMask, e); - return; - } - int action = TOGGLE_ICONIFY; switch (e->xbutton.button) { case 2: @@ -526,27 +517,27 @@ void event_property_notify (XEvent *e) panel_refresh = 1; } } - else if (at == server.atom.WM_STATE) { - // Iconic state - // TODO : try to delete following code - if (window_is_iconified (win)) { - if (task_active) { - if (task_active->win == tsk->win) { - Task *tsk2; - GSList *l0; - for (i=0 ; i < nb_panel ; i++) { - for (j=0 ; j < panel1[i].nb_desktop ; j++) { - for (l0 = panel1[i].taskbar[j].area.list; l0 ; l0 = l0->next) { - tsk2 = l0->data; - tsk2->area.is_active = 0; - } - } - } - task_active = 0; - } - } - } - } +// else if (at == server.atom.WM_STATE) { +// // Iconic state +// // TODO : try to delete following code +// if (window_is_iconified (win)) { +// if (task_active) { +// if (task_active->win == tsk->win) { +// Task *tsk2; +// GSList *l0; +// for (i=0 ; i < nb_panel ; i++) { +// for (j=0 ; j < panel1[i].nb_desktop ; j++) { +// for (l0 = panel1[i].taskbar[j].area.list; l0 ; l0 = l0->next) { +// tsk2 = l0->data; +// tsk2->area.is_active = 0; +// } +// } +// } +// task_active = 0; +// } +// } +// } +// } // Window icon changed else if (at == server.atom._NET_WM_ICON) { get_icon(tsk); @@ -615,7 +606,31 @@ void event_expose (XEvent *e) void event_configure_notify (Window win) { - // check 'win' move in systray + // change in root window (xrandr) + if (win == server.root_win) { + int i, old_monitor = server.nb_monitor; + + get_monitors(); + if (old_monitor != server.nb_monitor) { + } + for (i=0 ; i < nb_panel ; i++) { + Panel *panel = &panel1[i]; + + init_panel_size_and_position(panel); + XMoveResizeWindow(server.dsp, panel->main_win, panel->posx, panel->posy, panel->area.width, panel->area.height); + set_panel_background(panel); + + // force the resize of childs + GSList *l0; + panel->area.resize = 1; + for (l0 = panel->area.list; l0 ; l0 = l0->next) + ((Area*)l0->data)->resize = 1; + } + panel_refresh = 1; + return; + } + + // 'win' is a trayer icon TrayWindow *traywin; GSList *l; for (l = systray.list_icons; l ; l = l->next) { @@ -628,9 +643,8 @@ void event_configure_notify (Window win) } } - // check 'win' move in another monitor + // 'win' move in another monitor if (nb_panel == 1) return; - if (server.nb_monitor == 1) return; Task *tsk = task_get_task (win); if (!tsk) return; @@ -796,12 +810,7 @@ load_config: break; case ConfigureNotify: - //XMoveWindow(dpy, fen, pos_x, pos_y); - //XResizeWindow(dpy, fen, largeur, hauteur); - if (e.xconfigure.window == server.root_win) - goto load_config; - else - event_configure_notify (e.xconfigure.window); + event_configure_notify (e.xconfigure.window); break; case ReparentNotify: