]> Dogcows Code - chaz/tint2/commitdiff
*fix* finish dnd problems and autohide
authorAndreas Fink <andreas.fink85@googlemail.com>
Sat, 26 Jun 2010 12:35:35 +0000 (12:35 +0000)
committerAndreas Fink <andreas.fink85@googlemail.com>
Sat, 26 Jun 2010 12:35:35 +0000 (12:35 +0000)
src/panel.c
src/panel.h
src/server.c
src/server.h
src/tint.c

index 1c5fbd8b11b039a92991f3aec84a4dfed9acab4b..c8c945eea244d03a3f7d31a7a8a5b13222594512 100644 (file)
@@ -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;
index 2b2a5707b3ff31bc2e68782564fdbf0c9328ddee..c367213511807d698a80777e6ed17095d24d7440 100644 (file)
@@ -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);
 
index bfff48d9c43582b4549a54536a16e9a8d008e081..ee0006da91ae295860388baba692e713639def90 100644 (file)
@@ -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);
 }
 
 
index 5d96c3ee563dd7e4426642db2b687ce839b2f5d1..8237a39b199faf22abbe69598772483d835d6dc3 100644 (file)
@@ -69,6 +69,7 @@ typedef struct Global_atom
        Atom XdndAware;
        Atom XdndPosition;
        Atom XdndStatus;
+       Atom XdndLeave;
 } Global_atom;
 
 
index 8052aecc3bce02837e9ad74e0c330521284f67fa..8316bdde59a56f8a0fb841731f72391b2fce2d00 100644 (file)
@@ -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) {
This page took 0.031002 seconds and 4 git commands to generate.