Conversation
With a GSScaleFactor other than 1 every view is scaled from window base coordinates, so XGXSubWindow refused to attach an OpenGL context to any view and raised. Apps with an NSOpenGLView then failed while building and drawing their window, which never appeared. Window base coordinates are device pixels, the unit of the X subwindow. Place the subwindow from the view's rectangle in base coordinates, made relative to the content view when the window manager draws the decorations, and refuse only rotated views.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With a GSScaleFactor other than 1, every view counts as scaled from window base coordinates, so
XGXSubWindowrefused to attach an OpenGL context to any view ("Cannot attach an Xwindow to a view that is rotated or scaled"). An app with anNSOpenGLViewthen raised while building and drawing its window (-[NSOpenGLView openGLContext],-[NSOpenGLView _lockFocusInContext:inRect:]), andmakeKeyAndOrderFront:never showed the window.Fix: window base coordinates are already device pixels, the unit of the X subwindow. The subwindow is now placed from the view's rectangle in base coordinates (made relative to the content view when the window manager draws the decorations), in both
-initWithView:visualinfo:and-update. Only rotated views are still refused.Verified at
-GSScaleFactor 1.1on X11 with a window manager: an app with anNSOpenGLViewin its content view now shows its window, and the GL subwindow covers exactly the view, also after resizing the window and after full screen. At scale factor 1 the placement is unchanged.cc @pkgdemon