Fullscreen, KDE and focus
Brought to you by:
anton19286,
const_k
From: <pe...@ce...> - 2002-04-18 09:26:33
|
The vncviewer for UNIX does not work with the KDE window manager in fullscreen. When starting the viewer with the -fullscreen option, the focus in given to the application active before starting vncviewer. All keyboard events are reported to this application, instead of vncviewer. Changing: XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); to: XSetInputFocus(dpy, DefaultRootWindow(dpy), RevertToPointerRoot, CurrentTime); ...in fullscreen.c seems to fix the problem. Another bug: When running vncviewer in fullscreen with a framebuffer smaller than the display, vncviewer makes black borders around the desktop in the middle. If the mouse pointer is outside the desktop, over the black border, keyboard events are not propagated. Also, the F8 menu does not work. This can be fixed by grabbing the keyboard. The included patch fixes both these two problems. For some reason, the grabbing seems not to work after toggling from non-fullscreen to fullscreen mode. I have no idea why. I have also experienced some fullscreen problems with Sawfish: The window is not centered, but rather have a geometry of 1024x768+24+16 or something like that (it should be 1024x768+0+0). The offset seems to change from time to time. I have no idea why this happens; fullscreen.c explicitly reparents the window a (0,0). (This bug exists both with and without my patch.) --- vncviewer/fullscreen.c Sun Jun 11 14:00:53 2000 +++ vncviewer/fullscreen.c Thu Apr 18 11:04:45 2002 @@ -164,10 +164,12 @@ XtVaSetValues(popup, XtNoverrideRedirect, True, NULL); - /* Finally try to get the input focus. With some WMs we might have to grab - the keyboard, but this seems to be OK with the ones I've tried. */ - - XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); + /* Finally try to get the input focus and grab keyboard. */ + XSetInputFocus(dpy, DefaultRootWindow(dpy), RevertToPointerRoot, CurrentTime); + if (XtGrabKeyboard(desktop, True, + GrabModeAsync, GrabModeAsync, CurrentTime) != GrabSuccess) { + fprintf(stderr, "XtGrabKeyboard failed.\n"); + } } @@ -193,6 +195,8 @@ int toplevelHeight = si.framebufferHeight; appData.fullScreen = False; + + XtUngrabKeyboard(desktop, CurrentTime); XtUnmapWidget(toplevel); -- Peter Åstrand Telephone: +46-13-21 46 00 Cendio Systems E-mail: pe...@ce... Teknikringen 3 583 30 Linköping Sweden |