allow multi_desktop even with multi monitors config

git-svn-id: http://tint2.googlecode.com/svn/trunk@104 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
lorthiois@bbsoft.fr 2009-06-08 16:50:14 +00:00
parent 39480ccace
commit d47cfb0761
7 changed files with 18 additions and 19 deletions

View file

@ -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

View file

@ -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

View file

@ -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));

View file

@ -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;

View file

@ -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;

View file

@ -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));

View file

@ -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);