From 357e37282aa2445b304067984a5f84d2d5b17379 Mon Sep 17 00:00:00 2001 From: "Andreas.Fink85" Date: Sat, 26 Jun 2010 12:35:35 +0000 Subject: [PATCH] *fix* finish dnd problems and autohide git-svn-id: http://tint2.googlecode.com/svn/trunk@514 121b4492-b84c-0410-8b4c-0d4edfb3f3cc --- src/panel.c | 5 ----- src/panel.h | 1 + src/server.c | 1 + src/server.h | 1 + src/tint.c | 9 ++++++++- 5 files changed, 11 insertions(+), 6 deletions(-) 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) {