#643 Hide/unhide programatically

This commit is contained in:
Chris Lee
2020-06-27 12:02:00 +00:00
parent 78313502d3
commit 3bdb0e03f2
5 changed files with 157 additions and 16 deletions

View File

@@ -316,7 +316,7 @@ void init_panel()
}
if (panel_autohide)
autohide_trigger_hide(p);
autohide_trigger_hide(p, false);
}
taskbar_refresh_tasklist();
@@ -1139,26 +1139,27 @@ void autohide_hide(void *p)
schedule_panel_redraw();
}
void autohide_trigger_show(Panel *p)
void autohide_trigger_show(Panel *p, bool forced)
{
if (!p)
return;
change_timer(&p->autohide_timer, true, panel_autohide_show_timeout, 0, autohide_show, p);
change_timer(&p->autohide_timer, true, forced ? 0 : panel_autohide_show_timeout, 0, autohide_show, p);
}
void autohide_trigger_hide(Panel *p)
void autohide_trigger_hide(Panel *p, bool forced)
{
if (!p)
return;
Window root, child;
int xr, yr, xw, yw;
unsigned int mask;
if (XQueryPointer(server.display, p->main_win, &root, &child, &xr, &yr, &xw, &yw, &mask))
if (child)
return; // mouse over one of the system tray icons
change_timer(&p->autohide_timer, true, panel_autohide_hide_timeout, 0, autohide_hide, p);
if (!forced) {
Window root, child;
int xr, yr, xw, yw;
unsigned int mask;
if (XQueryPointer(server.display, p->main_win, &root, &child, &xr, &yr, &xw, &yw, &mask))
if (child)
return; // mouse over one of the system tray icons
}
change_timer(&p->autohide_timer, true, forced ? 0 : panel_autohide_hide_timeout, 0, autohide_hide, p);
}
void shrink_panel(Panel *panel)