unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#18657: 24.4.50; positioning frames on multi-monitor displays
@ 2014-10-07 18:29 Drew Adams
  2014-10-07 21:18 ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2014-10-07 18:29 UTC (permalink / raw)
  To: 18657

This is a followup to the thread for bug #18637.  Please see that
thread.

It's not clear to me how to understand/calculate which monitor a given
frame will be displayed on, or how (if at all possible) to control which
monitor is used.

What the code in question does is to (a) save the original `left',
`top', `width', and `height' frame parameter values for a frame, and
then to change those, using `modify-frame-parameters', to resize the
frame to a "maximized" size (in quotes because the size does not
necessarily correspond exactly to what maximize might mean for the
window manager, and window-manager maximization is not employed).

The "restore" part of the code then calls `modify-frame-parameters'
to set the `left' etc. parameters back to the saved (original) values.
(The values are saved in new frame paramters, `restore-left', etc.)

The code does not delete or create any frames.  It just sets those frame
parameters.  The problem encountered is that the monitor in which the
frame is displayed changes.  The aim is to keep the frame on the same
monitor, regardless of the size change.

The OP reporting the problem is not, I think, on MS Windows, but I test
the code only on Windows.  The problem reported is likely on more than
one platform.  I would be interested in a platform-independent solution.

The code in question is commands `maximize-frame' and `restore-frame' in
this library: http://www.emacswiki.org/emacs-en/download/frame-cmds.el.
This other library is required by that one, in general:
http://www.emacswiki.org/emacs-en/download/frame-fns.el.


In GNU Emacs 24.4.50.1 (i686-pc-mingw32)
 of 2014-09-15 on LEG570
Bzr revision: 117884 dancol@dancol.org-20140915050944-sqsajysnwef51f9m
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1'





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#18657: 24.4.50; positioning frames on multi-monitor displays
  2014-10-07 18:29 bug#18657: 24.4.50; positioning frames on multi-monitor displays Drew Adams
@ 2014-10-07 21:18 ` Drew Adams
  2014-10-07 23:56   ` Drew Adams
  2021-07-13 22:00   ` bug#18637: " Lars Ingebrigtsen
  0 siblings, 2 replies; 5+ messages in thread
From: Drew Adams @ 2014-10-07 21:18 UTC (permalink / raw)
  To: 18657

As an update, the OP who reported the issue to me confirms that he
is using MS Windows (I thought he was not).  And he sent me this
info from his setup:

(frame-parameters):

((tool-bar-position . top) (parent-id) (explicit-name) (display . "w32") (visibility . t) (icon-name) (window-id . "459396") (top . 11) (left + -1249) (buried-buffer-list) (buffer-list #<buffer *Messages*> #<buffer  *Minibuf-1*> #<buffer procedure-codes.org> #<buffer  *Agenda Commands*> #<buffer *Org Agenda(w)*> #<buffer work-log.org>) (unsplittable) ...

M-x maximize-frame

(frame-parameters):
((tool-bar-position . top) (parent-id) (explicit-name) (display . "w32") (visibility . t) (icon-name) (window-id . "459396") (top . 0) (left . 0) (buried-buffer-list) (buffer-list #<buffer *Messages*> #<buffer  *Minibuf-1*> #<buffer procedure-codes.org> #<buffer  *Agenda Commands*> #<buffer *Org Agenda(w)*> #<buffer work-log.org>) (unsplittable) ...)
M-x restore-frame
((tool-bar-position . top) (parent-id) (explicit-name) (display . "w32") (visibility . t) (icon-name) (window-id . "459396") (top . 11) (left + -1249) (buried-buffer-list) (buffer-list #<buffer *Messages*> #<buffer  *Minibuf-1*> #<buffer procedure-codes.org> #<buffer  *Agenda Commands*> #<buffer *Org Agenda(w)*> #<buffer work-log.org>) (unsplittable) ...)

Based on that, I've sent him an updated version of `maximize-frame'
(from `frame-cmds.el'), which differs only in not using (0,0) as the
position coordinates systematically.  Instead, it uses this:

(nth 1 (assq 'workarea (frame-monitor-attributes frame))) ; For left
(nth 2 (assq 'workarea (frame-monitor-attributes frame))) ; For right

Andy, perhaps you could try that?

[I'm assuming that the `workarea' and `geometry' values are, in order:
LEFT TOP, WIDTH HEIGHT.

FWIW, The doc of `display-monitor-attributes-list' refers to them as
X Y WIDTH HEIGHT, and the doc of `frame-monitor-attributes' refers to
the `d-m-a-l' doc.  Not so clear (What are X and Y? What units for
WIDTH and HEIGHT?), but better than nothing.

(BTW, if these essentially follow the `geometry' X Window spec, why
is the order changed from what is used for that?)]





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#18657: 24.4.50; positioning frames on multi-monitor displays
  2014-10-07 21:18 ` Drew Adams
@ 2014-10-07 23:56   ` Drew Adams
  2021-07-13 22:00   ` bug#18637: " Lars Ingebrigtsen
  1 sibling, 0 replies; 5+ messages in thread
From: Drew Adams @ 2014-10-07 23:56 UTC (permalink / raw)
  To: 18657

FYI - The OP tried this code that I suggested, for left and top,
instead of 0 and 0, in the `maximize-frame' code of frame-cmds.el:

