combined_menu = menu_new(MENU_NAME, _("Windows"), TRUE, NULL);
menu_set_update_func(combined_menu, self_update);
menu_set_execute_func(combined_menu, menu_execute);
+ combined_menu->warp = TRUE;
}
void client_list_combined_menu_shutdown(gboolean reconfig)
menu_frame_place_topmenu(self, &x, &y);
menu_frame_move(self, x, y);
-
XMapWindow(obt_display, self->window);
if (screen_pointer_pos(&px, &py)) {
- ObMenuEntryFrame *e = menu_entry_frame_under(px, py);
- if (e && e->frame == self)
- e->ignore_enters++;
+
+ if (self->menu->warp) {
+ x += self->area.width / 2;
+ XWarpPointer(obt_display, None, obt_root(ob_screen), 0, 0, 0, 0, x, y);
+ self->ox = px;
+ self->oy = py;
+ } else {
+ ObMenuEntryFrame *e = menu_entry_frame_under(px, py);
+ if (e && e->frame == self)
+ e->ignore_enters++;
+ }
}
+
return TRUE;
}
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);