From: Andreas Fink Date: Sat, 26 Jun 2010 12:35:35 +0000 (+0000) Subject: *fix* finish dnd problems and autohide X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=57dab661b3f5b1c318f782cdc00c5e534dfe58d9;p=chaz%2Ftint2 *fix* finish dnd problems and autohide --- diff --git a/src/panel.c b/src/panel.c index 1c5fbd8..c8c945e 100644 --- a/src/panel.c +++ b/src/panel.c @@ -71,11 +71,6 @@ GArray* backgrounds; Imlib_Image default_icon; - -void autohide_hide(void* p); -void autohide_show(void* p); - - void default_panel() { panel1 = 0; diff --git a/src/panel.h b/src/panel.h index 2b2a570..c367213 100644 --- a/src/panel.h +++ b/src/panel.h @@ -149,6 +149,7 @@ int click_clock(Panel *panel, int x, int y); Area* click_area(Panel *panel, int x, int y); void autohide_show(void* p); +void autohide_hide(void* p); void autohide_trigger_show(Panel* p); void autohide_trigger_hide(Panel* p); diff --git a/src/server.c b/src/server.c index bfff48d..ee0006d 100644 --- a/src/server.c +++ b/src/server.c @@ -95,6 +95,7 @@ void server_init_atoms () server.atom.XdndAware = XInternAtom(server.dsp, "XdndAware", False); server.atom.XdndPosition = XInternAtom(server.dsp, "XdndPosition", False); server.atom.XdndStatus = XInternAtom(server.dsp, "XdndStatus", False); + server.atom.XdndLeave = XInternAtom(server.dsp, "XdndLeave", False); } diff --git a/src/server.h b/src/server.h index 5d96c3e..8237a39 100644 --- a/src/server.h +++ b/src/server.h @@ -69,6 +69,7 @@ typedef struct Global_atom Atom XdndAware; Atom XdndPosition; Atom XdndStatus; + Atom XdndLeave; } Global_atom; diff --git a/src/tint.c b/src/tint.c index 8052aec..8316bdd 100644 --- a/src/tint.c +++ b/src/tint.c @@ -708,6 +708,7 @@ int main (int argc, char *argv[]) Panel *panel; GSList *it; struct timeval* timeout; + int hidden_dnd = 0; start: init (argc, argv); @@ -791,11 +792,17 @@ start: else if (e.type == LeaveNotify) autohide_trigger_hide(panel); if (panel->is_hidden) { - if (e.type == ClientMessage && e.xclient.message_type == server.atom.XdndPosition) + if (e.type == ClientMessage && e.xclient.message_type == server.atom.XdndPosition) { + hidden_dnd = 1; autohide_show(panel); + } else continue; // discard further processing of this event because the panel is not visible yet } + else if (hidden_dnd && e.type == ClientMessage && e.xclient.message_type == server.atom.XdndLeave) { + hidden_dnd = 0; + autohide_hide(panel); + } } switch (e.type) {