[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

1310.0. "XSetInputFocus and pointer location" by KAOT01::K_BURECHAILO () Mon Aug 21 1989 11:33

    
    I am using XRaiseWindow and XSetInputFocus to raise an existing
    'Fileview - Task Output' window and give it focus. Some text is output
    to this window and some input is solicited. This is required by some
    code that writes to sys$output. This seems to work nicely except that
    the pointer has to be over the window in order to input from the
    keyboard. When the pointer is moved out of the window, input is no
    longer accepted. If MB1 is pressed, even though the window already has
    focus, you can then move the pointer anywhere on the screen, and the
    window still accepts input from the keyboard. Can someone explain this
    behavior, and suggest what I can do to make the window behave as if MB1
    were pressed (without pressing it of course). 
    

T.RTitleUserPersonal
Name
DateLines
1310.1LEOVAX::TREGGIARIMon Aug 21 1989 13:407
Check to make sure that you are using a valid "time" in your call to 
XSetInputFocus (try using CurrentTime, for example, to see if it makes
any difference).  It sounds as if your application really doesn't have input
focus, nor does any other application.

Leo

1310.2I tried using CurrentTimeKAOT01::K_BURECHAILOMon Aug 21 1989 14:0015
    I am using CurrentTime. Here is the code fragment that does the
    job. The call to XWarpPointer is in here to work around the problem
    of having to move the pointer over the window. The title bar in
    the Task Output window changes after the call to XSetInputFocus,
    so it looks like the window receives focus.
    
    if (windowAttributes.map_state != IsUnmapped){
      XRaiseWindow(display,taskWindow);
      if (XWarpPointer (display, None, root, 0, 0, 0, 0,500,500) != Success)
        printf("bad call to warp pointer\n");
      XSetInputFocus(display,taskWindow,RevertToPointerRoot,CurrentTime);
      XFlush(display);
    }