pointer frozen when creating a popup menu

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

3 posts / 0 new
Last post
pointer frozen when creating a popup menu

Submitted by YvesLaprie on Tue, 05/11/2010 - 14:07. General Questions
I just changed to Ubuntu 10.4 and the pointer is frozzen when a popup menu should appear.

To replicate this new problem I just used the program simple_popup.c from http://www.ist.co.uk/motif/books/vol6A/ch-19.fm.html.
After clicking the button 3 (the right one) the pointer is locked in the window without any popup menu.

Is there any solution?

/* simple_popup.c -- demonstrate how to use a simple popup menu.
** Create a main window that contains a DrawingArea widget, which
** displays a popup menu when the user presses the third mouse button.
*/

#include
#include
#include

main (int argc, char *argv[])
{
XmString line, square, circle, exit_b, exit_acc;
Widget toplevel, main_w, drawing_a, popup_menu;
void popup_cb(Widget, XtPointer, XtPointer);
XtAppContext app;
Arg args[4];
int n;

XtSetLanguageProc (NULL, NULL, NULL);
toplevel = XtVaOpenApplication (&app, "Demos", NULL, 0, &argc, argv, NULL,
sessionShellWidgetClass, NULL);

/* Create a MainWindow widget that contains a DrawingArea in
** its work window.
*/
n = 0;
XtSetArg (args[n], XmNscrollingPolicy, XmAUTOMATIC); n++;
main_w = XmCreateMainWindow (toplevel, "main_w", args, n);

/* Create a DrawingArea -- no actual drawing will be done. */
n = 0;
XtSetArg (args[n], XmNwidth, 500); n++;
XtSetArg (args[n], XmNheight, 500); n++;
drawing_a = XmCreateDrawingArea (main_w, "drawing_a", args, n);
XtManageChild (drawing_a);

line = XmStringCreateLocalized ("Line");
square = XmStringCreateLocalized ("Square");
circle = XmStringCreateLocalized ("Circle");
exit_b = XmStringCreateLocalized ("Exit");
exit_acc = XmStringCreateLocalized ("Ctrl+C");
popup_menu = XmVaCreateSimplePopupMenu (drawing_a, "popup", popup_cb,
XmNpopupEnabled, XmPOPUP_AUTOMATIC,
XmVaPUSHBUTTON, line, 'L', NULL, NULL,
XmVaPUSHBUTTON, square, 'S', NULL, NULL,
XmVaPUSHBUTTON, circle, 'C', NULL, NULL,
XmVaSEPARATOR,
XmVaPUSHBUTTON, exit_b, 'x', "Ctrlc", exit_acc,
NULL);
XmStringFree (line);
XmStringFree (square);
XmStringFree (circle);
XmStringFree (exit_b);
XmStringFree (exit_acc);

XtManageChild (main_w);
XtRealizeWidget (toplevel);
XtAppMainLoop (app);
}

/* popup_cb() -- invoked when the user selects an item in the popup menu */
void popup_cb (Widget menu_item, XtPointer client_data, XtPointer call_data)
{
int item_no = (int) client_data;

if (item_no == 3) /* Exit was selected -- exit */
exit (0);

/* Otherwise, just print the selection */
puts (XtName (menu_item));
}

dpeterc

I have tried your sample on OpenSUSE 10.3 and 11.1, but I could not reproduce the bug.

On further research, I found another motif based program with the same problem, and in this thread, they suggest upgrading to xorg-1.8.0 fixes the issue.
http://groups.google.com/group/baudline/browse_thread/thread/5b2574052f2...

Let me know if that really works, since I will bounce it the same problem sooner or later.

YvesLaprie

I have installed xorg-1.8.0.902 (and a long long series of depedencies ;-)) and also openMotif 2.3.3.
The good point is that the mouse is not trapped anymore in the window (and thus there is no need to kill the application).
The bad point is that there is no popup menu.

I also sent a bug report in Ubuntu.