aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/lispref/ChangeLog13
-rw-r--r--doc/lispref/frames.texi89
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/faces.el4
-rw-r--r--lisp/frame.el19
5 files changed, 116 insertions, 22 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
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5045e5d1469..e8fd37925fa 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
12014-10-08 Eli Zaretskii <eliz@gnu.org>
2
3 * faces.el (display-grayscale-p): Mention in the doc string that
4 the argument can be either a display name or a frame.
5
6 * frame.el (display-pixel-height, display-pixel-width)
7 (display-mm-height, display-mm-width, display-backing-store)
8 (display-save-under, display-planes, display-color-cells)
9 (display-visual-class, display-monitor-attributes-list)
10 (display-screens): Mention in the doc string that the argument can
11 be either a display name or a frame. Improve the docs of the
12 monitor attributes. (Bug#18636)
13
12014-10-06 Martin Rudalics <rudalics@gmx.at> 142014-10-06 Martin Rudalics <rudalics@gmx.at>
2 15
3 * term.el (term-window-width): Subtract 1 from the width when 16 * term.el (term-window-width): Subtract 1 from the width when
diff --git a/lisp/faces.el b/lisp/faces.el
index f316245d165..20665286b4f 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1814,7 +1814,9 @@ If omitted or nil, that stands for the selected frame's display."
1814(declare-function x-display-grayscale-p "xfns.c" (&optional terminal)) 1814(declare-function x-display-grayscale-p "xfns.c" (&optional terminal))
1815 1815
1816(defun display-grayscale-p (&optional display) 1816(defun display-grayscale-p (&optional display)
1817 "Return non-nil if frames on DISPLAY can display shades of gray." 1817 "Return non-nil if frames on DISPLAY can display shades of gray.
1818DISPLAY should be either a frame or a display name (a string).
1819If omitted or nil, that stands for the selected frame's display."
1818 (let ((frame-type (framep-on-display display))) 1820 (let ((frame-type (framep-on-display display)))
1819 (cond 1821 (cond
1820 ((memq frame-type '(x w32 ns)) 1822 ((memq frame-type '(x w32 ns))
diff --git a/lisp/frame.el b/lisp/frame.el
index f4d7622e662..9ab24cefc0f 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1381,6 +1381,7 @@ frame's display)."
1381 1381
1382(defun display-screens (&optional display) 1382(defun display-screens (&optional display)
1383 "Return the number of screens associated with DISPLAY. 1383 "Return the number of screens associated with DISPLAY.
1384DISPLAY should be either a frame or a display name (a string).
1384If DISPLAY is omitted or nil, it defaults to the selected frame's display." 1385If DISPLAY is omitted or nil, it defaults to the selected frame's display."
1385 (let ((frame-type (framep-on-display display))) 1386 (let ((frame-type (framep-on-display display)))
1386 (cond 1387 (cond
@@ -1393,6 +1394,7 @@ If DISPLAY is omitted or nil, it defaults to the selected frame's display."
1393 1394
1394(defun display-pixel-height (&optional display) 1395(defun display-pixel-height (&optional display)
1395 "Return the height of DISPLAY's screen in pixels. 1396 "Return the height of DISPLAY's screen in pixels.
1397DISPLAY can be a display name or a frame.
1396If DISPLAY is omitted or nil, it defaults to the selected frame's display. 1398If DISPLAY is omitted or nil, it defaults to the selected frame's display.
1397 1399
1398For character terminals, each character counts as a single pixel. 1400For character terminals, each character counts as a single pixel.
@@ -1412,6 +1414,7 @@ with DISPLAY. To get information for each physical monitor, use
1412 1414
1413(defun display-pixel-width (&optional display) 1415(defun display-pixel-width (&optional display)
1414 "Return the width of DISPLAY's screen in pixels. 1416 "Return the width of DISPLAY's screen in pixels.
1417DISPLAY can be a display name or a frame.
1415If DISPLAY is omitted or nil, it defaults to the selected frame's display. 1418If DISPLAY is omitted or nil, it defaults to the selected frame's display.
1416 1419
1417For character terminals, each character counts as a single pixel. 1420For character terminals, each character counts as a single pixel.
@@ -1450,6 +1453,7 @@ not explicitly specified."
1450(defun display-mm-height (&optional display) 1453(defun display-mm-height (&optional display)
1451 "Return the height of DISPLAY's screen in millimeters. 1454 "Return the height of DISPLAY's screen in millimeters.
1452If the information is unavailable, this function returns nil. 1455If the information is unavailable, this function returns nil.
1456DISPLAY can be a display name or a frame.
1453If DISPLAY is omitted or nil, it defaults to the selected frame's display. 1457If DISPLAY is omitted or nil, it defaults to the selected frame's display.
1454 1458
1455You can override what the system thinks the result should be by 1459You can override what the system thinks the result should be by
@@ -1470,6 +1474,7 @@ monitor, use `display-monitor-attributes-list'."
1470(defun display-mm-width (&optional display) 1474(defun display-mm-width (&optional display)
1471 "Return the width of DISPLAY's screen in millimeters. 1475 "Return the width of DISPLAY's screen in millimeters.
1472If the information is unavailable, this function returns nil. 1476If the information is unavailable, this function returns nil.
1477DISPLAY can be a display name or a frame.
1473If DISPLAY is omitted or nil, it defaults to the selected frame's display. 1478If DISPLAY is omitted or nil, it defaults to the selected frame's display.
1474 1479
1475You can override what the system thinks the result should be by 1480You can override what the system thinks the result should be by
@@ -1493,6 +1498,7 @@ monitor, use `display-monitor-attributes-list'."
1493 "Return the backing store capability of DISPLAY's screen. 1498 "Return the backing store capability of DISPLAY's screen.
1494The value may be `always', `when-mapped', `not-useful', or nil if 1499The value may be `always', `when-mapped', `not-useful', or nil if
1495the question is inapplicable to a certain kind of display. 1500the question is inapplicable to a certain kind of display.
1501DISPLAY can be a display name or a frame.
1496If DISPLAY is omitted or nil, it defaults to the selected frame's display." 1502If DISPLAY is omitted or nil, it defaults to the selected frame's display."
1497 (let ((frame-type (framep-on-display display))) 1503 (let ((frame-type (framep-on-display display)))
1498 (cond 1504 (cond
@@ -1505,6 +1511,7 @@ If DISPLAY is omitted or nil, it defaults to the selected frame's display."
1505 1511
1506(defun display-save-under (&optional display) 1512(defun display-save-under (&optional display)
1507 "Return non-nil if DISPLAY's screen supports the SaveUnder feature. 1513 "Return non-nil if DISPLAY's screen supports the SaveUnder feature.
1514DISPLAY can be a display name or a frame.
1508If DISPLAY is omitted or nil, it defaults to the selected frame's display." 1515If DISPLAY is omitted or nil, it defaults to the selected frame's display."
1509 (let ((frame-type (framep-on-display display))) 1516 (let ((frame-type (framep-on-display display)))
1510 (cond 1517 (cond
@@ -1517,6 +1524,7 @@ If DISPLAY is omitted or nil, it defaults to the selected frame's display."
1517 1524
1518(defun display-planes (&optional display) 1525(defun display-planes (&optional display)
1519 "Return the number of planes supported by DISPLAY. 1526 "Return the number of planes supported by DISPLAY.
1527DISPLAY can be a display name or a frame.
1520If DISPLAY is omitted or nil, it defaults to the selected frame's display." 1528If DISPLAY is omitted or nil, it defaults to the selected frame's display."
1521 (let ((frame-type (framep-on-display display))) 1529 (let ((frame-type (framep-on-display display)))
1522 (cond 1530 (cond
@@ -1531,6 +1539,7 @@ If DISPLAY is omitted or nil, it defaults to the selected frame's display."
1531 1539
1532(defun display-color-cells (&optional display) 1540(defun display-color-cells (&optional display)
1533 "Return the number of color cells supported by DISPLAY. 1541 "Return the number of color cells supported by DISPLAY.
1542DISPLAY can be a display name or a frame.
1534If DISPLAY is omitted or nil, it defaults to the selected frame's display." 1543If DISPLAY is omitted or nil, it defaults to the selected frame's display."
1535 (let ((frame-type (framep-on-display display))) 1544 (let ((frame-type (framep-on-display display)))
1536 (cond 1545 (cond
@@ -1547,6 +1556,7 @@ If DISPLAY is omitted or nil, it defaults to the selected frame's display."
1547 "Return the visual class of DISPLAY. 1556 "Return the visual class of DISPLAY.
1548The value is one of the symbols `static-gray', `gray-scale', 1557The value is one of the symbols `static-gray', `gray-scale',
1549`static-color', `pseudo-color', `true-color', or `direct-color'. 1558`static-color', `pseudo-color', `true-color', or `direct-color'.
1559DISPLAY can be a display name or a frame.
1550If DISPLAY is omitted or nil, it defaults to the selected frame's display." 1560If DISPLAY is omitted or nil, it defaults to the selected frame's display."
1551 (let ((frame-type (framep-on-display display))) 1561 (let ((frame-type (framep-on-display display)))
1552 (cond 1562 (cond
@@ -1567,6 +1577,7 @@ If DISPLAY is omitted or nil, it defaults to the selected frame's display."
1567 1577
1568(defun display-monitor-attributes-list (&optional display) 1578(defun display-monitor-attributes-list (&optional display)
1569 "Return a list of physical monitor attributes on DISPLAY. 1579 "Return a list of physical monitor attributes on DISPLAY.
1580DISPLAY can be a display name, a terminal name, or a frame.
1570If DISPLAY is omitted or nil, it defaults to the selected frame's display. 1581If DISPLAY is omitted or nil, it defaults to the selected frame's display.
1571Each element of the list represents the attributes of a physical 1582Each element of the list represents the attributes of a physical
1572monitor. The first element corresponds to the primary monitor. 1583monitor. The first element corresponds to the primary monitor.
@@ -1576,14 +1587,16 @@ of attribute keys and values as follows:
1576 1587
1577 geometry -- Position and size in pixels in the form of (X Y WIDTH HEIGHT) 1588 geometry -- Position and size in pixels in the form of (X Y WIDTH HEIGHT)
1578 workarea -- Position and size of the work area in pixels in the 1589 workarea -- Position and size of the work area in pixels in the
1579 form of (X Y WIDTH HEIGHT) 1590 form of (X Y WIDTH HEIGHT); this excludes task bar etc.
1580 mm-size -- Width and height in millimeters in the form of 1591 mm-size -- Width and height in millimeters in the form of
1581 (WIDTH HEIGHT) 1592 (WIDTH HEIGHT)
1582 frames -- List of frames dominated by the physical monitor 1593 frames -- List of frames dominated by the physical monitor
1583 name (*) -- Name of the physical monitor as a string 1594 name (*) -- Name of the physical monitor as a string
1584 1595
1585where X, Y, WIDTH, and HEIGHT are integers. Keys labeled 1596where X, Y, WIDTH, and HEIGHT are integers, which might be negative
1586with (*) are optional. 1597for monitors other than the primary one. X and Y are coordinates
1598of the top-left corner of the rectange. Keys labeled with (*) are
1599optional.
1587 1600
1588A frame is dominated by a physical monitor when either the 1601A frame is dominated by a physical monitor when either the
1589largest area of the frame resides in the monitor, or the monitor 1602largest area of the frame resides in the monitor, or the monitor