-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix X11 window invisible after WindowState has changed to Maximized or FullScreen #16922
base: master
Are you sure you want to change the base?
Fix X11 window invisible after WindowState has changed to Maximized or FullScreen #16922
Conversation
You can test this PR using the following package version. |
In the EWMH _NET_WM_STATE, it is stated that:
Thus, we shouldn't toggle this state manually. |
UPDATE 1ReasonLet's see the official document:
This means:
Let's see the int
MapWindow(WindowPtr pWin, ClientPtr client)
{
ScreenPtr pScreen;
WindowPtr pParent;
WindowPtr pLayerWin;
if (pWin->mapped)
return Success;
// ...
} If a X11 window is mapping, the window manager will check if the window is mapped or not. If the window is mapped, the window manager will return ; /etc/xdg/kwinrc
[Compositing]
HiddenPreviews=6 If the SolutionThanks to my friend @kkwpsv. After several days of research, we know the reason why the state changing failed and how to fix it. The best way to restore a window is to map a window without calling the In conclusion, we get the final code to fix this issue. new XEvent
{
MapRequestEvent = new XMapRequestEvent
{
type = XEventName.MapRequest,
serial = 0,
display = _x11.Display,
send_event = 1,
parent = _x11.RootWindow,
window = _handle,
},
}; Please review the full code in this PR, thanks. P.S.Why we remove the
|
You can test this PR using the following package version. |
…contents that not been layouted or rendered will be shown.
UPDATE 2After some testing, I found that there are some issues in the previous change: if Now, I decide which method to use to display the window based on whether the window has once called |
You can test this PR using the following package version. |
See comments below to see the PR udpates:
What does the pull request do?
If we have such code in the
MainWindow
:Run it on a linux system, click the button, the window will be minimized. After 1 second, the window will still be invisible, but the property
WindowState
has been changed toFullScreen
.Why does this happen? Because the
XIconifyWindow
function minimizes the window but there is no oppsite function to restore it. What we should do is to send a_NET_ACTIVE_WINDOW
message to activate the window. Remove the_NET_WM_STATE_HIDDEN
atom does nothing actually.Please see my changes and you can find that if the previous state is
WindowState.Normal
, the behavior is correct because the message is sent there. This PR adds the same message sending to theWindowState.Maximized
andWindowState.FullScreen
cases.What is the current behavior?
The current behavior is that if a window is maximized or fullscreen, it will be invisible after it has been minimized and then restored.
What is the updated/expected behavior with this PR?
The window should be visible after it has been restored.
How was the solution implemented (if it's not obvious)?
Checklist
Breaking changes
Obsoletions / Deprecations
Fixed issues