Author: fredkiefer Date: Tue Jan 17 23:01:52 2017 New Revision: 40295 URL: http://svn.gna.org/viewcvs/gnustep?rev=40295&view=rev Log: * Headers/x11/XGGeneric.h: Remove obsolte atom. * Source/x11/XGServerWindow.m: Clean up code. * Source/x11/XGServerWindow.m (-setwindowlevel::): Try to set better level for tool tip windows.
Modified: libs/back/trunk/ChangeLog libs/back/trunk/Headers/x11/XGGeneric.h libs/back/trunk/Source/x11/XGServerWindow.m Modified: libs/back/trunk/ChangeLog URL: http://svn.gna.org/viewcvs/gnustep/libs/back/trunk/ChangeLog?rev=40295&r1=40294&r2=40295&view=diff ============================================================================== --- libs/back/trunk/ChangeLog (original) +++ libs/back/trunk/ChangeLog Tue Jan 17 23:01:52 2017 @@ -1,3 +1,10 @@ +2017-01-17 Fred Kiefer <fredkie...@gmx.de> + + * Headers/x11/XGGeneric.h: Remove obsolte atom. + * Source/x11/XGServerWindow.m: Clean up code. + * Source/x11/XGServerWindow.m (-setwindowlevel::): Try to set + better level for tool tip windows. + 2017-01-08 Fred Kiefer <fredkie...@gmx.de> * Source/x11/XGServerWindow.m (-_checkStyle:): Ignore invalid @@ -214,7 +221,7 @@ * Headers/x11/XGGeneric.h * Source/x11/XGServerWindow.m: Correct name for atom - net_wm_state_modal_atom. Use this atom to try to set the sate for + net_wm_state_modal_atom. Use this atom to try to set the state for dialog windows to modal. 2015-02-27 Germán Arias <germanan...@gmx.es> Modified: libs/back/trunk/Headers/x11/XGGeneric.h URL: http://svn.gna.org/viewcvs/gnustep/libs/back/trunk/Headers/x11/XGGeneric.h?rev=40295&r1=40294&r2=40295&view=diff ============================================================================== --- libs/back/trunk/Headers/x11/XGGeneric.h (original) +++ libs/back/trunk/Headers/x11/XGGeneric.h Tue Jan 17 23:01:52 2017 @@ -49,7 +49,7 @@ Atom win_utility_atom; Atom win_splash_atom; Atom win_override_atom; - Atom win_topmenu_atom; + Atom _dummy1; Atom win_popup_menu_atom; Atom win_dropdown_menu_atom; Atom win_tooltip_atom; Modified: libs/back/trunk/Source/x11/XGServerWindow.m URL: http://svn.gna.org/viewcvs/gnustep/libs/back/trunk/Source/x11/XGServerWindow.m?rev=40295&r1=40294&r2=40295&view=diff ============================================================================== --- libs/back/trunk/Source/x11/XGServerWindow.m (original) +++ libs/back/trunk/Source/x11/XGServerWindow.m Tue Jan 17 23:01:52 2017 @@ -420,17 +420,6 @@ */ -@interface NSEvent (WindowHack) -- (void) _patchLocation: (NSPoint)loc; -@end - -@implementation NSEvent (WindowHack) -- (void) _patchLocation: (NSPoint)loc -{ - location_point = loc; -} -@end - @interface XGServer (WindowOps) - (gswindow_device_t *) _rootWindowForScreen: (int)screen; - (void) styleoffsets: (float *) l : (float *) r : (float *) t : (float *) b @@ -665,39 +654,25 @@ static void select_input(Display *display, Window w, BOOL ignoreMouse) { - long event_mask; + long event_mask = ExposureMask + | KeyPressMask + | KeyReleaseMask + | StructureNotifyMask + | FocusChangeMask + /* enable property notifications to detect window (de)miniaturization */ + | PropertyChangeMask + // | ColormapChangeMask + | KeymapStateMask + | VisibilityChangeMask; if (!ignoreMouse) { - event_mask = ExposureMask - | KeyPressMask - | KeyReleaseMask - | ButtonPressMask + event_mask |= 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; + | LeaveWindowMask; } XSelectInput(display, w, event_mask); @@ -780,6 +755,43 @@ return NO; } +- (unsigned long*) _getExtents: (Window)win +{ + int count; + unsigned long *extents; + + /* If our window manager supports _NET_FRAME_EXTENTS we trust that as + * definitive information. + */ + if (_net_frame_extents == None) + { + _net_frame_extents = XInternAtom(dpy, "_NET_FRAME_EXTENTS", False); + } + extents = (unsigned long *)PropGetCheckProperty(dpy, win, _net_frame_extents, + XA_CARDINAL, 32, 4, &count); + if (extents != 0) + { + NSDebugLLog(@"Offset", @"Offsets retrieved from _NET_FRAME_EXTENTS"); + } + if (extents == 0) + { + /* If our window manager supports _KDE_NET_WM_FRAME_STRUT we assume + * its as reliable as _NET_FRAME_EXTENTS + */ + if (_kde_frame_strut == None) + { + _kde_frame_strut = XInternAtom(dpy, "_KDE_NET_WM_FRAME_STRUT", False); + } + extents = (unsigned long *)PropGetCheckProperty(dpy, win, _kde_frame_strut, + XA_CARDINAL, 32, 4, &count); + if (extents!= 0) + { + NSDebugLLog(@"Offset", @"Offsets retrieved from _KDE_NET_WM_FRAME_STRUT"); + } + } + return extents; +} + - (BOOL) _checkStyle: (unsigned)style { gswindow_device_t *window; @@ -790,7 +802,6 @@ XClassHint classhint; RContext *context; XEvent xEvent; - int count; unsigned long *extents; Offsets *o = generic.offsets + (style & 15); int repp = 0; @@ -1010,38 +1021,7 @@ } } - /* If our window manager supports _NET_FRAME_EXTENTS we trust that as - * definitive information. - */ - if (_net_frame_extents == None) - { - _net_frame_extents = XInternAtom(dpy, "_NET_FRAME_EXTENTS", False); - } - extents = (unsigned long *)PropGetCheckProperty(dpy, - window->ident, _net_frame_extents, XA_CARDINAL, 32, 4, &count); - if (extents != 0) - { - NSDebugLLog(@"Offset", @"Offsets retrieved from _NET_FRAME_EXTENTS"); - } - if (extents == 0) - { - /* If our window manager supports _KDE_NET_WM_FRAME_STRUT we assume - * its as reliable as _NET_FRAME_EXTENTS - */ - if (_kde_frame_strut == None) - { - _kde_frame_strut = XInternAtom(dpy, - "_KDE_NET_WM_FRAME_STRUT", False); - } - extents = (unsigned long *)PropGetCheckProperty(dpy, - window->ident, _kde_frame_strut, XA_CARDINAL, 32, 4, &count); - if (extents!= 0) - { - NSDebugLLog(@"Offset", - @"Offsets retrieved from _KDE_NET_WM_FRAME_STRUT"); - } - } - + extents = [self _getExtents: window->ident]; if (extents != 0) { o->l = extents[0]; @@ -1309,8 +1289,6 @@ generic.wintypes.win_override_atom = XInternAtom(dpy, "_KDE_NET_WM_WINDOW_TYPE_OVERRIDE", False); #endif - generic.wintypes.win_topmenu_atom = - XInternAtom(dpy, "_KDE_NET_WM_WINDOW_TYPE_TOPMENU", False); // Window state generic.netstates.net_wm_state_atom = @@ -2404,28 +2382,7 @@ /* First check _NET_FRAME_EXTENTS */ if (win && ((generic.wm & XGWM_EWMH) != 0)) { - int count; - unsigned long *extents; - - if (_net_frame_extents == None) - { - _net_frame_extents = XInternAtom(dpy, - "_NET_FRAME_EXTENTS", False); - } - - extents = (unsigned long *)PropGetCheckProperty(dpy, - win, _net_frame_extents, XA_CARDINAL, 32, 4, &count); - - if (!extents) // && (generic.wm & XGWM_KDE)) - { - if (_kde_frame_strut == None) - { - _kde_frame_strut = XInternAtom(dpy, - "_KDE_NET_WM_FRAME_STRUT", False); - } - extents = (unsigned long *)PropGetCheckProperty(dpy, - win, _kde_frame_strut, XA_CARDINAL, 32, 4, &count); - } + unsigned long *extents = [self _getExtents: win]; if (extents) { @@ -2464,8 +2421,7 @@ return; } -NSLog(@"styleoffsets ... guessing offsets\n"); - + NSLog(@"styleoffsets ... guessing offsets\n"); if ((generic.wm & XGWM_WINDOWMAKER) != 0) { *l = *r = *t = *b = 1.0; @@ -2974,15 +2930,6 @@ */ if ((window->win_attrs.window_style & NSIconWindowMask) != 0) { -#if 0 - /* This doesn't appear to do anything useful, and, at least - with WindowMaker, can cause the app to flicker and spuriously - lose focus if the app icon is already visible. */ - if (op != NSWindowOut) - { - XMapRaised(dpy, ROOT); - } -#endif return; } if ((window->win_attrs.window_style & NSMiniWindowMask) != 0) @@ -3427,26 +3374,14 @@ } else if (level == NSMainMenuWindowLevel) { - // For strange reasons menu level does not - // work out for the main menu - //data[0] = generic.wintypes.win_topmenu_atom; data[0] = generic.wintypes.win_dock_atom; - //len = 2; skipTaskbar = YES; } else if (level == NSSubmenuWindowLevel || level == NSFloatingWindowLevel || level == NSTornOffMenuWindowLevel) { -#ifdef USE_KDE_OVERRIDE - data[0] = generic.wintypes.win_override_atom; - //data[0] = generic.wintypes.win_utility_atom; - data[1] = generic.wintypes.win_menu_atom; - len = 2; -#else data[0] = generic.wintypes.win_menu_atom; - len = 1; -#endif skipTaskbar = YES; } else if (level == NSDockWindowLevel @@ -3458,15 +3393,17 @@ // Does this belong into a different category? else if (level == NSPopUpMenuWindowLevel) { -#ifdef USE_KDE_OVERRIDE - data[0] = generic.wintypes.win_override_atom; - data[1] = generic.wintypes.win_floating_atom; - len = 2; -#else + NSWindow *nswin = GSWindowWithNumber(window->number); + + if ([[nswin className] isEqual: @"GSTTPanel"]) + { + data[0] = generic.wintypes.win_tooltip_atom; + } + else + { // data[0] = generic.wintypes.win_popup_menu_atom; - data[0] = generic.wintypes.win_modal_atom; - len = 1; -#endif + data[0] = generic.wintypes.win_modal_atom; + } skipTaskbar = YES; } else if (level == NSDesktopWindowLevel) _______________________________________________ Gnustep-cvs mailing list Gnustep-cvs@gna.org https://mail.gna.org/listinfo/gnustep-cvs