unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Oleksandr Gavenko <gavenkoa@gmail.com>
To: martin rudalics <rudalics@gmx.at>
Cc: 19413@debbugs.gnu.org
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.
Date: Sat, 20 Dec 2014 14:33:48 +0200	[thread overview]
Message-ID: <87oaqy5wlv.fsf@gavenkoa.example.com> (raw)
In-Reply-To: <54954B26.2000200@gmx.at> (martin rudalics's message of "Sat, 20 Dec 2014 11:10:46 +0100")

On 2014-12-20, martin rudalics wrote:

>> (setq desktop-saved-frameset [frameset 1 (21652 39439 387790 976000) (desktop . "206") "user@desktop.home.int" nil nil (((... (sticky) ... )))])
>
> `sticky' is nil here.  When in the restored frame you evaluate
>
> (frame-parameter nil 'sticky)
>
> what do you get?
>

When frame sticky (Fvwm decorate it especially) I get "t". For non-sticky I
get "nil".

I check what file used as desktop save file (two last line from output when I
C-x C-c from Emacs):

  $ strace -f -eopen emacs --no-site-file  2>&1 | grep -v 'ENOENT\|python'
  ...
  [pid  9179] open("/home/user/.emacs.desktop", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 14
  [pid  9179] open("/home/user/.emacs.d/auto-save-list/.saves-9179-desktop.home.int~", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 14

With only .emacs:

  (desktop-save-mode 1)

and "emacs --no-site-file" and ~/.emacs.desktop:

(setq desktop-saved-frameset [frameset 1 (21653 23984 363080 668000) (desktop . "206") "user@desktop.home.int" 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 . "A948-AB72-D73D-287C") (frameset--mini t . t) (modeline . t) (minibuffer . t) (unsplittable) (icon-name) (visibility . t) (display . ":0") (explicit-name) (height . 35) (width . 80) (left . 1240) (top . 28)) ((min-height . 8) (min-width . 10) (min-height-ignore . 4) (min-width-ignore . 8) (min-height-safe . 2) (min-width-safe . 2) (min-pixel-height . 112) (min-pixel-width . 70) (min-pixel-height-ignore . 56) (min-pixel-width-ignore . 56) (min-pixel-height-safe . 28) (min-pixel-width-safe . 14)) vc (pixel-width . 597) (pixel-height . 476) (total-width . 85) (total-height . 34) (normal-height . 1.0) (normal-width . 1.0) (combination-limit) (leaf (pixel-width . 597) (pixel-height . 238) (total-width . 85) (total-height . 17) (normal-height . 0.5) (normal-width . 1.0) (buffer "mc.ext" (selected) (hscroll . 0) (fringes 10 11 nil) (margins nil) (scroll-bars 16 3 t nil) (vscroll . 0) (dedicated) (point . 5457) (start . 5293))) (leaf (last . t) (pixel-width . 597) (pixel-height . 238) (total-width . 85) (total-height . 17) (normal-height . 0.5) (normal-width . 1.0) (buffer "*Messages*" (selected . t) (hscroll . 0) (fringes 10 11 nil) (margins nil) (scroll-bars 16 3 t nil) (vscroll . 0) (dedicated) (point . 284) (start . 1)))))])

I always get normally started Emacs unless I shaded Emacs window. When I close
shaded Emacs ~/.emacs.desktop changed to:

(setq desktop-saved-frameset [frameset 1 (21653 24375 351017 568000) (desktop . "206") "user@desktop.home.int" 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 . "A948-AB72-D73D-287C") (frameset--mini t . t) (modeline . t) (minibuffer . t) (unsplittable) (icon-name) (visibility . t) (display . ":0") (explicit-name) (sticky) (height . 35) (width . 80) (left . 1240) (top . 28)) ((min-height . 8) (min-width . 10) (min-height-ignore . 4) (min-width-ignore . 8) (min-height-safe . 2) (min-width-safe . 2) (min-pixel-height . 112) (min-pixel-width . 70) (min-pixel-height-ignore . 56) (min-pixel-width-ignore . 56) (min-pixel-height-safe . 28) (min-pixel-width-safe . 14)) vc (pixel-width . 597) (pixel-height . 476) (total-width . 85) (total-height . 34) (normal-height . 1.0) (normal-width . 1.0) (combination-limit) (leaf (pixel-width . 597) (pixel-height . 238) (total-width . 85) (total-height . 17) (normal-height . 0.5) (normal-width . 1.0) (buffer "mc.ext" (selected) (hscroll . 0) (fringes 10 11 nil) (margins nil) (scroll-bars 16 3 t nil) (vscroll . 0) (dedicated) (point . 5457) (start . 5293))) (leaf (last . t) (pixel-width . 597) (pixel-height . 238) (total-width . 85) (total-height . 17) (normal-height . 0.5) (normal-width . 1.0) (buffer "*Messages*" (selected . t) (hscroll . 0) (fringes 10 11 nil) (margins nil) (scroll-bars 16 3 t nil) (vscroll . 0) (dedicated) (point . 284) (start . 1)))))])

You can see difference in "(sticky)" above. New "emacs --no-site-file" opened
as sticky and when I close Emacs ~/.emacs.desktop changed to:

(setq desktop-saved-frameset [frameset 1 (21653 24557 165658 111000) (desktop . "206") "user@desktop.home.int" 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 . "A948-AB72-D73D-287C") (frameset--mini t . t) (modeline . t) (minibuffer . t) (unsplittable) (icon-name) (visibility . t) (display . ":0") (explicit-name) (sticky . t) (height . 35) (width . 80) (left . 1240) (top . 28)) ((min-height . 8) (min-width . 10) (min-height-ignore . 4) (min-width-ignore . 8) (min-height-safe . 2) (min-width-safe . 2) (min-pixel-height . 112) (min-pixel-width . 70) (min-pixel-height-ignore . 56) (min-pixel-width-ignore . 56) (min-pixel-height-safe . 28) (min-pixel-width-safe . 14)) vc (pixel-width . 597) (pixel-height . 476) (total-width . 85) (total-height . 34) (normal-height . 1.0) (normal-width . 1.0) (combination-limit) (leaf (pixel-width . 597) (pixel-height . 238) (total-width . 85) (total-height . 17) (normal-height . 0.5) (normal-width . 1.0) (buffer "mc.ext" (selected) (hscroll . 0) (fringes 10 11 nil) (margins nil) (scroll-bars 16 3 t nil) (vscroll . 0) (dedicated) (point . 5457) (start . 5293))) (leaf (last . t) (pixel-width . 597) (pixel-height . 238) (total-width . 85) (total-height . 17) (normal-height . 0.5) (normal-width . 1.0) (buffer "*Messages*" (selected . t) (hscroll . 0) (fringes 10 11 nil) (margins nil) (scroll-bars 16 3 t nil) (vscroll . 0) (dedicated) (point . 284) (start . 1)))))])

You can see difference in "(sticky . t)" above. Next rerun leave
~/.emacs.desktop without changes.

As shown strace Emacs load ~/.emacs.d/elpa/* so I rename this dir.

Evaluation of "(desktop-save-mode 1)" in "emacs -Q" (not from ~/.emacs) prompt
me on exit:

  Current desktop was not loaded from a file.  Overwrite this desktop file? (yes or no)

If leave Emacs with shaded window (pressing X button in titlebar) I get GTK
file selection dialogs about .emacs.desktop file. After leaving "(sticky)"
seen in ~/.emacs.desktop.

I check value of:

  after-init-hook is a variable defined in `startup.el'.
  Its value is (#[0 "..."
       [command-line-args desktop-save-mode desktop-restore-frames initial-window-system inhibit-startup-screen "--no-desktop" delete 0 daemonp desktop-read t]
       4 "\n\n(fn)"]
   x-wm-set-size-hint)


