*fix* uninstall all timers on reconfiguring
#include "config.h"
#include "window.h"
#include "tooltip.h"
#include "config.h"
#include "window.h"
#include "tooltip.h"
#ifdef ENABLE_BATTERY
#include "battery.h"
#ifdef ENABLE_BATTERY
#include "battery.h"
list_back = g_slist_append(0, calloc(1, sizeof(Area)));
// tint2 could reload config, so we cleanup objects
list_back = g_slist_append(0, calloc(1, sizeof(Area)));
// tint2 could reload config, so we cleanup objects
cleanup_systray();
#ifdef ENABLE_BATTERY
cleanup_battery();
cleanup_systray();
#ifdef ENABLE_BATTERY
cleanup_battery();
XChangeProperty(server.dsp, p->main_win, server.atom.XdndAware, XA_ATOM, 32, PropModeReplace, (unsigned char*)&version, 1);
// Reserved space
XChangeProperty(server.dsp, p->main_win, server.atom.XdndAware, XA_ATOM, 32, PropModeReplace, (unsigned char*)&version, 1);
// Reserved space
+ unsigned int d1, screen_width, screen_height;
+ Window d2;
+ int d3;
+ XGetGeometry(server.dsp, server.root_win, &d2, &d3, &d3, &screen_width, &screen_height, &d1, &d1);
+ Monitor monitor = server.monitor[p->monitor];
long struts [12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
if (panel_horizontal) {
if (panel_position & TOP) {
long struts [12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
if (panel_horizontal) {
if (panel_position & TOP) {
- struts[2] = p->area.height + p->marginy;
+ struts[2] = p->area.height + p->marginy + monitor.y;
struts[8] = p->posx;
// p->area.width - 1 allowed full screen on monitor 2
struts[9] = p->posx + p->area.width - 1;
}
else {
struts[8] = p->posx;
// p->area.width - 1 allowed full screen on monitor 2
struts[9] = p->posx + p->area.width - 1;
}
else {
- struts[3] = p->area.height + p->marginy;
+ struts[3] = p->area.height + p->marginy + screen_height - monitor.y - monitor.height;
struts[10] = p->posx;
// p->area.width - 1 allowed full screen on monitor 2
struts[11] = p->posx + p->area.width - 1;
struts[10] = p->posx;
// p->area.width - 1 allowed full screen on monitor 2
struts[11] = p->posx + p->area.width - 1;
}
else {
if (panel_position & LEFT) {
}
else {
if (panel_position & LEFT) {
- struts[0] = p->area.width + p->marginx;
+ struts[0] = p->area.width + p->marginx + monitor.x;
struts[4] = p->posy;
// p->area.width - 1 allowed full screen on monitor 2
struts[5] = p->posy + p->area.height - 1;
}
else {
struts[4] = p->posy;
// p->area.width - 1 allowed full screen on monitor 2
struts[5] = p->posy + p->area.height - 1;
}
else {
- struts[1] = p->area.width + p->marginx;
+ struts[1] = p->area.width + p->marginx + screen_width - monitor.x - monitor.width;
struts[6] = p->posy;
// p->area.width - 1 allowed full screen on monitor 2
struts[7] = p->posy + p->area.height - 1;
struts[6] = p->posy;
// p->area.width - 1 allowed full screen on monitor 2
struts[7] = p->posy + p->area.height - 1;
if (!g_tooltip.font_desc)
g_tooltip.font_desc = pango_font_description_from_string("sans 10");
if (!g_tooltip.font_desc)
g_tooltip.font_desc = pango_font_description_from_string("sans 10");
- if (g_tooltip.show_timer_id == 0)
- g_tooltip.show_timer_id = install_timer(0, 0, 0, 0, tooltip_show);
- if (g_tooltip.hide_timer_id == 0)
- g_tooltip.hide_timer_id = install_timer(0, 0, 0, 0, tooltip_hide);
+ g_tooltip.show_timer_id = install_timer(0, 0, 0, 0, tooltip_show);
+ g_tooltip.hide_timer_id = install_timer(0, 0, 0, 0, tooltip_hide);
XSetWindowAttributes attr;
attr.override_redirect = True;
XSetWindowAttributes attr;
attr.override_redirect = True;
timer_iter = timer_iter->next;
}
}
timer_iter = timer_iter->next;
}
}
+
+
+void uninstall_all_timer()
+{
+ while (timer_list) {
+ struct timer* t = timer_list->data;
+ uninstall_timer(t->id);
+ }
+}
/** uninstalls a timer with the given 'id'. If no timer is installed with this id nothing happens **/
void uninstall_timer(int id);
/** uninstalls a timer with the given 'id'. If no timer is installed with this id nothing happens **/
void uninstall_timer(int id);
+/** uninstalls all timer. Calls uninstall_timer for all available id's **/
+void uninstall_all_timer();
+