#include "window.h"
#include "task.h"
#include "panel.h"
+#include "tooltip.h"
int signal_pending;
int panel_mode;
int wm_menu;
+int panel_dock=0; // default not in the dock
int panel_position;
int panel_horizontal;
int panel_refresh;
Panel *panel1 = 0;
int nb_panel;
+Imlib_Image default_icon;
void init_panel()
int i;
Panel *p;
+ // load default icon
+ char *path;
+ const gchar * const *data_dirs;
+ data_dirs = g_get_system_data_dirs ();
+ for (i = 0; data_dirs[i] != NULL; i++) {
+ path = g_build_filename(data_dirs[i], "tint2", "default_icon.png", NULL);
+ if (g_file_test (path, G_FILE_TEST_EXISTS))
+ default_icon = imlib_load_image(path);
+ g_free(path);
+ }
+
for (i=0 ; i < nb_panel ; i++) {
p = &panel1[i];
// printf("panel : posx %d, posy %d, width %d, height %d\n", p->posx, p->posy, p->area.width, p->area.height);
// Catch some events
- XSetWindowAttributes att = { ParentRelative, 0L, 0, 0L, 0, 0, Always, 0L, 0L, False, ExposureMask|ButtonPressMask|ButtonReleaseMask, NoEventMask, False, 0, 0 };
+ long event_mask = ExposureMask|ButtonPressMask|ButtonReleaseMask;
+ if (g_tooltip.enabled)
+ event_mask |= PointerMotionMask|LeaveWindowMask;
+ XSetWindowAttributes att = { ParentRelative, 0L, 0, 0L, 0, 0, Always, 0L, 0L, False, event_mask, NoEventMask, False, 0, 0 };
if (p->main_win) XDestroyWindow(server.dsp, p->main_win);
p->main_win = XCreateWindow(server.dsp, server.root_win, p->posx, p->posy, p->area.width, p->area.height, 0, server.depth, InputOutput, CopyFromParent, CWEventMask, &att);
cleanup_systray();
cleanup_taskbar();
+ if (default_icon) {
+ imlib_context_set_image(default_icon);
+ imlib_free_image();
+ }
+
// font allocated once
if (panel1[0].g_task.font_desc) {
pango_font_description_free(panel1[0].g_task.font_desc);
if (panel1) free(panel1);
panel1 = 0;
+
+ if (g_tooltip.window) {
+ XDestroyWindow(server.dsp, g_tooltip.window);
+ g_tooltip.window = 0;
+ }
+ if (g_tooltip.font_desc) {
+ pango_font_description_free(g_tooltip.font_desc);
+ g_tooltip.font_desc = 0;
+ }
}
// Unfocusable
XWMHints wmhints;
- wmhints.flags = InputHint;
- wmhints.input = False;
- XChangeProperty (server.dsp, p->main_win, XA_WM_HINTS, XA_WM_HINTS, 32, PropModeReplace, (unsigned char *) &wmhints, sizeof (XWMHints) / 4);
+ if (panel_dock) {
+ // TODO: Xdnd feature cannot be used in withdrawn state at the moment (at least GTK apps fail, qt seems to work)
+ wmhints.icon_window = wmhints.window_group = p->main_win;
+ wmhints.flags = StateHint | IconWindowHint;
+ wmhints.initial_state = WithdrawnState;
+ }
+ else {
+ wmhints.flags = InputHint;
+ wmhints.input = False;
+ }
+ XSetWMHints(server.dsp, p->main_win, &wmhints);
// Undecorated
long prop[5] = { 2, 0, 0, 0, 0 };