|
Karel Klic |
782803 |
diff -U0 emacs-23.3/src/ChangeLog.wm-state-hidden emacs-23.3/src/ChangeLog
|
|
Karel Klic |
782803 |
--- emacs-23.3/src/ChangeLog.wm-state-hidden 2011-03-07 06:08:03.000000000 +0100
|
|
Karel Klic |
782803 |
+++ emacs-23.3/src/ChangeLog 2011-11-23 11:49:57.053019839 +0100
|
|
Karel Klic |
782803 |
@@ -1,0 +2,13 @@
|
|
Karel Klic |
782803 |
+2011-10-30 Jan Djärv <jan.h.d@swipnet.se>
|
|
Karel Klic |
782803 |
+
|
|
Karel Klic |
782803 |
+ * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
|
|
Karel Klic |
782803 |
+
|
|
Karel Klic |
782803 |
+ * xterm.c: Declare x_handle_net_wm_state to return int.
|
|
Karel Klic |
782803 |
+ (handle_one_xevent): Check if we are iconified but don't have
|
|
Karel Klic |
782803 |
+ _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
|
|
Karel Klic |
782803 |
+ (get_current_wm_state): Return non-zero if not hidden,
|
|
Karel Klic |
782803 |
+ check for _NET_WM_STATE_HIDDEN (Bug#9893).
|
|
Karel Klic |
782803 |
+ (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
|
|
Karel Klic |
782803 |
+ (x_handle_net_wm_state): Return what get_current_wm_state returns.
|
|
Karel Klic |
782803 |
+ (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
|
|
Karel Klic |
782803 |
+
|
|
Karel Klic |
782803 |
diff -up emacs-23.3/src/xterm.c.wm-state-hidden emacs-23.3/src/xterm.c
|
|
Karel Klic |
782803 |
--- emacs-23.3/src/xterm.c.wm-state-hidden 2011-02-12 01:27:01.000000000 +0100
|
|
Karel Klic |
782803 |
+++ emacs-23.3/src/xterm.c 2011-11-23 11:55:10.867096378 +0100
|
|
Karel Klic |
782803 |
@@ -375,7 +375,7 @@ static void x_scroll_bar_report_motion P
|
|
Karel Klic |
782803 |
enum scroll_bar_part *,
|
|
Karel Klic |
782803 |
Lisp_Object *, Lisp_Object *,
|
|
Karel Klic |
782803 |
unsigned long *));
|
|
Karel Klic |
782803 |
-static void x_handle_net_wm_state P_ ((struct frame *, XPropertyEvent *));
|
|
Karel Klic |
782803 |
+static int x_handle_net_wm_state P_ ((struct frame *, XPropertyEvent *));
|
|
Karel Klic |
782803 |
static void x_check_fullscreen P_ ((struct frame *));
|
|
Karel Klic |
782803 |
static void x_check_expected_move P_ ((struct frame *, int, int));
|
|
Karel Klic |
782803 |
static void x_sync_with_move P_ ((struct frame *, int, int, int));
|
|
Karel Klic |
782803 |
@@ -6121,7 +6121,19 @@ handle_one_xevent (dpyinfo, eventp, fini
|
|
Karel Klic |
782803 |
last_user_time = event.xproperty.time;
|
|
Karel Klic |
782803 |
f = x_top_window_to_frame (dpyinfo, event.xproperty.window);
|
|
Karel Klic |
782803 |
if (f && event.xproperty.atom == dpyinfo->Xatom_net_wm_state)
|
|
Karel Klic |
782803 |
- x_handle_net_wm_state (f, &event.xproperty);
|
|
Karel Klic |
782803 |
+ if (x_handle_net_wm_state (f, &event.xproperty) && f->iconified)
|
|
Karel Klic |
782803 |
+ {
|
|
Karel Klic |
782803 |
+ /* Gnome shell does not iconify us when C-z is pressed. It hides
|
|
Karel Klic |
782803 |
+ the frame. So if our state says we aren't hidden anymore,
|
|
Karel Klic |
782803 |
+ treat is as deiconfied. */
|
|
Karel Klic |
782803 |
+ if (! f->async_iconified)
|
|
Karel Klic |
782803 |
+ SET_FRAME_GARBAGED (f);
|
|
Karel Klic |
782803 |
+ f->async_visible = 1;
|
|
Karel Klic |
782803 |
+ f->async_iconified = 0;
|
|
Karel Klic |
782803 |
+ f->output_data.x->has_been_visible = 1;
|
|
Karel Klic |
782803 |
+ inev.ie.kind = DEICONIFY_EVENT;
|
|
Karel Klic |
782803 |
+ XSETFRAME (inev.ie.frame_or_window, f);
|
|
Karel Klic |
782803 |
+ }
|
|
Karel Klic |
782803 |
|
|
Karel Klic |
782803 |
x_handle_property_notify (&event.xproperty);
|
|
Karel Klic |
782803 |
xft_settings_event (dpyinfo, &event);
|
|
Karel Klic |
782803 |
@@ -8573,9 +8585,10 @@ x_set_sticky (f, new_value, old_value)
|
|
Karel Klic |
782803 |
|
|
Karel Klic |
782803 |
/* Return the current _NET_WM_STATE.
|
|
Karel Klic |
782803 |
SIZE_STATE is set to one of the FULLSCREEN_* values.
|
|
Karel Klic |
782803 |
- STICKY is set to 1 if the sticky state is set, 0 if not. */
|
|
Karel Klic |
782803 |
+ STICKY is set to 1 if the sticky state is set, 0 if not.
|
|
Karel Klic |
782803 |
+ Return non-zero if we are not hidden, zero if we are. */
|
|
Karel Klic |
782803 |
|
|
Karel Klic |
782803 |
-static void
|
|
Karel Klic |
782803 |
+static int
|
|
Karel Klic |
782803 |
get_current_vm_state (struct frame *f,
|
|
Karel Klic |
782803 |
Window window,
|
|
Karel Klic |
782803 |
int *size_state,
|
|
Karel Klic |
782803 |
@@ -8583,7 +8596,7 @@ get_current_vm_state (struct frame *f,
|
|
Karel Klic |
782803 |
{
|
|
Karel Klic |
782803 |
Atom actual_type;
|
|
Karel Klic |
782803 |
unsigned long actual_size, bytes_remaining;
|
|
Karel Klic |
782803 |
- int i, rc, actual_format;
|
|
Karel Klic |
782803 |
+ int i, rc, actual_format, is_hidden = 0;
|
|
Karel Klic |
782803 |
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
|
|
Karel Klic |
782803 |
long max_len = 65536;
|
|
Karel Klic |
782803 |
Display *dpy = FRAME_X_DISPLAY (f);
|
|
Karel Klic |
782803 |
@@ -8605,7 +8618,7 @@ get_current_vm_state (struct frame *f,
|
|
Karel Klic |
782803 |
if (tmp_data) XFree (tmp_data);
|
|
Karel Klic |
782803 |
x_uncatch_errors ();
|
|
Karel Klic |
782803 |
UNBLOCK_INPUT;
|
|
Karel Klic |
782803 |
- return;
|
|
Karel Klic |
782803 |
+ return ! f->iconified;
|
|
Karel Klic |
782803 |
}
|
|
Karel Klic |
782803 |
|
|
Karel Klic |
782803 |
x_uncatch_errors ();
|
|
Karel Klic |
782803 |
@@ -8613,7 +8626,9 @@ get_current_vm_state (struct frame *f,
|
|
Karel Klic |
782803 |
for (i = 0; i < actual_size; ++i)
|
|
Karel Klic |
782803 |
{
|
|
Karel Klic |
782803 |
Atom a = ((Atom*)tmp_data)[i];
|
|
Karel Klic |
782803 |
- if (a == dpyinfo->Xatom_net_wm_state_maximized_horz)
|
|
Karel Klic |
782803 |
+ if (a == dpyinfo->Xatom_net_wm_state_hidden)
|
|
Karel Klic |
782803 |
+ is_hidden = 1;
|
|
Karel Klic |
782803 |
+ else if (a == dpyinfo->Xatom_net_wm_state_maximized_horz)
|
|
Karel Klic |
782803 |
{
|
|
Karel Klic |
782803 |
if (*size_state == FULLSCREEN_HEIGHT)
|
|
Karel Klic |
782803 |
*size_state = FULLSCREEN_MAXIMIZED;
|
|
Karel Klic |
782803 |
@@ -8635,6 +8650,7 @@ get_current_vm_state (struct frame *f,
|
|
Karel Klic |
782803 |
|
|
Karel Klic |
782803 |
if (tmp_data) XFree (tmp_data);
|
|
Karel Klic |
782803 |
UNBLOCK_INPUT;
|
|
Karel Klic |
782803 |
+ return ! is_hidden;
|
|
Karel Klic |
782803 |
}
|
|
Karel Klic |
782803 |
|
|
Karel Klic |
782803 |
/* Do fullscreen as specified in extended window manager hints */
|
|
Karel Klic |
782803 |
@@ -8647,7 +8663,7 @@ do_ewmh_fullscreen (f)
|
|
Karel Klic |
782803 |
Lisp_Object lval = get_frame_param (f, Qfullscreen);
|
|
Karel Klic |
782803 |
int cur, dummy;
|
|
Karel Klic |
782803 |
|
|
Karel Klic |
782803 |
- get_current_vm_state (f, FRAME_OUTER_WINDOW (f), &cur, &dummy);
|
|
Karel Klic |
782803 |
+ (void)get_current_vm_state (f, FRAME_OUTER_WINDOW (f), &cur, &dummy);
|
|
Karel Klic |
782803 |
|
|
Karel Klic |
782803 |
/* Some window managers don't say they support _NET_WM_STATE, but they do say
|
|
Karel Klic |
782803 |
they support _NET_WM_STATE_FULLSCREEN. Try that also. */
|
|
Karel Klic |
782803 |
@@ -8721,7 +8737,7 @@ XTfullscreen_hook (f)
|
|
Karel Klic |
782803 |
}
|
|
Karel Klic |
782803 |
|
|
Karel Klic |
782803 |
|
|
Karel Klic |
782803 |
-static void
|
|
Karel Klic |
782803 |
+static int
|
|
Karel Klic |
782803 |
x_handle_net_wm_state (f, event)
|
|
Karel Klic |
782803 |
struct frame *f;
|
|
Karel Klic |
782803 |
XPropertyEvent *event;
|
|
Karel Klic |
782803 |
@@ -8729,10 +8745,10 @@ x_handle_net_wm_state (f, event)
|
|
Karel Klic |
782803 |
int value = FULLSCREEN_NONE;
|
|
Karel Klic |
782803 |
Lisp_Object lval;
|
|
Karel Klic |
782803 |
int sticky = 0;
|
|
Karel Klic |
782803 |
+ int not_hidden = get_current_vm_state (f, event->window, &value, &sticky);
|
|
Karel Klic |
782803 |
|
|
Karel Klic |
782803 |
- get_current_vm_state (f, event->window, &value, &sticky);
|
|
Karel Klic |
782803 |
lval = Qnil;
|
|
Karel Klic |
782803 |
- switch (value)
|
|
Karel Klic |
782803 |
+ switch (value)
|
|
Karel Klic |
782803 |
{
|
|
Karel Klic |
782803 |
case FULLSCREEN_WIDTH:
|
|
Karel Klic |
782803 |
lval = Qfullwidth;
|
|
Karel Klic |
782803 |
@@ -8747,9 +8763,10 @@ x_handle_net_wm_state (f, event)
|
|
Karel Klic |
782803 |
lval = Qmaximized;
|
|
Karel Klic |
782803 |
break;
|
|
Karel Klic |
782803 |
}
|
|
Karel Klic |
782803 |
-
|
|
Karel Klic |
782803 |
store_frame_param (f, Qfullscreen, lval);
|
|
Karel Klic |
782803 |
store_frame_param (f, Qsticky, sticky ? Qt : Qnil);
|
|
Karel Klic |
782803 |
+
|
|
Karel Klic |
782803 |
+ return not_hidden;
|
|
Karel Klic |
782803 |
}
|
|
Karel Klic |
782803 |
|
|
Karel Klic |
782803 |
/* Check if we need to resize the frame due to a fullscreen request.
|
|
Karel Klic |
782803 |
@@ -9487,7 +9504,7 @@ x_iconify_frame (f)
|
|
Karel Klic |
782803 |
if (!NILP (type))
|
|
Karel Klic |
782803 |
x_bitmap_icon (f, type);
|
|
Karel Klic |
782803 |
|
|
Karel Klic |
782803 |
-#ifdef USE_GTK
|
|
Karel Klic |
782803 |
+#if defined (USE_GTK)
|
|
Karel Klic |
782803 |
if (FRAME_GTK_OUTER_WIDGET (f))
|
|
Karel Klic |
782803 |
{
|
|
Karel Klic |
782803 |
if (! FRAME_VISIBLE_P (f))
|
|
Karel Klic |
782803 |
@@ -10518,6 +10535,8 @@ x_term_init (display_name, xrm_option, r
|
|
Karel Klic |
782803 |
= XInternAtom (dpyinfo->display, "_NET_WM_STATE_MAXIMIZED_VERT", False);
|
|
Karel Klic |
782803 |
dpyinfo->Xatom_net_wm_state_sticky
|
|
Karel Klic |
782803 |
= XInternAtom (dpyinfo->display, "_NET_WM_STATE_STICKY", False);
|
|
Karel Klic |
782803 |
+ dpyinfo->Xatom_net_wm_state_hidden
|
|
Karel Klic |
782803 |
+ = XInternAtom (dpyinfo->display, "_NET_WM_STATE_HIDDEN", False);
|
|
Karel Klic |
782803 |
dpyinfo->Xatom_net_window_type
|
|
Karel Klic |
782803 |
= XInternAtom (dpyinfo->display, "_NET_WM_WINDOW_TYPE", False);
|
|
Karel Klic |
782803 |
dpyinfo->Xatom_net_window_type_tooltip
|
|
Karel Klic |
782803 |
diff -up emacs-23.3/src/xterm.h.wm-state-hidden emacs-23.3/src/xterm.h
|
|
Karel Klic |
782803 |
--- emacs-23.3/src/xterm.h.wm-state-hidden 2011-01-08 18:45:14.000000000 +0100
|
|
Karel Klic |
782803 |
+++ emacs-23.3/src/xterm.h 2011-11-23 11:56:01.219467181 +0100
|
|
Karel Klic |
782803 |
@@ -365,7 +365,7 @@ struct x_display_info
|
|
Karel Klic |
782803 |
/* Atoms dealing with EWMH (i.e. _NET_...) */
|
|
Karel Klic |
782803 |
Atom Xatom_net_wm_state, Xatom_net_wm_state_fullscreen_atom,
|
|
Karel Klic |
782803 |
Xatom_net_wm_state_maximized_horz, Xatom_net_wm_state_maximized_vert,
|
|
Karel Klic |
782803 |
- Xatom_net_wm_state_sticky, Xatom_net_frame_extents;
|
|
Karel Klic |
782803 |
+ Xatom_net_wm_state_sticky, Xatom_net_wm_state_hidden, Xatom_net_frame_extents;
|
|
Karel Klic |
782803 |
|
|
Karel Klic |
782803 |
/* XSettings atoms and windows. */
|
|
Karel Klic |
782803 |
Atom Xatom_xsettings_sel, Xatom_xsettings_prop, Xatom_xsettings_mgr;
|