• Discovery of displays on a multi-monitor system

    From Keith Nash@21:1/5 to All on Sat Aug 19 21:23:13 2023
    A new toplevel can be created on any available screen by using the
    option -screen, e.g.

    toplevel .foo -screen :1.0

    Other per-screen operations use the option -displayof $WindowPath
    to specify the screen.

    Is there any command that returns a list of available screens?

    Keith.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From greg@21:1/5 to Keith Nash on Sun Aug 20 12:06:15 2023
    Keith Nash schrieb am Samstag, 19. August 2023 um 22:23:21 UTC+2:
    A new toplevel can be created on any available screen by using the
    option -screen, e.g.

    toplevel .foo -screen :1.0

    Other per-screen operations use the option -displayof $WindowPath
    to specify the screen.

    Is there any command that returns a list of available screens?

    Keith.

    https://wiki.tcl-lang.org/page/Dual+or+Multiple+Monitors

    the two procs Dualmonitor and is_dual_monitors didn't
    do anything for me under Linux with two monitors

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From saitology9@21:1/5 to Keith Nash on Sun Aug 20 15:21:39 2023
    On 8/19/2023 4:23 PM, Keith Nash wrote:
    A new toplevel can be created on any available screen by using the
    option -screen, e.g.

    toplevel .foo -screen :1.0

    Other per-screen operations use the option -displayof $WindowPath
    to specify the screen.

    Is there any command that returns a list of available screens?

    Keith.

    Have you tried ":0.1" to specify the second local display option? You
    may also want to check your xhost permissions.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et99@21:1/5 to Keith Nash on Sun Aug 20 14:12:15 2023
    On 8/19/2023 1:23 PM, Keith Nash wrote:
    A new toplevel can be created on any available screen by using the option -screen, e.g.

    toplevel .foo -screen :1.0

    Other per-screen operations use the option -displayof $WindowPath
    to specify the screen.

    Is there any command that returns a list of available screens?

    Keith.

    If all else fails:

    On linux, I would [exec] xrandr, and on windows, twapi::get_multiple_display_monitor_info

    And then I would use [wm geom .foo <position>] after getting .foo setup.

    where you would construct <position> based on the screen coordinates returned by one of the above two.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andreas Leitgeb@21:1/5 to Keith Nash on Sun Aug 20 20:51:31 2023
    Keith Nash <[email protected]> wrote:
    A new toplevel can be created on any available screen by using the
    option -screen, e.g.
    toplevel .foo -screen :1.0

    Screens are an old concept from X11, where two monitors attached
    to a single machine (usually via separate graphics-boards, as each
    board usually only had a single port) and handled by the same
    Xserver were handled separately as :0.0 and :0.1 (that was back
    in last millennium)

    Then, later (I think still last millennium) came (optional) Xinerama,
    where these :0.0 and :0.1 were united to a single big screen, where
    you could even have single windows extending across the monitor-
    boundaries. Quite a "wow!" back then.

    Nowadays, graphics-boards have multiple ports, and multiple
    graphics-boards are usually treated together as some dynamic
    screen-estate, which just grows or shrinks as further monitors
    get connected or disconnected, or the laptop-lid opened or closed.

    Since the time I have more than one monitor plugged to my machine
    (like about 10 years now), I haven't seen any :0.1 anymore, but just
    a single screen extending to all of them, and tools (e.g. arandr
    or those monitor-settings dialogs) to arrange their relative layout
    or switch to "mirroring" the same screen to all monitors.

    Given that monitors can be put in quite peculiar relative layouts,
    e.g. touching only in corners rather than along edges, it is probably
    quite non-trivial to identify a specific monitor and the rectangle of
    virtual big screen that it displays, at least for a simple application,
    unless it assumes running locally and being able to ask system utilities
    like xrandr for such information (on linux, no idea if windows has a
    pendant). These things would fail, if running remotely - e.g. over an
    ssh X-forwarding tunnel.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Keith Nash@21:1/5 to Keith Nash on Mon Aug 21 18:06:43 2023
    Thanks to everyone for the suggestions.

    Yes, common practice nowadays is to join multiple displays into a single
    large virtual display. This seems to be how Windows and X11 work by
    default. On X11 a genuinely independent display can be created with VNC
    or forwarded with SSH.

    Tk has aimed for full compatibility with multiple independent displays
    as far back as Tk 4.0, and I am trying to preserve this facility while
    revising part of the Tk library.

    As Andreas Leitgeb mentioned, :0.1 is seldom seen these days. However, different independent displays are numbered :0.0, :1.0 etc. There is no guarantee that the display of the root window is :0.0, or that the
    increment is 1. X11 displays forwarded by ssh begin at :10.0.

    Ideally I would like a command

    tk screens

    that returns a Tcl list of available screen identifiers.

    On X11, the closest I've found so far is a short C program from
    stackoverflow which reads the contents of directory /tmp/.X11-unix and
    then calls Xlib commands to examine each socket file.

    https://stackoverflow.com/questions/11367354/obtaining-list-of-all-xorg-displays

    (The code requires modification so it also examines listeners on TCP
    ports 6000 upwards.)

    It is possible to do the same thing in a Tcl script, but without access
    to Xlib functions it is necessary to either [exec xdpyinfo] which might
    not be installed, or guess that the obsolescent screen identifier for
    each display is ".0".

    Keith.


    On 19/08/2023 21:23, Keith Nash wrote:
    A new toplevel can be created on any available screen by using the
    option -screen, e.g.

    toplevel .foo -screen :1.0

    Other per-screen operations use the option -displayof $WindowPath
    to specify the screen.

    Is there any command that returns a list of available screens?

    Keith.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)