mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-25 18:37:50 +00:00
Avoid pointlessly querying window pos on Wayland
This commit is contained in:
parent
655494f37b
commit
e0374ee623
1 changed files with 2 additions and 2 deletions
|
|
@ -831,7 +831,7 @@ static bool
|
|||
do_toggle_fullscreen(OSWindow *w, unsigned int flags, bool restore_sizes) {
|
||||
int width, height, x, y;
|
||||
glfwGetWindowSize(w->handle, &width, &height);
|
||||
glfwGetWindowPos(w->handle, &x, &y);
|
||||
if (!global_state.is_wayland) glfwGetWindowPos(w->handle, &x, &y);
|
||||
bool was_maximized = glfwGetWindowAttrib(w->handle, GLFW_MAXIMIZED);
|
||||
if (glfwToggleFullscreen(w->handle, flags)) {
|
||||
w->before_fullscreen.is_set = true;
|
||||
|
|
@ -841,7 +841,7 @@ do_toggle_fullscreen(OSWindow *w, unsigned int flags, bool restore_sizes) {
|
|||
}
|
||||
if (w->before_fullscreen.is_set && restore_sizes) {
|
||||
glfwSetWindowSize(w->handle, w->before_fullscreen.w, w->before_fullscreen.h);
|
||||
glfwSetWindowPos(w->handle, w->before_fullscreen.x, w->before_fullscreen.y);
|
||||
if (!global_state.is_wayland) glfwSetWindowPos(w->handle, w->before_fullscreen.x, w->before_fullscreen.y);
|
||||
if (w->before_fullscreen.was_maximized) glfwMaximizeWindow(w->handle);
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue