aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref
diff options
context:
space:
mode:
authorEli Zaretskii2014-10-08 13:16:45 +0300
committerEli Zaretskii2014-10-08 13:16:45 +0300
commit28ec0a87ca43f6d62b1503bedfe25640269fd7ef (patch)
tree11af3bd8cdfaeb03992f80fc67204806fba1cc89 /doc/lispref
parenta7044030f39a7351507727421308c56d7771bebf (diff)
downloademacs-28ec0a87ca43f6d62b1503bedfe25640269fd7ef.tar.gz
emacs-28ec0a87ca43f6d62b1503bedfe25640269fd7ef.zip
Fix bug #18636 with documentation of multi-monitor displays.
doc/lispref/frames.texi (Multiple Terminals): Improve the description of X display names. Add index entries. (Basic Parameters): Add a cross-reference to where X display names are described. (Position Parameters): Mention that positional parameters of the form (+ POS) can be negative if they are on a non-primary monitor of a multi-monitor display. (Creating Frames): Mention that on multi-monitor displays the frame might be positioned differently than specified by the frame parameters alist. lisp/faces.el (display-grayscale-p): Mention in the doc string that the argument can be either a display name or a frame. lisp/frame.el (display-pixel-height, display-pixel-width) (display-mm-height, display-mm-width, display-backing-store) (display-save-under, display-planes, display-color-cells) (display-visual-class, display-monitor-attributes-list) (display-screens): Mention in the doc string that the argument can be either a display name or a frame. Improve the docs of the monitor attributes.
Diffstat (limited to 'doc/lispref')
-rw-r--r--doc/lispref/ChangeLog13
-rw-r--r--doc/lispref/frames.texi89
2 files changed, 84 insertions, 18 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index babcc22959e..36497470705 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,16 @@
12014-10-08 Eli Zaretskii <eliz@gnu.org>
2
3 * frames.texi (Multiple Terminals): Improve the description of X
4 display names. Add index entries.
5 (Basic Parameters): Add a cross-reference to where X display names
6 are described.
7 (Position Parameters): Mention that positional parameters of the
8 form (+ POS) can be negative if they are on a non-primary monitor
9 of a multi-monitor display. (Bug#18636)
10 (Creating Frames): Mention that on multi-monitor displays the
11 frame might be positioned differently than specified by the frame
12 parameters alist.
13
12014-10-04 Glenn Morris <rgm@gnu.org> 142014-10-04 Glenn Morris <rgm@gnu.org>
2 15
3 * commands.texi (Generic Commands): Copyedits. 16 * commands.texi (Generic Commands): Copyedits.
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index afbace34575..cb3fefd7115 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -131,6 +131,13 @@ applies any parameters listed in @code{frame-inherited-parameters}
131(see below) and not present in the argument, taking the values from 131(see below) and not present in the argument, taking the values from
132the frame that was selected when @code{make-frame} was called. 132the frame that was selected when @code{make-frame} was called.
133 133
134Note that on multi-monitor displays (@pxref{Multiple Terminals}), the
135window manager might position the frame differently than specified by
136the positional parameters in @var{alist} (@pxref{Position
137Parameters}). For example, some window managers have a policy of
138displaying the frame on the monitor that contains the largest part of
139the window (a.k.a.@: the @dfn{dominating} monitor).
140
134This function itself does not make the new frame the selected frame. 141This function itself does not make the new frame the selected frame.
135@xref{Input Focus}. The previously selected frame remains selected. 142@xref{Input Focus}. The previously selected frame remains selected.
136On graphical terminals, however, the windowing system may select the 143On graphical terminals, however, the windowing system may select the
@@ -258,13 +265,27 @@ of those frames is ``@emph{the} selected frame'' at any given moment
258terminals, by interacting with the @command{emacsclient} program. 265terminals, by interacting with the @command{emacsclient} program.
259@xref{Emacs Server,,, emacs, The GNU Emacs Manual}. 266@xref{Emacs Server,,, emacs, The GNU Emacs Manual}.
260 267
268@cindex X display names
269@cindex display name on X
261 A single X server can handle more than one display. Each X display 270 A single X server can handle more than one display. Each X display
262has a three-part name, @samp{@var{host}:@var{server}.@var{screen}}. 271has a three-part name,
263The first two parts, @var{host} and @var{server}, identify the X 272@samp{@var{hostname}:@var{displaynumber}.@var{screennumber}}. The
264server; the third part, @var{screen}, identifies a screen number on 273first part, @var{hostname}, specifies the name of the machine to which
265that X server. When you use two or more screens belonging to one 274the display is physically connected. The second part,
266server, Emacs knows by the similarity in their names that they share a 275@var{displaynumber}, is a zero-based number that identifies one or
267single keyboard. 276more monitors connected to that machine that share a common keyboard
277and pointing device (mouse, tablet, etc.). The third part,
278@var{screennumber}, identifies a zero-based screen number (a separate
279monitor) that is part of a single monitor collection on that X server.
280When you use two or more screens belonging to one server, Emacs knows
281by the similarity in their names that they share a single keyboard.
282
283 Systems that don't use the X window system, such as MS-Windows,
284don't support the notion of X displays, and have only one display on
285each host. The display name on these systems doesn't follow the above
2863-part format; for example, the display name on MS-Windows systems is
287a constant string @samp{w32}, and exists for compatibility, so that
288you could pass it to functions that expect a display name.
268 289
269@deffn Command make-frame-on-display display &optional parameters 290@deffn Command make-frame-on-display display &optional parameters
270This function creates and returns a new frame on @var{display}, taking 291This function creates and returns a new frame on @var{display}, taking
@@ -320,19 +341,27 @@ to obtain information about such setups.
320 341
321@defun display-monitor-attributes-list &optional display 342@defun display-monitor-attributes-list &optional display
322This function returns a list of physical monitor attributes on 343This function returns a list of physical monitor attributes on
323@var{display}, which defaults to that of the selected frame. 344@var{display}, which can be a display name (a string), a terminal, or
324Each element of the list is an association list, representing the 345a frame; if omitted or @code{nil}, it defaults to the selected frame's
325attributes of a physical monitor. The first element corresponds to 346display. Each element of the list is an association list,
326the primary monitor. The attribute keys and values are: 347representing the attributes of a physical monitor. The first element
348corresponds to the primary monitor. The attribute keys and values
349are:
327 350
328@table @samp 351@table @samp
329@item geometry 352@item geometry
330Position and size in pixels as @samp{(@var{x} @var{y} 353Position of the top-left corner of the monitor's screen and its size,
331@var{width} @var{height})}. 354in pixels, as @samp{(@var{x} @var{y} @var{width} @var{height})}. Note
355that, if the monitor is not the primary monitor, some of the
356coordinates might be negative.
332 357
333@item workarea 358@item workarea
334Position and size of the work area in pixels as 359Position of the top-left corner and size of the work area in pixels as
335@samp{(@var{x} @var{y} @var{width} @var{height})}. 360@samp{(@var{x} @var{y} @var{width} @var{height})}. This is different
361from @samp{geometry} in that the various system windows, such as the
362task bar and side bar, are excluded from the work area. Note that, if
363the monitor is not the primary monitor, some of the coordinates might
364be negative.
336 365
337@item mm-size 366@item mm-size
338Width and height in millimeters as @samp{(@var{width} @var{height})} 367Width and height in millimeters as @samp{(@var{width} @var{height})}
@@ -353,6 +382,27 @@ does not intersect any physical monitors) that monitor is the closest
353to the frame. Every (non-tooltip) frame (whether visible or not) in a 382to the frame. Every (non-tooltip) frame (whether visible or not) in a
354graphical display is dominated by exactly one physical monitor at a 383graphical display is dominated by exactly one physical monitor at a
355time, though the frame can span multiple (or no) physical monitors. 384time, though the frame can span multiple (or no) physical monitors.
385
386Here's an example of the data produced by this function on a 2-monitor
387display:
388
389@smalllisp
390 (display-monitor-attributes-list)
391 @result{}
392 (((geometry 0 0 1920 1080) ;; Left hand monitor
393 (workarea 0 0 1920 1050) ;; Bottom of screen used for task bar
394 task bar
395 (mm-size 677 381)
396 (name . "\\\\.\\DISPLAY1")
397 (frames #<frame emacs@@host *foo* 0000000005BBDC48>
398 #<frame emacs@@host *scratch* 000000008179D370>))
399 ((geometry 1920 0 1680 1050) ;; Right hand monitor
400 (workarea 1920 0 1680 1050) ;; Whole screen can be used
401 (mm-size 593 370)
402 (name . "\\\\.\\DISPLAY2")
403 (frames)))
404@end smalllisp
405
356@end defun 406@end defun
357 407
358@defun frame-monitor-attributes &optional frame 408@defun frame-monitor-attributes &optional frame
@@ -529,8 +579,9 @@ frame. @code{title} and @code{name} are meaningful on all terminals.
529@vindex display, a frame parameter 579@vindex display, a frame parameter
530@item display 580@item display
531The display on which to open this frame. It should be a string of the 581The display on which to open this frame. It should be a string of the
532form @code{"@var{host}:@var{dpy}.@var{screen}"}, just like the 582form @samp{@var{host}:@var{dpy}.@var{screen}}, just like the
533@env{DISPLAY} environment variable. 583@env{DISPLAY} environment variable. @xref{Multiple Terminals}, for
584more details about display names.
534 585
535@vindex display-type, a frame parameter 586@vindex display-type, a frame parameter
536@item display-type 587@item display-type
@@ -586,12 +637,14 @@ right screen edge.
586@item @code{(+ @var{pos})} 637@item @code{(+ @var{pos})}
587This specifies the position of the left frame edge relative to the left 638This specifies the position of the left frame edge relative to the left
588screen edge. The integer @var{pos} may be positive or negative; a 639screen edge. The integer @var{pos} may be positive or negative; a
589negative value specifies a position outside the screen. 640negative value specifies a position outside the screen or on a monitor
641other than the primary one (for multi-monitor displays).
590 642
591@item @code{(- @var{pos})} 643@item @code{(- @var{pos})}
592This specifies the position of the right frame edge relative to the right 644This specifies the position of the right frame edge relative to the right
593screen edge. The integer @var{pos} may be positive or negative; a 645screen edge. The integer @var{pos} may be positive or negative; a
594negative value specifies a position outside the screen. 646negative value specifies a position outside the screen or on a monitor
647other than the primary one (for multi-monitor displays).
595@end table 648@end table
596 649
597Some window managers ignore program-specified positions. If you want to 650Some window managers ignore program-specified positions. If you want to