From 7dbe46312a6a1d8415832b6077fcd941afcb005f Mon Sep 17 00:00:00 2001 From: Sergii Stoian Date: Wed, 11 Mar 2020 10:49:44 +0200 Subject: [PATCH 1/2] * Source/x11/XGServerWindow.m (_createAppIconPixmaps): accept WRaster context depth 24. (styleoffsets::::::): do not guess offsets for miniwindow and appicon they are equal to 0.0. --- ChangeLog | 7 +++++++ Source/x11/XGServerWindow.m | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8a06bd0..1567c16d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2020-03-11 Sergii Stoian + + * Source/x11/XGServerWindow.m (_createAppIconPixmaps): accept + WRaster context depth 24. + (styleoffsets::::::): do not guess offsets for miniwindow and + appicon they are equal to 0.0. + 2020-03-05 Sergii Stoian * Source/x11/XGServerWindow.m (placewindow::): check window frame diff --git a/Source/x11/XGServerWindow.m b/Source/x11/XGServerWindow.m index e1f6f932..9fbccb93 100644 --- a/Source/x11/XGServerWindow.m +++ b/Source/x11/XGServerWindow.m @@ -2283,7 +2283,8 @@ - (void) styleoffsets: (float *) l : (float *) r : (float *) t : (float *) b if ((style & NSIconWindowMask) || (style & NSMiniWindowMask)) { - style = NSBorderlessWindowMask; + *l = *r = *t = *b = 0.0; + return; } /* Next try to get the offset information that we have obtained from @@ -2841,7 +2842,7 @@ - (int) _createAppIconPixmaps height = [rep pixelsHigh]; colors = [rep samplesPerPixel]; - if (rcontext->depth != 32) + if (rcontext->depth != 32 && rcontext->depth != 24) { NSLog(@"Unsupported context depth %d", rcontext->depth); return 0; From 5544b37b24571afad674f7a382273098372449e2 Mon Sep 17 00:00:00 2001 From: Sergii Stoian Date: Wed, 16 Sep 2020 18:05:51 +0300 Subject: [PATCH 2/2] * Libraries/gnustep/tests/back-art/Source/x11/XGServerEvent.m (_handleTakeFocus:forContext:): if application (window) receives WM_TAKE_FOCUS in hidden state it means WindowMaker wants us to be unhidden. Description: There are 2 protocols defined in XGServerWindow.h: WMFHideApplication and WMFHideOtherApplications. These protocols exist to help GNUstep application and WindowMaker notify each other about "Hide" and "Hide Others" actions. There are no protocols for "unhide" action. Test case steps: 1. Open application with window opened. 2. Hide application with "Hide" menu item. 3. Open WindowMaker's "Windows" menu (middle-click on desktop). 4. Select hidden application window. Application unhides, activates, restored window is focused (receives) input and "Hide" menu item unselected. --- Source/x11/XGServerEvent.m | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Source/x11/XGServerEvent.m b/Source/x11/XGServerEvent.m index 1e56e493..baea0ce3 100644 --- a/Source/x11/XGServerEvent.m +++ b/Source/x11/XGServerEvent.m @@ -1977,10 +1977,21 @@ - (NSEvent *)_handleTakeFocusAtom: (XEvent)xEvent events */ if ([NSApp isHidden]) { - /* This often occurs when hidding an app, since a bunch of - windows get hidden at once, and the WM is searching for a - window to take focus after each one gets hidden. */ - NSDebugLLog(@"Focus", @"WM take focus while hiding"); + if (generic.wm & XGWM_WINDOWMAKER) + { + /* If window receives WM_TAKE_FOCUS and application is in hidden + state - it's time to unhide. There's no other method to + tell us to unhide. */ + NSDebugLLog(@"Focus", @"WM take focus while hidden - unhiding."); + [NSApp unhide:nil]; + } + else + { + /* This often occurs when hidding an app, since a bunch of + windows get hidden at once, and the WM is searching for a + window to take focus after each one gets hidden. */ + NSDebugLLog(@"Focus", @"WM take focus while hiding"); + } } else if (cWin->ignore_take_focus == YES) {