Subject: Re: bug#31650: 26.1; Desktop mode adds wm stickiness to emacs windows.

From: Rolf Ade <[email-masked]>
Date: Wed, 30 May 2018 12:53:03 +0200

martin rudalics <[email-masked]> writes:
> We would eventually have to find out whether and how an Emacs frame
> can get "spontaneously" sticky in a session that has not been polluted
> from a saved desktop.  I'd suggest to proceed as follows: Somewhere
> near the end of your init file (that is, after the code that restores
> the previous desktop) insert this code:
>
> (let (sticky-frames)
>   (dolist (frame (frame-list))
>     (when (frame-parameter frame 'sticky)
>       (setq sticky-frames (cons frame sticky-frames)))
>     (set-frame-parameter frame 'sticky nil))
>
>   (when sticky-frames
>     (message "The following frames were found sticky: %s" sticky-frames)))
>
> Now this should (1) make all your frames non-sticky in the new session
> and (2) tell you if some frames were stored as sticky in your last
> session.  If (2) happens frequently and you are sure that you have
> never marked any frames as sticky, we could execute that code above
> with an idle timer and so get an approximate indication of _when_ a
> frame changes its stickyness spontaneously.

Now, this is interesting.

I start emacs -Q. The frame comes up and isn't sticky.

Now I evaluate your code from above in the scratch buffer. It returns
nil. _But_: It also puts the frame into sticky mode!

If I evaluate your code again, it now returns:

The following frames were found sticky: (#<frame emacs@linux-qg7d 0x131a320>)

But the emacs frame is still sticky. If I evaluate your code once again
(the third time) it returns nil, as the first time, but the frame is
still sticky.

If I "un-stick" the frame with the appropriate wm command and evaluate
your code again it returns nil, but puts the frame back into sticky
mode!

If I start emacs -Q and first put the frame into sticky mode (with wm
command) and then evaluate your code I get

The following frames were found sticky: (#<frame emacs@linux-qg7d 0x131a320>)

But the frame is still sticky. If I evaluate your code again it returns
nil, but the frame stays in sticky mode.

This seems weird but this is, what I see, reproducible. As written, this
is with emacs 26.1 and fvwm2 2.6.4

rolf