X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Ftint2;a=blobdiff_plain;f=src%2Ftint.c;h=2ba8727d05297a8b5188db4e1dcb812773f27e2a;hp=4f5c67372f18132a3f27b4f7c51e33001176888b;hb=928fc258ac46f2cc098f714921c028351b07ec31;hpb=57e492324769f892335ef6b20dd747f39fc00b71 diff --git a/src/tint.c b/src/tint.c index 4f5c673..2ba8727 100644 --- a/src/tint.c +++ b/src/tint.c @@ -38,6 +38,7 @@ #include "task.h" #include "taskbar.h" #include "systraybar.h" +#include "launcher.h" #include "panel.h" #include "tooltip.h" #include "timer.h" @@ -63,6 +64,7 @@ void init (int argc, char *argv[]) default_battery(); #endif default_clock(); + default_launcher(); default_taskbar(); default_tooltip(); default_panel(); @@ -156,12 +158,13 @@ void cleanup() { cleanup_timeout(); cleanup_systray(); - cleanup_panel(); cleanup_tooltip(); cleanup_clock(); + cleanup_launcher(); #ifdef ENABLE_BATTERY cleanup_battery(); #endif + cleanup_panel(); cleanup_config(); if (default_icon) { @@ -183,7 +186,7 @@ void get_snapshot(const char *path) panel->area.width = server.monitor[0].width; panel->temp_pmap = XCreatePixmap(server.dsp, server.root_win, panel->area.width, panel->area.height, server.depth); - refresh(&panel->area); + rendering(panel); Imlib_Image img = NULL; imlib_context_set_drawable(panel->temp_pmap); @@ -278,7 +281,15 @@ int tint2_handles_click(Panel* panel, XButtonEvent* e) else return 0; } - // no task clicked --> check if taskbar clicked + LauncherIcon *icon = click_launcher_icon(panel, e->x, e->y); + if (icon) { + if (e->button == 1) { + return 1; + } else { + return 0; + } + } + // no launcher/task clicked --> check if taskbar clicked Taskbar *tskbar = click_taskbar(panel, e->x, e->y); if (tskbar && e->button == 1 && panel_mode == MULTI_DESKTOP) return 1; @@ -421,6 +432,15 @@ void event_button_release (XEvent *e) return; } + if ( click_launcher(panel, e->xbutton.x, e->xbutton.y)) { + LauncherIcon *icon = click_launcher_icon(panel, e->xbutton.x, e->xbutton.y); + if (icon) { + launcher_action(icon); + } + task_drag = 0; + return; + } + Taskbar *tskbar; if ( !(tskbar = click_taskbar(panel, e->xbutton.x, e->xbutton.y)) ) { // TODO: check better solution to keep window below @@ -470,10 +490,11 @@ void event_property_notify (XEvent *e) server.nb_desktop = server_get_number_of_desktop (); cleanup_taskbar(); init_taskbar(); - visible_object(); for (i=0 ; i < nb_panel ; i++) { + set_panel_items(&panel1[i]); panel1[i].area.resize = 1; } + visible_object(); task_refresh_tasklist(); active_task(); panel_refresh = 1; @@ -755,7 +776,7 @@ start: else { if (panel->temp_pmap) XFreePixmap(server.dsp, panel->temp_pmap); panel->temp_pmap = XCreatePixmap(server.dsp, server.root_win, panel->area.width, panel->area.height, server.depth); - refresh(&panel->area); + rendering(panel); XCopyArea(server.dsp, panel->temp_pmap, panel->main_win, server.gc, 0, 0, panel->area.width, panel->area.height, 0, 0); } } @@ -825,7 +846,7 @@ start: Panel* panel = get_panel(e.xmotion.window); Area* area = click_area(panel, e.xmotion.x, e.xmotion.y); if (area->_get_tooltip_text) - tooltip_trigger_show(area, panel, e.xmotion.x_root, e.xmotion.y_root); + tooltip_trigger_show(area, panel, &e); else tooltip_trigger_hide(); break; @@ -863,7 +884,7 @@ start: signal_pending = SIGUSR1; break; } - if (e.xany.window == g_tooltip.window || !systray.area.on_screen) + if (e.xany.window == g_tooltip.window || !systray_enabled) break; for (it = systray.list_icons; it; it = g_slist_next(it)) { if (((TrayWindow*)it->data)->tray_id == e.xany.window) { @@ -883,7 +904,7 @@ start: // Start real_transparency signal_pending = SIGUSR1; } - if (systray.area.on_screen && e.xclient.message_type == server.atom._NET_SYSTEM_TRAY_OPCODE && e.xclient.format == 32 && e.xclient.window == net_sel_win) { + if (systray_enabled && e.xclient.message_type == server.atom._NET_SYSTEM_TRAY_OPCODE && e.xclient.format == 32 && e.xclient.window == net_sel_win) { net_message(&e.xclient); } else if (e.xclient.message_type == server.atom.XdndPosition) {