mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-03 17:20:42 +00:00
Merge pull request #26 from trunkmaster/master
Added support for WindowMaker's WMFHideApplication action.
This commit is contained in:
commit
67bc99516b
6 changed files with 67 additions and 23 deletions
25
ChangeLog
25
ChangeLog
|
@ -1,3 +1,28 @@
|
||||||
|
2019-04-06 Sergii Stoian <stoyan255@ukr.net>
|
||||||
|
|
||||||
|
* Headers/Additions/GNUstepGUI/GSDisplayServer.h,
|
||||||
|
* Source/NSApplication.m,
|
||||||
|
* Source/GSDisplayServer.m: `hidewindow` method was renamed to
|
||||||
|
`hideApplication`
|
||||||
|
|
||||||
|
* Source/NSApplication.m (hide:): Change comment before call to
|
||||||
|
`hidewindow`.
|
||||||
|
|
||||||
|
* Source/GSDisplayServer.m (hidewindow:): fixes to return value and type.
|
||||||
|
Change comment.
|
||||||
|
|
||||||
|
2019-04-05 Sergii Stoian <stoyan255@gmail.com>
|
||||||
|
|
||||||
|
* Headers/AppKit/NSEvent.h: new event subtype `GSAppKitAppHide` was added.
|
||||||
|
* Source/NSWindow.m (sendEvent:): handle "GSAppKitAppHide" event subtype.
|
||||||
|
|
||||||
|
* Headers/Additions/GNUstepGUI/GSDisplayServer.h,
|
||||||
|
* Source/GSDisplayServer.m (hidewindow:): new methods was added.
|
||||||
|
|
||||||
|
* Source/NSApplication.m (hide:): Send -hidewindow: to to the main menu.
|
||||||
|
If window manager doesn't support _GNUSTEP_HIDE_APP atom - hide windows
|
||||||
|
by ourself.
|
||||||
|
|
||||||
2019-04-03 Sergii Stoian <stoyan255@ukr.net>
|
2019-04-03 Sergii Stoian <stoyan255@ukr.net>
|
||||||
|
|
||||||
* Source/NSApplication.m (activateIgnoringOtherApps:):
|
* Source/NSApplication.m (activateIgnoringOtherApps:):
|
||||||
|
|
|
@ -136,6 +136,7 @@ APPKIT_EXPORT NSString *GSScreenNumber;
|
||||||
- (void) windowbacking: (NSBackingStoreType)type : (int)win;
|
- (void) windowbacking: (NSBackingStoreType)type : (int)win;
|
||||||
- (void) titlewindow: (NSString *)window_title : (int)win;
|
- (void) titlewindow: (NSString *)window_title : (int)win;
|
||||||
- (void) miniwindow: (int)win;
|
- (void) miniwindow: (int)win;
|
||||||
|
- (BOOL) hideApplication: (int)win;
|
||||||
- (BOOL) appOwnsMiniwindow;
|
- (BOOL) appOwnsMiniwindow;
|
||||||
- (void) setWindowdevice: (int)win forContext: (NSGraphicsContext *)ctxt;
|
- (void) setWindowdevice: (int)win forContext: (NSGraphicsContext *)ctxt;
|
||||||
// Deprecated
|
// Deprecated
|
||||||
|
|
|
@ -532,6 +532,7 @@ typedef enum {
|
||||||
GSAppKitDraggingFinished,
|
GSAppKitDraggingFinished,
|
||||||
GSAppKitRegionExposed,
|
GSAppKitRegionExposed,
|
||||||
GSAppKitWindowDeminiaturize,
|
GSAppKitWindowDeminiaturize,
|
||||||
|
GSAppKitAppHide
|
||||||
} GSAppKitSubtype;
|
} GSAppKitSubtype;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -601,6 +601,13 @@ GSCurrentServer(void)
|
||||||
[self subclassResponsibility: _cmd];
|
[self subclassResponsibility: _cmd];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Ask the window manager to hide all the application windows for us.
|
||||||
|
Return whether they have been hidden. */
|
||||||
|
- (BOOL) hideApplication: (int) win
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
/** Returns YES if the application should create the miniwindow counterpart
|
/** Returns YES if the application should create the miniwindow counterpart
|
||||||
to the full size window and own it. Some display systems handle the
|
to the full size window and own it. Some display systems handle the
|
||||||
miniwindow themselves. In this case the backend subclass should
|
miniwindow themselves. In this case the backend subclass should
|
||||||
|
|
|
@ -2496,30 +2496,36 @@ image.</p><p>See Also: -applicationIconImage</p>
|
||||||
[_hidden_main resignMainWindow];
|
[_hidden_main resignMainWindow];
|
||||||
}
|
}
|
||||||
|
|
||||||
windows_list = GSOrderedWindows();
|
/** Ask the window manager to hide all the application windows for us.
|
||||||
iter = [windows_list reverseObjectEnumerator];
|
Return whether they have been hidden. */
|
||||||
|
win = [[self mainMenu] window];
|
||||||
|
if ([GSServerForWindow(win) hideApplication: [win windowNumber]] == NO)
|
||||||
|
{
|
||||||
|
windows_list = GSOrderedWindows();
|
||||||
|
iter = [windows_list reverseObjectEnumerator];
|
||||||
|
|
||||||
while ((win = [iter nextObject]))
|
while ((win = [iter nextObject]))
|
||||||
{
|
{
|
||||||
if ([win isVisible] == NO && ![win isMiniaturized])
|
if ([win isVisible] == NO && ![win isMiniaturized])
|
||||||
{
|
{
|
||||||
continue; /* Already invisible */
|
continue; /* Already invisible */
|
||||||
}
|
}
|
||||||
if ([win canHide] == NO)
|
if ([win canHide] == NO)
|
||||||
{
|
{
|
||||||
continue; /* Not hideable */
|
continue; /* Not hideable */
|
||||||
}
|
}
|
||||||
if (win == _app_icon_window)
|
if (win == _app_icon_window)
|
||||||
{
|
{
|
||||||
continue; /* can't hide the app icon. */
|
continue; /* can't hide the app icon. */
|
||||||
}
|
}
|
||||||
if (_app_is_active == YES && [win hidesOnDeactivate] == YES)
|
if (_app_is_active == YES && [win hidesOnDeactivate] == YES)
|
||||||
{
|
{
|
||||||
continue; /* Will be hidden by deactivation */
|
continue; /* Will be hidden by deactivation */
|
||||||
}
|
}
|
||||||
[_hidden addObject: win];
|
[_hidden addObject: win];
|
||||||
[win orderOut: self];
|
[win orderOut: self];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
_app_is_hidden = YES;
|
_app_is_hidden = YES;
|
||||||
|
|
||||||
if (YES == [[NSUserDefaults standardUserDefaults]
|
if (YES == [[NSUserDefaults standardUserDefaults]
|
||||||
|
|
|
@ -4224,6 +4224,10 @@ checkCursorRectanglesExited(NSView *theView, NSEvent *theEvent, NSPoint lastPoi
|
||||||
[self performMiniaturize: NSApp];
|
[self performMiniaturize: NSApp];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GSAppKitAppHide:
|
||||||
|
[NSApp hide: self];
|
||||||
|
break;
|
||||||
|
|
||||||
case GSAppKitWindowFocusIn:
|
case GSAppKitWindowFocusIn:
|
||||||
if (_f.is_miniaturized)
|
if (_f.is_miniaturized)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue