From 45704e9e1b7798307c0fb9a664b8e759a8524f38 Mon Sep 17 00:00:00 2001 From: Thierry Lorthiois Date: Mon, 8 Jun 2009 16:50:14 +0000 Subject: [PATCH] allow multi_desktop even with multi monitors config --- ChangeLog | 3 +++ doc/tint2.1 | 3 ++- src/config.c | 10 ++++------ src/panel.c | 12 ++++-------- src/panel.h | 2 +- src/taskbar/task.c | 5 +++-- src/tint.c | 2 +- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index a7c5631..9fa021c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2009-06-08 +- allow 'taskbar_mode = multi_desktop' config with 'panel_monitor = all' + 2009-06-07 - merge autotool build system by Christian Ruppert diff --git a/doc/tint2.1 b/doc/tint2.1 index 22d7305..8c35c78 100644 --- a/doc/tint2.1 +++ b/doc/tint2.1 @@ -36,7 +36,8 @@ should also work with other window managers. It's based on ttm code. The goal is compliance with freedesktop specifications. .PP On the first startup tint2 creates a config file in $HOME/.config/tint2/tint2rc. -See the /usr/share/tint2/doc directory for more information. +See the /usr/share/doc/tint2 directory for more information. +Or the wiki page on http://code.google.com/p/tint2/wiki/Welcome .SH OPTIONS .TP .B \-c config-file diff --git a/src/config.c b/src/config.c index afeb071..0815acd 100644 --- a/src/config.c +++ b/src/config.c @@ -415,9 +415,8 @@ void add_entry (char *key, char *value) /* Taskbar */ else if (strcmp (key, "taskbar_mode") == 0) { - if (strcmp (value, "multi_desktop") == 0) panel_mode = MULTI_DESKTOP; - else if (strcmp (value, "single_desktop") == 0) panel_mode = SINGLE_DESKTOP; - else panel_mode = SINGLE_MONITOR; + if (strcmp (value, "single_desktop") == 0) panel_mode = SINGLE_DESKTOP; + else panel_mode = MULTI_DESKTOP; } else if (strcmp (key, "taskbar_padding") == 0) { extract_values(value, &value1, &value2, &value3); @@ -505,9 +504,8 @@ void add_entry (char *key, char *value) /* Read tint-0.6 config for backward compatibility */ else if (strcmp (key, "panel_mode") == 0) { - if (strcmp (value, "multi_desktop") == 0) panel_mode = MULTI_DESKTOP; - else if (strcmp (value, "single_desktop") == 0) panel_mode = SINGLE_DESKTOP; - else panel_mode = SINGLE_MONITOR; + if (strcmp (value, "single_desktop") == 0) panel_mode = SINGLE_DESKTOP; + else panel_mode = MULTI_DESKTOP; } else if (strcmp (key, "panel_rounded") == 0) { Area *a = calloc(1, sizeof(Area)); diff --git a/src/panel.c b/src/panel.c index e202f81..84d5ab9 100644 --- a/src/panel.c +++ b/src/panel.c @@ -118,11 +118,7 @@ void init_panel() // Catch some events XSetWindowAttributes att = { ParentRelative, 0L, 0, 0L, 0, 0, Always, 0L, 0L, False, ExposureMask|ButtonPressMask|ButtonReleaseMask, NoEventMask, False, 0, 0 }; - - // XCreateWindow(display, parent, x, y, w, h, border, depth, class, visual, mask, attrib) - // main_win doesn't include panel.area.paddingx, so we have WM capabilities on left and right. if (p->main_win) XDestroyWindow(server.dsp, p->main_win); - //win = XCreateWindow (server.dsp, server.root_win, p->posx+p->area.paddingxlr, p->posy, p->area.width-(2*p->area.paddingxlr), p->area.height, 0, server.depth, InputOutput, CopyFromParent, CWEventMask, &att); 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); set_panel_properties(p); @@ -229,7 +225,7 @@ void visible_object() for (j=0 ; j < panel->nb_desktop ; j++) { taskbar = &panel->taskbar[j]; if (panel_mode != MULTI_DESKTOP && taskbar->desktop != server.desktop) { - // (SINGLE_DESKTOP or SINGLE_MONITOR) and not current desktop + // SINGLE_DESKTOP and not current desktop taskbar->area.on_screen = 0; } else { @@ -254,8 +250,8 @@ void set_panel_properties(Panel *p) } // Dock - //long val = server.atom._NET_WM_WINDOW_TYPE_DOCK; - //XChangeProperty (server.dsp, p->main_win, server.atom._NET_WM_WINDOW_TYPE, XA_ATOM, 32, PropModeReplace, (unsigned char *) &val, 1); + long val = server.atom._NET_WM_WINDOW_TYPE_DOCK; + XChangeProperty (server.dsp, p->main_win, server.atom._NET_WM_WINDOW_TYPE, XA_ATOM, 32, PropModeReplace, (unsigned char *) &val, 1); // Reserved space long struts [12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -276,7 +272,7 @@ void set_panel_properties(Panel *p) XChangeProperty (server.dsp, p->main_win, server.atom._NET_WM_STRUT_PARTIAL, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &struts, 12); // Sticky and below other window - long val = 0xFFFFFFFF; + val = 0xFFFFFFFF; XChangeProperty (server.dsp, p->main_win, server.atom._NET_WM_DESKTOP, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &val, 1); Atom state[4]; state[0] = server.atom._NET_WM_STATE_SKIP_PAGER; diff --git a/src/panel.h b/src/panel.h index ef4f33c..4de3c59 100644 --- a/src/panel.h +++ b/src/panel.h @@ -32,7 +32,7 @@ extern int mouse_scroll_up; extern int mouse_scroll_down; //panel mode -enum { SINGLE_DESKTOP=0, MULTI_DESKTOP, SINGLE_MONITOR }; +enum { SINGLE_DESKTOP=0, MULTI_DESKTOP }; extern int panel_mode; extern int wm_menu; diff --git a/src/taskbar/task.c b/src/taskbar/task.c index d704f35..866fdb8 100644 --- a/src/taskbar/task.c +++ b/src/taskbar/task.c @@ -45,7 +45,8 @@ void add_task (Window win) new_tsk.win = win; new_tsk.area.panel = &panel1[0]; new_tsk.desktop = window_get_desktop (win); - if (panel_mode == SINGLE_MONITOR) monitor = window_get_monitor (win); +// if (panel_mode == SINGLE_MONITOR) monitor = window_get_monitor (win); + if (nb_panel > 1) monitor = window_get_monitor (win); else monitor = 0; // allocate only one title and one icon @@ -64,7 +65,7 @@ void add_task (Window win) for (i=0 ; i < nb_panel ; i++) { for (j=0 ; j < panel1[i].nb_desktop ; j++) { if (new_tsk.desktop != ALLDESKTOP && new_tsk.desktop != j) continue; - if (panel_mode == SINGLE_MONITOR && panel1[i].monitor != monitor) continue; + if (nb_panel > 1 && panel1[i].monitor != monitor) continue; tskbar = &panel1[i].taskbar[j]; new_tsk2 = malloc(sizeof(Task)); diff --git a/src/tint.c b/src/tint.c index 8da6866..1030b56 100644 --- a/src/tint.c +++ b/src/tint.c @@ -478,7 +478,7 @@ void event_expose (XEvent *e) void event_configure_notify (Window win) { - if (panel_mode != SINGLE_MONITOR) return; + if (nb_panel == 1) return; if (server.nb_monitor == 1) return; Task *tsk = task_get_task (win); -- 2.45.2