Subject: Re: bug#25851: 25.2; GTK warning when starting Emacs when desktop file has more than one frame

From: martin rudalics <[email-masked]>
Date: Thu, 02 Mar 2017 18:57:30 +0100

> I'm sorry, I'm confused.  Earlier you explained that we do that
 > because users want the ability of placing frames outside of the
 > visible area, so I concluded that the fact we allow that is because we
 > want to cater to such users.  Now you seem to be saying that we
 > shouldn't cater to them?  How to reconcile these two?  Or am I missing
 > something?

It's not that we "shouldn't".  IMO we "can't" (contrary to Windows).
Maybe before

commit 3e5fc571bd5a9bdbed786b43a7971c41f87c6ad8
Author: Chong Yidong <[email-masked]>
Date:   Mon Oct 6 16:17:14 2008 +0000

     (x_wm_set_size_hint): Return immediately if called during
     initialization.

we were able to do so but I have no proof.  If someone has a GTK build
older than that, please try whether something like

(make-frame
  '((user-position . t)
    (left . (+ -100))
    (top . (+ -100))))

worked.  Nowadays it can't IMO because gtk_window_parse_geometry has

   /* we don't let you put a window offscreen; maybe some people would
    * prefer to be able to, but it's kind of a bogus thing to do.
    */
   if (y < 0)
     y = 0;

   if (x < 0)
     x = 0;

Obviously, the window manager might also insist on putting the frame
on-screen (it does so here).  But while I cannot put a GTK
override-redirect window off-screen initially, I can easily do that for
a Lucid override-redirect window.

Also

(let ((frame (make-frame)))
   (set-frame-parameter frame 'left '(+ -100))
   (set-frame-parameter frame 'top '(+ -100)))

works as intended here.  But that's of little use when parsing default
geometry specifications.  Well, we could synthesize that ...

So maybe we should do away with the gtk_window_parse_geometry call, wait
for people to holler and try to fix problems with gtk_window_move calls
followed by something like x_wm_set_size_hint (f, 0, true) if needed.

But I'm not overly optimistic and would like to hear the opinion of at
least one person with GTK skills first.  Maybe everything I said here is
just silly.

martin