all repos — tint2 @ 140f32e28e67a6b9179951938b8fdf4b6683b327

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

fixed tooltip_adjust_geometry with multi monitor

git-svn-id: http://tint2.googlecode.com/svn/trunk@246 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
lorthiois@bbsoft.fr lorthiois@bbsoft.fr@121b4492-b84c-0410-8b4c-0d4edfb3f3cc
commit

140f32e28e67a6b9179951938b8fdf4b6683b327

parent

e8b4fb6bbcd7da6058e6ef9807edcf5145a290ed

1 files changed, 11 insertions(+), 7 deletions(-)

jump to
M src/tooltip/tooltip.csrc/tooltip/tooltip.c

@@ -146,7 +146,10 @@ y = panel->posy + panel->area.height;

else if (panel_position & LEFT) x = panel->posx + panel->area.width; else - x = panel->posx - width; + x = panel->posx - width; + + //printf("tooltip_update_geometry x_root %d, y_root %d\n", x, y); + //printf(" panel posx %d, posy %d\n", panel->posx, panel->posy); g_object_unref(layout); cairo_destroy(c); cairo_surface_destroy(cs);

@@ -160,8 +163,8 @@ // it seems quite impossible that the height needs to be adjusted, but we do it anyway.

int min_x, min_y, max_width, max_height; Panel* panel = g_tooltip.task->area.panel; - int screen_width = server.monitor[panel->monitor].width; - int screen_height = server.monitor[panel->monitor].height; + int screen_width = server.monitor[panel->monitor].x + server.monitor[panel->monitor].width; + int screen_height = server.monitor[panel->monitor].y + server.monitor[panel->monitor].height; if ( x+width <= screen_width && y+height <= screen_height && x>=0 && y>=0) return; // no adjustment needed

@@ -184,10 +187,10 @@ else

min_x=0; } - if (x+width > server.monitor[panel->monitor].width) - x = server.monitor[panel->monitor].width-width; - if ( y+height>server.monitor[panel->monitor].height) - y = server.monitor[panel->monitor].height-height; + if (x+width > server.monitor[panel->monitor].x + server.monitor[panel->monitor].width) + x = server.monitor[panel->monitor].x + server.monitor[panel->monitor].width - width; + if ( y+height > server.monitor[panel->monitor].y + server.monitor[panel->monitor].height) + y = server.monitor[panel->monitor].y + server.monitor[panel->monitor].height - height; if (x<min_x) x=min_x;

@@ -197,6 +200,7 @@ if (y<min_y)

y=min_y; if (height>max_height) height=max_height; + //printf("tooltip_adjust_geometry x_root %d, y_root %d\n", x, y); } void tooltip_update()