X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fpanel.c;h=b136ff34bf11404194f75c1c1b7853111fef8be2;hb=0fcdb76da25111d74fdbd6df0be3c9b4f45fc4bc;hp=cea2923ff834ab8e8b4f3619156ff7672d98364e;hpb=67e4f3189a4dd8191ef07c0fc90f222a5c30255b;p=chaz%2Ftint2 diff --git a/src/panel.c b/src/panel.c index cea2923..b136ff3 100644 --- a/src/panel.c +++ b/src/panel.c @@ -199,7 +199,7 @@ void init_panel() p->main_win = XCreateWindow(server.dsp, server.root_win, p->posx, p->posy, p->area.width, p->area.height, 0, server.depth, InputOutput, server.visual, mask, &att); long event_mask = ExposureMask|ButtonPressMask|ButtonReleaseMask|ButtonMotionMask; - if (p->g_task.tooltip_enabled || p->clock.area._get_tooltip_text) + if (p->g_task.tooltip_enabled || p->clock.area._get_tooltip_text || (launcher_enabled && launcher_tooltip_enabled)) event_mask |= PointerMotionMask|LeaveWindowMask; if (panel_autohide) event_mask |= LeaveWindowMask|EnterWindowMask; @@ -236,6 +236,8 @@ void init_panel_size_and_position(Panel *panel) panel->area.width = (float)server.monitor[panel->monitor].width * panel->area.width / 100; if (panel->pourcenty) panel->area.height = (float)server.monitor[panel->monitor].height * panel->area.height / 100; + if (panel->area.width + panel->marginx > server.monitor[panel->monitor].width) + panel->area.width = server.monitor[panel->monitor].width - panel->marginx; if (panel->area.bg->border.rounded > panel->area.height/2) { printf("panel_background_id rounded is too big... please fix your tint2rc\n"); g_array_append_val(backgrounds, *panel->area.bg); @@ -253,6 +255,8 @@ void init_panel_size_and_position(Panel *panel) panel->area.width = (float)server.monitor[panel->monitor].width * old_panel_height / 100; else panel->area.width = old_panel_height; + if (panel->area.height + panel->marginy > server.monitor[panel->monitor].height) + panel->area.height = server.monitor[panel->monitor].height - panel->marginy; if (panel->area.bg->border.rounded > panel->area.width/2) { printf("panel_background_id rounded is too big... please fix your tint2rc\n"); g_array_append_val(backgrounds, *panel->area.bg); @@ -695,16 +699,10 @@ Area* click_area(Panel *panel, int x, int y) GSList* it = result->list; while (it) { Area* a = it->data; - if (panel_horizontal) { - if (a->on_screen && x >= a->posx && x <= (a->posx + a->width)) { - new_result = a; - break; - } - } else { - if (a->on_screen && y >= a->posy && y <= (a->posy + a->height)) { - new_result = a; - break; - } + if (a->on_screen && x >= a->posx && x <= (a->posx + a->width) + && y >= a->posy && y <= (a->posy + a->height)) { + new_result = a; + break; } it = it->next; }