]> Dogcows Code - chaz/tint2/blobdiff - src/tint.c
*fix* finish dnd problems and autohide
[chaz/tint2] / src / tint.c
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.026377 seconds and 4 git commands to generate.