mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-22 15:31:14 +00:00
* Source/x11/XGServerWindow.m (-setIgnoreMouse::): Completely
rewrite this method to use Xfixes. * Source/win32/WIN32Server.m (-setIgnoreMouse::): Implement a Windows version of this method. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36861 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d6149a4ca1
commit
b5dff3e089
3 changed files with 55 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
|||
2013-07-08 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/x11/XGServerWindow.m (-setIgnoreMouse::): Completely
|
||||
rewrite this method to use Xfixes.
|
||||
* Source/win32/WIN32Server.m (-setIgnoreMouse::): Implement a
|
||||
Windows version of this method.
|
||||
|
||||
2013-07-08 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/x11/XGServerWindow.m (-setIgnoreMouse::): New method that
|
||||
|
|
|
@ -2358,6 +2358,20 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
|
|||
//SetParent((HWND)childWin, (HWND)parentWin);
|
||||
}
|
||||
|
||||
- (void) setIgnoreMouse: (BOOL)ignoreMouse : (int)win
|
||||
{
|
||||
int extendedStyle = GetWindowLong((HWND)win, GWL_EXSTYLE);
|
||||
|
||||
if (ignoreMouse)
|
||||
{
|
||||
SetWindowLong((HWND)win, GWL_EXSTYLE, extendedStyle | WS_EX_TRANSPARENT);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetWindowLong((HWND)win, GWL_EXSTYLE, extendedStyle & ~WS_EX_TRANSPARENT);
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
static unichar
|
||||
|
|
|
@ -63,6 +63,9 @@
|
|||
#ifdef HAVE_XSHAPE
|
||||
#include <X11/extensions/shape.h>
|
||||
#endif
|
||||
#if HAVE_XFIXES
|
||||
#include <X11/extensions/Xfixes.h>
|
||||
#endif
|
||||
|
||||
#include "x11/XGDragView.h"
|
||||
#include "x11/XGInputServer.h"
|
||||
|
@ -5017,13 +5020,42 @@ _computeDepth(int class, int bpp)
|
|||
|
||||
- (void) setIgnoreMouse: (BOOL)ignoreMouse : (int)win
|
||||
{
|
||||
#if HAVE_XFIXES
|
||||
gswindow_device_t *window;
|
||||
XserverRegion region;
|
||||
int error;
|
||||
int xFixesEventBase;
|
||||
|
||||
if (!XFixesQueryExtension(dpy, &xFixesEventBase, &error))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
window = WINDOW_WITH_TAG(win);
|
||||
if (!window)
|
||||
return;
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
select_input(dpy, window->ident, ignoreMouse);
|
||||
if (ignoreMouse)
|
||||
{
|
||||
region = XFixesCreateRegion(dpy, NULL, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
region = None;
|
||||
}
|
||||
|
||||
|
||||
XFixesSetWindowShapeRegion(dpy,
|
||||
window->ident,
|
||||
ShapeInput,
|
||||
0, 0, region);
|
||||
if (region != None)
|
||||
{
|
||||
XFixesDestroyRegion(dpy, region);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue