Wayland: Dont set window icons on layer shell windows as some compositors complain about them
This commit is contained in:
parent
66ffb6895c
commit
ddfd8d7f45
2 changed files with 10 additions and 1 deletions
8
glfw/wl_window.c
vendored
8
glfw/wl_window.c
vendored
|
|
@ -1588,6 +1588,14 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
|
|||
|
||||
void
|
||||
_glfwPlatformSetWindowIcon(_GLFWwindow* window, int count, const GLFWimage* images) {
|
||||
if (is_layer_shell(window)) {
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Cannot set window icon on layer shell surfaces");
|
||||
return;
|
||||
}
|
||||
if (!window->wl.xdg.toplevel) {
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Ignoring attempt to set window icon on window without a toplevel");
|
||||
return;
|
||||
}
|
||||
if (!_glfw.wl.xdg_toplevel_icon_manager_v1) {
|
||||
static bool warned_once = false;
|
||||
if (!warned_once) {
|
||||
|
|
|
|||
|
|
@ -1089,6 +1089,7 @@ set_os_window_icon(PyObject UNUSED *self, PyObject *args) {
|
|||
if(!PyArg_ParseTuple(args, "K|O", &id, &what)) return NULL;
|
||||
OSWindow *os_window = os_window_for_id(id);
|
||||
if (!os_window) { PyErr_Format(PyExc_KeyError, "No OS Window with id: %llu", id); return NULL; }
|
||||
if (w->is_layer_shell && global_state.is_wayland) Py_RETURN_NONE;
|
||||
if (!what || what == Py_None) {
|
||||
glfwSetWindowIcon(os_window->handle, 0, NULL);
|
||||
Py_RETURN_NONE;
|
||||
|
|
@ -1729,7 +1730,7 @@ create_os_window(PyObject UNUSED *self, PyObject *args, PyObject *kw) {
|
|||
glfwCocoaSetWindowResizeCallback(glfw_window, cocoa_os_window_resized);
|
||||
#endif
|
||||
send_prerendered_sprites_for_window(w);
|
||||
if (logo.pixels && logo.width && logo.height) glfwSetWindowIcon(glfw_window, 1, &logo);
|
||||
if (logo.pixels && logo.width && logo.height && (!lsc || !global_state.is_wayland)) glfwSetWindowIcon(glfw_window, 1, &logo);
|
||||
set_glfw_mouse_pointer_shape_in_window(glfw_window, OPT(default_pointer_shape));
|
||||
update_os_window_viewport(w, false);
|
||||
glfwSetWindowPosCallback(glfw_window, window_pos_callback);
|
||||
|
|
|
|||
Loading…
Reference in a new issue