(nth 1 (assq 'workarea (frame-monitor-attributes frame))) ; For left
(nth 2 (assq 'workarea (frame-monitor-attributes frame))) ; For top

But he does not have Emacs 24.4, so no `frame-monitor-attributes'
(and that ultimately depends on C code, so I can't just send him
the latest frame.el code to test).

He did try substituting (- 1520) instead of 0 for the `left' value,
and that positioned the frame pretty much where it should be.

Dunno yet whether -1520 would do the same thing.  There is nothing
in the doc that indicates the formats (or types) of the components
of what is returned for `workarea' & `geometry' (there should be).
But Andy Moreton's feedback shows that the value can be something
like -1520.

If there is someone with Emacs 24.4 who could test my `maximize-frame'
code with the change I suggested (using the code above, instead
of 0, for left and top), that would be good.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#18637: bug#18657: 24.4.50; positioning frames on multi-monitor displays
  2014-10-07 21:18 ` Drew Adams
  2014-10-07 23:56   ` Drew Adams
@ 2021-07-13 22:00   ` Lars Ingebrigtsen
  2021-07-13 22:20     ` bug#18657: [External] : " Drew Adams
  1 sibling, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-13 22:00 UTC (permalink / raw)
  To: Drew Adams; +Cc: 18657, 18637

Drew Adams <drew.adams@oracle.com> writes:

> Based on that, I've sent him an updated version of `maximize-frame'
> (from `frame-cmds.el'), which differs only in not using (0,0) as the
> position coordinates systematically.  Instead, it uses this:
>
> (nth 1 (assq 'workarea (frame-monitor-attributes frame))) ; For left
> (nth 2 (assq 'workarea (frame-monitor-attributes frame))) ; For right
>
> Andy, perhaps you could try that?

There doesn't really seem to be anything actionable in this bug report,
and not a lot in the parent report #18637, either.

I think for any progress to be made here, a report describing what
problem's you're seeing (if any, these days), and what you think should
be done about it should be filed.  But I'm closing this report and #18637.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#18657: [External] : Re: bug#18657: 24.4.50; positioning frames on multi-monitor displays
  2021-07-13 22:00   ` bug#18637: " Lars Ingebrigtsen
@ 2021-07-13 22:20     ` Drew Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2021-07-13 22:20 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 18657@debbugs.gnu.org, 18637@debbugs.gnu.org

> There doesn't really seem to be anything actionable in this bug report,
> and not a lot in the parent report #18637, either.
> 
> I think for any progress to be made here, a report describing what
> problem's you're seeing (if any, these days), and what you think should
> be done about it should be filed.  But I'm closing this report and #18637.

Yet another "won't fix".

At least one other user (Andy M) agreed in these
threads that "the meaning of geometry/workarea
and the coordinate system [need to be] given a
little more detail in the docs."

Alas, the docs weren't touched (AFAIK).  Too bad.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-13 22:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-07 18:29 bug#18657: 24.4.50; positioning frames on multi-monitor displays Drew Adams
2014-10-07 21:18 ` Drew Adams
2014-10-07 23:56   ` Drew Adams
2021-07-13 22:00   ` bug#18637: " Lars Ingebrigtsen
2021-07-13 22:20     ` bug#18657: [External] : " Drew Adams

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).