all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#63511: [Patch] Fix for hidden window bug
@ 2023-05-14 19:13 Christian Schmidt
  2023-08-23 23:24 ` Stefan Kangas
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Schmidt @ 2023-05-14 19:13 UTC (permalink / raw)
  To: 63511

[-- Attachment #1: Type: text/plain, Size: 1058 bytes --]

Severity: normal
Tags: Patch

At least on enlightenment, when switching virtual desktop away from the 
on containing emacs and back, emacs does not render screen updates.
This patch fixes the cause.
Analysis for the bug tracker, copied from commit message:

If no state flags are set in the _NET_WM_STATE property,
the returned X property type will be "0". This situation
occurs when "_NET_WM_STATE_HIDDEN" was the only property
set for the emacs window, e.g. in enlightenment due to
change of a virtual desktop.
In the current code this causes copying of the iconified
state in x_get_current_wm_state(), which causes emacs to
stay hidden. For DMs such as Enlightenent or Gnome Shell
that use only the hidden but not the iconified state
this clashes with the intention of handling the
_NET_WM_STATE property notification in
handle_one_xevent(), which requires not_hidden &&
FRAME_ICONIFIED_P (f) to actually activate the frame.

-- 
AIBIoT GmbH        | CEO: Lukas Grunwald
Hornemannstraße 12 | HRB 206588
31137 Hildesheim   | Amtsgericht Hildesheim
Germany

[-- Attachment #2: fix_hidden_window_bug.patch --]
[-- Type: text/x-patch, Size: 1750 bytes --]

commit bed172871fa0a3c1927c25c7664cd9711c303afb
Author: Christian Schmidt <schmidt@digadd.de>
Date:   Sat May 6 13:42:29 2023 +0200

    Fix processing of _NET_WM_STATE for _NET_WM_STATE_HIDDEN
    
    If no state flags are set in the _NET_WM_STATE property,
    the returned X property type will be "0". This situation
    occurs when "_NET_WM_STATE_HIDDEN" was the only property
    set for the emacs window, e.g. in enlightenment due to
    change of a virtual desktop.
    In the current code this causes copying of the iconified
    state in x_get_current_wm_state(), which causes emacs to
    stay hidden. For DMs such as Enlightenent or Gnome Shell
    that use only the hidden but not the iconified state
    this clashes with the intention of handling the
    _NET_WM_STATE property notification in
    handle_one_xevent(), which requires not_hidden &&
    FRAME_ICONIFIED_P (f) to actually activate the frame.
    
    This patch changes the handling of receiving an empty
    property by interpreting it as not hidden.

diff --git a/src/xterm.c b/src/xterm.c
index d621d94a2cf..2bf233b857d 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -27328,7 +27328,7 @@ x_get_current_wm_state (struct frame *f,
                         bool *sticky,
 			bool *shaded)
 {
-  unsigned long actual_size;
+  unsigned long actual_size = 0;
   int i;
   bool is_hidden = false;
   struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
@@ -27371,9 +27371,8 @@ x_get_current_wm_state (struct frame *f,
       actual_size = actual_bytes / sizeof *reply_data;
       reply_data = xcb_get_property_value (prop);
     }
-  else
+  else if (!prop || prop->type != (Atom) 0)
     {
-      actual_size = 0;
       is_hidden = FRAME_ICONIFIED_P (f);
     }
 #else

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-08-29  1:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-14 19:13 bug#63511: [Patch] Fix for hidden window bug Christian Schmidt
2023-08-23 23:24 ` Stefan Kangas
2023-08-24  0:12   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-28  7:56     ` Christian Schmidt
2023-08-29  1:22       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.