Added support for WindowMaker's WMFHideApplication action.

This commit is contained in:
Sergii Stoian 2019-04-05 14:46:05 +03:00
parent f9958176db
commit b492ac87cd
5 changed files with 67 additions and 10 deletions

View file

@ -621,6 +621,21 @@ posixFileDescriptor: (NSPosixFileDescriptor*)fileDescriptor
data1: 0
data2: 0];
}
else if ((Atom)xEvent.xclient.data.l[0]
== generic._GNUSTEP_WM_HIDE_APP_ATOM)
{
NSDebugLLog(@"Hide", @"%lu application will be hidden", cWin->number);
eventLocation = NSMakePoint(0,0);
e = [NSEvent otherEventWithType: NSAppKitDefined
location: eventLocation
modifierFlags: 0
timestamp: 0
windowNumber: cWin->number
context: gcontext
subtype: GSAppKitAppHide
data1: 0
data2: 0];
}
else if ((Atom)xEvent.xclient.data.l[0]
== generic.WM_TAKE_FOCUS_ATOM)
{

View file

@ -1396,10 +1396,13 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
window->protocols[window->numProtocols++] = generic._NET_WM_SYNC_REQUEST_ATOM;
#endif
}
if ((generic.wm & XGWM_WINDOWMAKER) != 0
&& (window->win_attrs.window_style & NSMiniaturizableWindowMask) != 0)
if ((generic.wm & XGWM_WINDOWMAKER) != 0)
{
window->protocols[window->numProtocols++] = generic._GNUSTEP_WM_MINIATURIZE_WINDOW_ATOM;
if ((window->win_attrs.window_style & NSMiniaturizableWindowMask) != 0)
{
window->protocols[window->numProtocols++] = generic._GNUSTEP_WM_MINIATURIZE_WINDOW_ATOM;
}
window->protocols[window->numProtocols++] = generic._GNUSTEP_WM_HIDE_APP_ATOM;
}
NSAssert1(window->numProtocols <= GSMaxWMProtocols,
@"Too many protocols (%d > GSMaxWMProtocols)",
@ -2602,6 +2605,28 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
XIconifyWindow(dpy, window->ident, window->screen);
}
/* Actually this is "hide application" action.
However, key press may be received by particular window. */
- (BOOL) hidewindow: (int)win
{
gswindow_device_t *window;
if ((generic.wm & XGWM_WINDOWMAKER) == 0)
return NO;
window = [XGServer _windowWithTag: win];
[self _sendRoot: window->root
type: generic._WINDOWMAKER_WM_FUNCTION_ATOM
window: window->ident
data0: WMFHideApplication
data1: CurrentTime
data2: 0
data3: 0];
XSync(dpy, False);
return YES;
}
/**
Make sure we have the most up-to-date window information and then
make sure the context has our new information