Skip to content

Commit

Permalink
* xlwmenu.c (remap_menubar): Re-realize menu to force move under Gnom…
Browse files Browse the repository at this point in the history
…e 3.
  • Loading branch information
Jan D committed Feb 28, 2015
1 parent 1a50945 commit e605af8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
5 changes: 5 additions & 0 deletions lwlib/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2015-02-28 Jan Djärv <jan.h.d@swipnet.se>

* xlwmenu.c (remap_menubar): Re-realize menu to force move under
Gnome 3.

2015-01-04 Paul Eggert <eggert@cs.ucla.edu>

Less 'make' chatter for lwlib
Expand Down
15 changes: 10 additions & 5 deletions lwlib/xlwmenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1510,17 +1510,21 @@ remap_menubar (XlwMenuWidget mw)
if (mw->menu.horizontal && i == 1)
ws->y += mw->menu.margin;

/* WMs like Gnome 3 ignores requests to move windows. So we
must destroy the current one and create a new to get it to move. */
XtUnrealizeWidget (ws->w);
XtRealizeWidget (ws->w);
ws->window = XtWindow (ws->w);

size_menu (mw, i);

fit_to_screen (mw, ws, previous_ws, mw->menu.horizontal && i == 1);

create_pixmap_for_menu (ws, mw);
XtMoveWidget (ws->w, ws->x, ws->y);
XtPopup (ws->w, XtGrabNone);
XtResizeWidget (ws->w, ws->width, ws->height,
mw->core.border_width);
XtResizeWindow (ws->w);
XtConfigureWidget (ws->w, ws->x, ws->y, ws->width, ws->height,
ws->w->core.border_width);
display_menu (mw, i, False, &selection_position, NULL, NULL);
XtPopup (ws->w, XtGrabNone);
}

/* unmap the menus that popped down */
Expand Down Expand Up @@ -2615,6 +2619,7 @@ pop_up_menu (XlwMenuWidget mw, XButtonPressedEvent *event)
mw->menu.popped_up = True;
if (XtIsShell (XtParent ((Widget)mw)))
{
fprintf(stderr, "Config %d %d\n", x, y);
XtConfigureWidget (XtParent ((Widget)mw), x, y, w, h,
XtParent ((Widget)mw)->core.border_width);
XtPopup (XtParent ((Widget)mw), XtGrabExclusive);
Expand Down

0 comments on commit e605af8

Please sign in to comment.