FVWM Bug Tracking notification

new message incoming/1050

Message summary for PR#1050
        From: [EMAIL PROTECTED]
        Subject: focus lost after option menu selection
        Date: Tue, 24 Jun 2003 03:37:50 -0500
        0 replies       0 followups

====> ORIGINAL MESSAGE FOLLOWS <====

>From [EMAIL PROTECTED] Tue Jun 24 03:37:50 2003
Received: from lserv00.math.uh.edu ([129.7.128.99])
        by util2.math.uh.edu with esmtp (Exim 4.10)
        id 19UjJG-0007rf-00
        for [EMAIL PROTECTED]; Tue, 24 Jun 2003 03:37:50 -0500
Received: from localhost (lserv00.math.uh.edu [127.0.0.1])
        by lserv00.math.uh.edu (8.11.6/8.11.1) with ESMTP id h5O8bom01591
        for <[EMAIL PROTECTED]>; Tue, 24 Jun 2003 03:37:50 -0500
Date: Tue, 24 Jun 2003 03:37:50 -0500
Message-Id: <[EMAIL PROTECTED]>
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: focus lost after option menu selection

Full_Name: E. Weber
Version: 2.4.14
CVS_Date: 
OS: red hat linux 8.0
X_Server: Xfree86, Exceed
Submission from: (NULL) (53.122.197.194)


The problem appears while using Motif (version 2.2.3) option menus under
FVWM2 with the  Focus Follows Mouse option. (It doesn't appear with fvwm1
or with Click To Focus option).
Selecting option menu entries twice or more the option menu looses focus.
The related window is still the active window, but there isn't a focus in
the whole window. 
Focus reappears as the mouse is moved out of the window and in again.

The problem seems to be caused by calling XmAddWMProtocolCallback for Atom
WM_TAKE_FOCUS.
Reproduction of the problem can be done with the following code: 

#include <stdio.h>
#include <stdlib.h>
#include <Xm/Xm.h>
#include <Xm/PushB.h>
#include <Xm/RowColumn.h>
#include <Xm/RowColumn.h>
#include <Xm/Protocols.h>
  

void emptyCB(Widget widget, XtPointer clientDaten, XtPointer aufrufDaten)
{}

int main(int argc, char **argv)
{
        XtAppContext kontext;
        Widget  applShell;
        Widget  box, option_menu, menu, button1, button2;
        int ac=0;
        Arg al[64];

        applShell= XtAppInitialize( &kontext, "focustest", (XrmOptionDescRec*)
NULL, 0, &argc, argv, (String*) NULL, (Arg*) NULL, 0);
        box= XtCreateManagedWidget("box", xmRowColumnWidgetClass, applShell,
(Arg*)NULL, 0);
        option_menu = XmCreateOptionMenu ( box, (char *) "option_menu", al, ac
);
        menu = XmCreatePulldownMenu ( option_menu, (char *) "menu", al, ac );
        button1 = XtCreateManagedWidget("button1", xmPushButtonWidgetClass, 
menu,
(Arg*)NULL, 0);
        button2 = XtCreateManagedWidget("button2", xmPushButtonWidgetClass, 
menu,
(Arg*)NULL, 0);

        XtSetArg(al[ac], XmNsubMenuId, menu); ac++;
        XtSetValues(option_menu, al, ac);
        XtManageChild(option_menu);
    
        Atom  wm_take_focus = XInternAtom( XtDisplay( applShell 
),"WM_TAKE_FOCUS",
True );
        XmAddWMProtocolCallback( applShell, wm_take_focus,  emptyCB,
(XtPointer) NULL );
  
        XtRealizeWidget(applShell);
        XtAppMainLoop (kontext);
}






--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to