Subject: bug#19413: 24.4; (desktop-save-mode 1) save frame as page and desktop sticky (_NET_WM_STATE_STICKY) when close Emacs shaded, (setq desktop-restore-frames nil) fix issue.

From: Oleksandr Gavenko <[email-masked]>
Date: Fri, 19 Dec 2014 23:46:34 +0200

I upgrade Emacs on Debian to 24.4.1.

New changes for desktop-save-mode:

  *** Desktop now saves and restores the frame/window configuration.
  To disable this, set `desktop-restore-frames' to nil.

I don't set desktop-restore-frames previously.

When I use Fvwm `WindowShade` command on Emacs window it hided, only titlebar
shown.

If I close Emacs in shaded state and run again it gain sticky attribute (so it
shown on every page/desktop, follow my page/desktop switching).

So with "emacs -q" and only "(desktop-save-mode 1)" this behavior reproduced.

(setq desktop-restore-frames nil) fix issue.

Here ~/.emacs.desktop which hold data that lead to sticky attribute:

(setq desktop-saved-frameset [frameset 1 (21652 39439 387790 976000) (desktop . "206") "[email-masked]" nil nil ((((font-backend xft x) (font . "-Misc-Fixed-normal-normal-normal-*-14-*-*-*-c-70-iso10646-1") (font-parameter . "-misc-fixed-medium-r-normal-*-14-*-*-*-c-*-iso10646-1") (border-width . 0) (internal-border-width . 0) (right-divider-width . 0) (bottom-divider-width . 0) (vertical-scroll-bars . right) (foreground-color . "black") (background-color . "white") (mouse-color . "black") (border-color . "black") (screen-gamma) (line-spacing) (left-fringe . 10) (right-fringe . 11) (scroll-bar-foreground) (scroll-bar-background . "grey75") (menu-bar-lines . 1) (tool-bar-lines . 1) (title) (wait-for-wm . t) (fullscreen) (tool-bar-position . top) (icon-type . t) (auto-raise) (auto-lower) (cursor-type . box) (scroll-bar-width . 16) (alpha) (horizontal-scroll-bars . t) (display-type . color) (background-mode . light) (cursor-color . "black") (environment) (frameset--id . "0B83-6D5C-17FD-9D99") (frameset--mini t . t) (modeline . t) (minibuffer . t) (unsplittable) (icon-name) (visibility . t) (display . ":0") (explicit-name) (sticky) (height . 35) (width . 80) (left . 0) (top . 0)) ((min-height . 4) (min-width . 10) (min-height-ignore . 2) (min-width-ignore . 8) (min-height-safe . 1) (min-width-safe . 2) (min-pixel-height . 56) (min-pixel-width . 70) (min-pixel-height-ignore . 28) (min-pixel-width-ignore . 56) (min-pixel-height-safe . 14) (min-pixel-width-safe . 14)) leaf (pixel-width . 597) (pixel-height . 476) (total-width . 85) (total-height . 34) (normal-height . 1.0) (normal-width . 1.0) (buffer ".emacs-my" (selected . t) (hscroll . 0) (fringes 10 11 nil) (margins nil) (scroll-bars 16 3 t nil) (vscroll . 0) (dedicated) (point . 24) (start . 1))))])

Here X window properties that is on newly running sticky Emacs:

  $ xprop -id 0x200001b

  _NET_WM_STATE(ATOM) = _NET_WM_STATE_STICKY
  _MOTIF_DRAG_RECEIVER_INFO(_MOTIF_DRAG_RECEIVER_INFO) = 0x6c, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
  XdndAware(ATOM) = BITMAP
  WM_STATE(WM_STATE):
                  window state: Normal
                  icon window: 0x0
  _WIN_AREA(CARDINAL) = 0, 0
  _WIN_WORKSPACE(CARDINAL) = 1
  _WIN_LAYER(CARDINAL) = 4
  _WIN_STATE(CARDINAL) = 1
  _NET_FRAME_EXTENTS(CARDINAL) = 6, 6, 22, 6
  _KDE_NET_WM_FRAME_STRUT(CARDINAL) = 6, 6, 22, 6
  _NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_CLOSE, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_MOVE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_STICK
  _NET_WM_DESKTOP(CARDINAL) = 4294967295
  _NET_WM_ICON_VISIBLE_NAME(UTF8_STRING) = "[email-masked]"
  _NET_WM_VISIBLE_NAME(UTF8_STRING) = "[email-masked] «Emacs:emacs»"
  WM_HINTS(WM_HINTS):
                  Client accepts input or input focus: True
                  Initial state is Normal State.
                  bitmap id # to use for icon: 0x2000293
                  bitmap id # of mask for icon: 0x2000299
                  window id # of group leader: 0x2000001
  _NET_WM_OPAQUE_REGION(CARDINAL) = 7, 0, 1892, 7, 0, 7, 1906, 1153
  _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
  _NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 33554460, 33554461
  _NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x200001b
  WM_CLIENT_LEADER(WINDOW): window id # 0x2000001
  _NET_WM_PID(CARDINAL) = 13282
  WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
  WM_CLIENT_MACHINE(STRING) = "desktop"
  WM_NORMAL_HINTS(WM_SIZE_HINTS):
                  program specified minimum size: 51 by 96
                  program specified resize increment: 7 by 14
                  program specified base size: 44 by 82
                  window gravity: NorthWest
  WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
  WM_CLASS(STRING) = "emacs", "Emacs"
  WM_ICON_NAME(STRING) = "[email-masked]"
  _NET_WM_ICON_NAME(UTF8_STRING) = "[email-masked]"
  WM_NAME(STRING) = "[email-masked]"
  _NET_WM_NAME(UTF8_STRING) = "[email-masked]"

In GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.3)
 of 2014-10-25 on trouble, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11601000
System Description:	Debian GNU/Linux testing (jessie)

Configured using:
 `configure --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.4/site-lisp:/usr/share/emacs/site-lisp
 --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.4/site-lisp:/usr/share/emacs/site-lisp
 --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2
 -fstack-protector-strong -Wformat -Werror=format-security -Wall'
 CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-z,relro'

-- 
Best regards!