--- WindowMaker-0.91.0/src/menu.c.vns 2005-05-18 21:46:03 +0400
+++ WindowMaker-0.91.0/src/menu.c 2005-05-18 21:46:03 +0400
@@ -2077,6 +2077,7 @@
static void
menuMouseDown(WObjDescriptor *desc, XEvent *event)
{
+ WWindow *wwin; // ADDED BY HMEPAS FOR sw_rclick
XButtonEvent *bev = &event->xbutton;
WMenu *menu = desc->parent;
WMenu *smenu;
@@ -2160,7 +2161,27 @@
}
} else if (!delayed_select) {
- selectEntry(menu, entry_no);
+ // ADDED BY HMEPAS
+ // FOR WindowMenu open by right click on
+ // switchmenu entry
+ if( menu == scr->switch_menu && event->xbutton.button == Button3 ) {
+ selectEntry(menu, entry_no);
+ OpenWindowMenu2( (WWindow*)entry->clientdata,
+ event->xbutton.x_root,
+ event->xbutton.y_root, False);
+ wwin = (WWindow*)entry->clientdata;
+ desc = &wwin->screen_ptr->window_menu->menu->descriptor;
+ event->xany.send_event = True;
+ (*desc->handle_mousedown)(desc, event);
+
+ XUngrabPointer(dpy, CurrentTime);
+ selectEntry(menu, -1);
+ return;
+ }
+ else {
+ selectEntry(menu, entry_no);
+ }
+ // END OF HMEPAS PATCH
}
if (!wPreferences.wrap_menus && !wPreferences.scrollable_menus) {
--- WindowMaker-0.91.0/src/funcs.h.vns 2004-10-14 22:03:28 +0400
+++ WindowMaker-0.91.0/src/funcs.h 2005-05-18 21:46:03 +0400
@@ -65,6 +65,13 @@
void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard);
+// THIS IS NEED FOR MY SW_RIGHT CLICK PATCH
+// (FOR MOVING WINDOW FROM ANOTHER WORKSPACE TO
+// CURRENT) ON NATIVE FUNCTION MOVE TO CURRENT
+// WORKSPACE IS DISABLED
+// HMEPAS
+void OpenWindowMenu2(WWindow *wwin, int x, int y, int keyboard);
+
void OpenMiniwindowMenu(WWindow *wwin, int x, int y);
void OpenWorkspaceMenu(WScreen *scr, int x, int y);
--- WindowMaker-0.91.0/src/winmenu.c.vns 2004-10-21 07:21:16 +0400
+++ WindowMaker-0.91.0/src/winmenu.c 2005-05-18 21:52:50 +0400
@@ -619,7 +619,6 @@
wMenuRealize(menu);
}
-
void
OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard)
{
@@ -650,10 +649,46 @@
updateMenuForWindow(menu, wwin);
x -= menu->frame->core->width/2;
- if (x + menu->frame->core->width > wwin->frame_x+wwin->frame->core->width)
- x = wwin->frame_x+wwin->frame->core->width - menu->frame->core->width;
- if (x < wwin->frame_x)
- x = wwin->frame_x;
+ if (!wwin->flags.internal_window)
+ wMenuMapAt(menu, x, y, keyboard);
+}
+
+void
+OpenWindowMenu2(WWindow *wwin, int x, int y, int keyboard)
+{
+ int i;
+ WMenu *menu;
+ WScreen *scr = wwin->screen_ptr;
+
+ wwin->flags.menu_open_for_me = 1;
+
+ if (!scr->window_menu) {
+ scr->window_menu = createWindowMenu(scr);
+
+ /* hack to save some memory allocation/deallocation */
+ wfree(scr->window_menu->entries[MC_MINIATURIZE]->text);
+ wfree(scr->window_menu->entries[MC_MAXIMIZE]->text);
+ wfree(scr->window_menu->entries[MC_SHADE]->text);
+ } else {
+ updateWorkspaceMenu(scr->workspace_submenu);
+ }
+
+ menu = scr->window_menu;
+ if (menu->flags.mapped) {
+ wMenuUnmap(menu);
+ if (menu->entries[0]->clientdata==wwin) {
+ return;
+ }
+ }
+
+ updateMenuForWindow(menu, wwin);
+
+ for (i = 0; i < scr->workspace_submenu->entry_no; i++) {
+ scr->workspace_submenu->entries[i]->clientdata = wwin;
+ wMenuSetEnabled(scr->workspace_submenu, i, True);
+ }
+
+ x -= menu->frame->core->width/2;
if (!wwin->flags.internal_window)
wMenuMapAt(menu, x, y, keyboard);