all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Getting display origin
@ 2005-06-08 11:28 David Reitter
  0 siblings, 0 replies; 3+ messages in thread
From: David Reitter @ 2005-06-08 11:28 UTC (permalink / raw)


Hi,

could someone tell me how to get the origin of the display?
I'm asking because on the Mac port (Carbon, not X11), the x-ordinates  
can easily become negative.
I've checked for some display-pixel-* function, and I've tried Google.

What I need to know is what the available range of coordinates are  
that are visible on the current display. I can get the width with  
display-pixel-width, but at least on the Mac, it doesn't always start  
at 0. For example, (frame-parameter (selected-frame) 'left) can  
return something like (+ -1045) if the frame in question is on the  
left screen of a multi-screen setup (with the menu bar = origin on  
the right).

Thanks
Dave

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

* Re: Getting display origin
       [not found] <mailman.3839.1118231061.25862.help-gnu-emacs@gnu.org>
@ 2005-06-08 17:44 ` rgb
  0 siblings, 0 replies; 3+ messages in thread
From: rgb @ 2005-06-08 17:44 UTC (permalink / raw)



> What I need to know is what the available range of coordinates are
> that are visible on the current display. I can get the width with
> display-pixel-width, but at least on the Mac, it doesn't always start
> at 0. For example, (frame-parameter (selected-frame) 'left) can
> return something like (+ -1045) if the frame in question is on the
> left screen of a multi-screen setup (with the menu bar = origin on
> the right).
>

Well I certainly couldn't find it either but if you do there's
more problems you will need to deal with.  Supplying negative
coordinates to set-frame-parameter causes the position to be
relative to the righthand side of both the frame and screen.
That is, (set-frame-parameter (selected-frame) 'left -1) puts
the inside right edge of the frame one pixel from the right edge
of the display.  So on my XP machine I had to use this to get
the frame's right edge entirely within the lefthand display.

(set-frame-parameter
 (selected-frame) 'left
 (- (+ (display-pixel-width x-display-name)
       (* 3 (frame-parameter (selected-frame) 'border-width)))))

I'm not sure how generic you want your support to be but there
is nothing that forces additional monitors to have the same size
as the primary and on my machine I can configure the secondary
display anywhere along the border of the primary display.
Meaning above, below, half way down one side... .  This, along
with the monitor size being different, it's a real mess!

I also found that if my frame has negative coordinates the mouse
wheel doesn't work.  I was eventually forced to rearrange my
work area to have the primary on the left.  I reported the problem
as a bug but don't know if it was ever fixed.  It's been months
since I've tried it.

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

* Re: Getting display origin
@ 2005-06-10 19:25 David Reitter
  0 siblings, 0 replies; 3+ messages in thread
From: David Reitter @ 2005-06-10 19:25 UTC (permalink / raw)
  Cc: rbielaws

rgb:

 > Supplying negative
 > coordinates to set-frame-parameter causes the position to be
 > relative to the righthand side of both the frame and screen.

Well that's a good hint already. At least I get stuff to appear on  
the left screen that way.

(display-screens) returns 1; I reckon that's correct because we have  
two displays (the width is the width of the main display).

But (x-display-list) only gives me a list of one. Now that sounds  
like a bug to me. ?
Guess I'll check the code some time.

Mouse wheel works fine everywhere. (but that's on OS X).

thanks so far
- D

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

end of thread, other threads:[~2005-06-10 19:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.3839.1118231061.25862.help-gnu-emacs@gnu.org>
2005-06-08 17:44 ` Getting display origin rgb
2005-06-10 19:25 David Reitter
  -- strict thread matches above, loose matches on Subject: below --
2005-06-08 11:28 David Reitter

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.