added basic launcher by mrovi

git-svn-id: http://tint2.googlecode.com/svn/trunk@521 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
thilor77
2010-08-02 17:12:07 +00:00
parent 73c0b524af
commit 7e17a3c7f0
5 changed files with 109 additions and 3 deletions

View File

@@ -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();
@@ -159,6 +161,7 @@ void cleanup()
cleanup_panel();
cleanup_tooltip();
cleanup_clock();
cleanup_launcher();
#ifdef ENABLE_BATTERY
cleanup_battery();
#endif
@@ -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