and if load "emacs -Q" and then evaluate (desktop-read) with "(sticky)" in
~/.emacs.desktop I get sticky Emacs window.

So there are two problems:

 1) Emacs instead saving shaded window attribute add "(sticky)" to ~/.emacs.desktop

 2) (desktop-read) wrongly apply (sticky), and (sticky . t) and (sticky . nil)
 - as always sticky.

I check /src/xterm.h:

  /* Atoms dealing with EWMH (i.e. _NET_...) */
  Atom Xatom_net_wm_state, Xatom_net_wm_state_fullscreen,
    Xatom_net_wm_state_maximized_horz, Xatom_net_wm_state_maximized_vert,
    Xatom_net_wm_state_sticky, Xatom_net_wm_state_hidden,
    Xatom_net_frame_extents,
    Xatom_net_current_desktop, Xatom_net_workarea;

There are no _NET_WM_STATE_SHADED that defined in:

  http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html#idm140130317598336
    _NET_WM_STATE

which say:

  Possible atoms are:

  _NET_WM_STATE_MODAL, ATOM
  _NET_WM_STATE_STICKY, ATOM
  _NET_WM_STATE_MAXIMIZED_VERT, ATOM
  _NET_WM_STATE_MAXIMIZED_HORZ, ATOM
  _NET_WM_STATE_SHADED, ATOM
  _NET_WM_STATE_SKIP_TASKBAR, ATOM
  _NET_WM_STATE_SKIP_PAGER, ATOM
  _NET_WM_STATE_HIDDEN, ATOM
  _NET_WM_STATE_FULLSCREEN, ATOM
  _NET_WM_STATE_ABOVE, ATOM
  _NET_WM_STATE_BELOW, ATOM
  _NET_WM_STATE_DEMANDS_ATTENTION, ATOM

-- 
Best regards!





  reply	other threads:[~2014-12-20 12:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-19 21:46 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 Oleksandr Gavenko
2014-12-19 21:52 ` Eli Zaretskii
2014-12-19 22:35   ` Oleksandr Gavenko
2014-12-20 10:10 ` martin rudalics
2014-12-20 12:33   ` Oleksandr Gavenko [this message]
2014-12-20 14:50     ` martin rudalics
2014-12-20 17:33       ` Oleksandr Gavenko
2014-12-22  8:52         ` Jan Djärv
2022-01-30 21:16           ` Lars Ingebrigtsen
2022-02-05  6:13             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-06  2:35               ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oaqy5wlv.fsf@gavenkoa.example.com \
    --to=gavenkoa@gmail.com \
    --cc=19413@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).