Only warp on menu close if it was also the top level menu.
authorMikael Magnusson <mikachu@gmail.com>
Sun, 8 Feb 2009 16:35:26 +0000 (17:35 +0100)
committerMikael Magnusson <mikachu@gmail.com>
Sun, 8 Feb 2009 16:35:26 +0000 (17:35 +0100)
openbox/menuframe.c

index 73364a894b74dcfbcae2ea09914e7d4cc4f50a99..3a2e2f1b2fbea91d1a712b8ffe57d3410aa3b0de 100644 (file)
@@ -1052,6 +1052,9 @@ static void menu_frame_hide(ObMenuFrame *self)
     if (self->child)
         menu_frame_hide(self->child);
 
+    if (!self->parent && self->menu->warp)
+        XWarpPointer(obt_display, None, obt_root(ob_screen), 0, 0, 0, 0, self->ox, self->oy);
+
     if (self->parent)
         self->parent->child = NULL;
     self->parent = NULL;
@@ -1065,9 +1068,6 @@ static void menu_frame_hide(ObMenuFrame *self)
         ungrab_keyboard();
     }
 
-    if (self->menu->warp)
-        XWarpPointer(obt_display, None, obt_root(ob_screen), 0, 0, 0, 0, self->ox, self->oy);
-
     XUnmapWindow(obt_display, self->window);
 
     menu_frame_free(self);