Wayland: Do not request idle inhibition for full screen windows

Fixes #6613
This commit is contained in:
Kovid Goyal 2023-09-12 16:43:46 +05:30
parent 93618842ae
commit f63bbfc88c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
5 changed files with 2 additions and 39 deletions

View File

@ -80,6 +80,8 @@ Detailed list of changes
- diff kitten: Add support for files that are identical apart from mode changes (:iss:`6611`)
- Wayland: Do not request idle inhibition for full screen windows (:iss:`6613`)
0.29.2 [2023-07-27]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -74,7 +74,6 @@
"stable/viewporter/viewporter.xml",
"unstable/relative-pointer/relative-pointer-unstable-v1.xml",
"unstable/pointer-constraints/pointer-constraints-unstable-v1.xml",
"unstable/idle-inhibit/idle-inhibit-unstable-v1.xml",
"unstable/xdg-decoration/xdg-decoration-unstable-v1.xml",
"unstable/primary-selection/primary-selection-unstable-v1.xml",
"unstable/text-input/text-input-unstable-v3.xml",

9
glfw/wl_init.c vendored
View File

@ -692,13 +692,6 @@ static void registryHandleGlobal(void* data UNUSED,
_glfwWaylandBindTextInput(registry, name);
_glfwWaylandInitTextInput();
}
else if (strcmp(interface, "zwp_idle_inhibit_manager_v1") == 0)
{
_glfw.wl.idleInhibitManager =
wl_registry_bind(registry, name,
&zwp_idle_inhibit_manager_v1_interface,
1);
}
else if (strcmp(interface, "wl_data_device_manager") == 0)
{
_glfw.wl.dataDeviceManager =
@ -937,8 +930,6 @@ void _glfwPlatformTerminate(void)
if (_glfw.wl.pointerConstraints)
zwp_pointer_constraints_v1_destroy(_glfw.wl.pointerConstraints);
_glfwWaylandDestroyTextInput();
if (_glfw.wl.idleInhibitManager)
zwp_idle_inhibit_manager_v1_destroy(_glfw.wl.idleInhibitManager);
if (_glfw.wl.dataSourceForClipboard)
wl_data_source_destroy(_glfw.wl.dataSourceForClipboard);
if (_glfw.wl.dataSourceForPrimarySelection)

4
glfw/wl_platform.h vendored
View File

@ -56,7 +56,6 @@ typedef VkBool32 (APIENTRY *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR
#include "wayland-xdg-decoration-unstable-v1-client-protocol.h"
#include "wayland-relative-pointer-unstable-v1-client-protocol.h"
#include "wayland-pointer-constraints-unstable-v1-client-protocol.h"
#include "wayland-idle-inhibit-unstable-v1-client-protocol.h"
#include "wayland-primary-selection-unstable-v1-client-protocol.h"
#include "wayland-primary-selection-unstable-v1-client-protocol.h"
#include "wl_text_input.h"
@ -182,8 +181,6 @@ typedef struct _GLFWwindowWayland
struct zwp_locked_pointer_v1* lockedPointer;
} pointerLock;
struct zwp_idle_inhibitor_v1* idleInhibitor;
struct {
bool serverSide, buffer_destroyed;
_GLFWdecorationSideWayland focus;
@ -284,7 +281,6 @@ typedef struct _GLFWlibraryWayland
struct zxdg_decoration_manager_v1* decorationManager;
struct zwp_relative_pointer_manager_v1* relativePointerManager;
struct zwp_pointer_constraints_v1* pointerConstraints;
struct zwp_idle_inhibit_manager_v1* idleInhibitManager;
struct wl_data_source* dataSourceForClipboard;
struct zwp_primary_selection_device_manager_v1* primarySelectionDeviceManager;
struct zwp_primary_selection_device_v1* primarySelectionDevice;

25
glfw/wl_window.c vendored
View File

@ -410,24 +410,6 @@ static const struct wl_surface_listener surfaceListener = {
surfaceHandleLeave
};
static void setIdleInhibitor(_GLFWwindow* window, bool enable)
{
if (enable && !window->wl.idleInhibitor && _glfw.wl.idleInhibitManager)
{
window->wl.idleInhibitor =
zwp_idle_inhibit_manager_v1_create_inhibitor(
_glfw.wl.idleInhibitManager, window->wl.surface);
if (!window->wl.idleInhibitor)
_glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Idle inhibitor creation failed");
}
else if (!enable && window->wl.idleInhibitor)
{
zwp_idle_inhibitor_v1_destroy(window->wl.idleInhibitor);
window->wl.idleInhibitor = NULL;
}
}
static bool createSurface(_GLFWwindow* window,
const _GLFWwndconfig* wndconfig)
{
@ -488,7 +470,6 @@ static void setFullscreen(_GLFWwindow* window, _GLFWmonitor* monitor, bool on)
ensure_csd_resources(window);
}
}
setIdleInhibitor(window, on);
}
@ -712,18 +693,15 @@ createXdgSurface(_GLFWwindow* window)
{
xdg_toplevel_set_fullscreen(window->wl.xdg.toplevel,
window->monitor->wl.output);
setIdleInhibitor(window, true);
}
else if (window->wl.maximize_on_first_show)
{
window->wl.maximize_on_first_show = false;
xdg_toplevel_set_maximized(window->wl.xdg.toplevel);
setIdleInhibitor(window, false);
setXdgDecorations(window);
}
else
{
setIdleInhibitor(window, false);
setXdgDecorations(window);
}
if (strlen(window->wl.appId))
@ -952,9 +930,6 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window)
_glfw.wl.keyRepeatInfo.keyboardFocusId = 0;
}
if (window->wl.idleInhibitor)
zwp_idle_inhibitor_v1_destroy(window->wl.idleInhibitor);
if (window->context.destroy)
window->context.destroy(window);