* Source/x11/XGServerWindow.m (-setIgnoreMouse::): New method

that allows to ignore mouse events for a window.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36855 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2013-07-08 20:46:07 +00:00
parent 2fc0d26b47
commit e74cf49cda
2 changed files with 62 additions and 39 deletions

View file

@ -1,3 +1,8 @@
2013-07-08 Fred Kiefer <FredKiefer@gmx.de>
* Source/x11/XGServerWindow.m (-setIgnoreMouse::): New method that
allows to ignore mouse events for a window.
2013-07-04 Richard Frith-Macdonald <rfm@gnu.org>
* Tools/GNUmakefile.preamble:
@ -9,7 +14,7 @@
* Source/x11/XGGLFormat.m:
* Headers/x11/XGOpenGL.h:
ARGB visual is only picked if NSOpenGLPFAAlphaSize is
specified in the pixel format.
specified in the pixel format.
2013-07-03 Ivan Vucica <ivan@vucica.net>
@ -6341,4 +6346,3 @@ Thu Apr 11 22:24:01 2002 Nicola Pero <n.pero@mi.flashnet.it>
2002-03-27 Adam Fedor <fedor@gnu.org>
* Version: Initial version (most code extracted from xgps).

View file

@ -658,6 +658,47 @@ static void setWindowHintsForStyle (Display *dpy, Window window,
return NO;
}
static void
select_input(Display *display, Window w, BOOL ignoreMouse)
{
long event_mask;
if (!ignoreMouse)
{
event_mask = ExposureMask
| KeyPressMask
| KeyReleaseMask
| ButtonPressMask
| ButtonReleaseMask
| ButtonMotionMask
| StructureNotifyMask
| PointerMotionMask
| EnterWindowMask
| LeaveWindowMask
| FocusChangeMask
/* enable property notifications to detect window (de)miniaturization */
| PropertyChangeMask
// | ColormapChangeMask
| KeymapStateMask
| VisibilityChangeMask;
}
else
{
event_mask = ExposureMask
| KeyPressMask
| KeyReleaseMask
| StructureNotifyMask
| FocusChangeMask
/* enable property notifications to detect window (de)miniaturization */
| PropertyChangeMask
// | ColormapChangeMask
| KeymapStateMask
| VisibilityChangeMask;
}
XSelectInput(display, w, event_mask);
}
Bool
_get_next_prop_new_event(Display *display, XEvent *event, char *arg)
{
@ -819,24 +860,8 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
valuemask = (GCForeground | GCBackground | GCFunction);
window->gc = XCreateGC(dpy, window->ident, valuemask, &values);
/* Set the X event mask
*/
XSelectInput(dpy, window->ident, ExposureMask
| KeyPressMask
| KeyReleaseMask
| ButtonPressMask
| ButtonReleaseMask
| ButtonMotionMask
| StructureNotifyMask
| PointerMotionMask
| EnterWindowMask
| LeaveWindowMask
| FocusChangeMask
| PropertyChangeMask
// | ColormapChangeMask
| KeymapStateMask
| VisibilityChangeMask
);
/* Set the X event mask */
select_input(dpy, window->ident, YES);
/*
* Initial attributes for any GNUstep window tell Window Maker not to
@ -2044,25 +2069,8 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
valuemask = (GCForeground | GCBackground | GCFunction);
window->gc = XCreateGC(dpy, window->ident, valuemask, &values);
/* Set the X event mask
*/
XSelectInput(dpy, window->ident, ExposureMask
| KeyPressMask
| KeyReleaseMask
| ButtonPressMask
| ButtonReleaseMask
| ButtonMotionMask
| StructureNotifyMask
| PointerMotionMask
| EnterWindowMask
| LeaveWindowMask
| FocusChangeMask
/* enable property notifications to detect window (de)miniaturization */
| PropertyChangeMask
// | ColormapChangeMask
| KeymapStateMask
| VisibilityChangeMask
);
/* Set the X event mask */
select_input(dpy, window->ident, NO);
/*
* Initial attributes for any GNUstep window tell Window Maker not to
@ -5007,4 +5015,15 @@ _computeDepth(int class, int bpp)
XSetTransientForHint(dpy, cwindow->ident, p);
}
- (void) setIgnoreMouse: (BOOL)ignoreMouse : (int)win
{
gswindow_device_t *window;
window = WINDOW_WITH_TAG(win);
if (!window)
return;
select_input(dpy, window->ident, ignoreMouse);
}
@end