#150 Select screen when using multihead X

open
nobody
None
5
2012-11-29
2010-08-27
Martin
No

Hello!

When using a multihead setup I want to be able to select a single physical screen which rdesktop shall use. Currently I may either specify the windows resolution and move the window manually or use the entire workarea. I want to be able to tell rdesktop "use <screen>" and not think about positions and sizes and decorations and such.

I already wrote some code and I'm attaching it to this ticket. I named it pscreen b/c it's about selecting a Physical screen. If configured with ---with-pscreen rdesktop accepts a new option -o. "rdesktop -o list" will display a list of active outputs, their resolutions (actually the resolution of the associated pixel pipeline) and it's position in the logical X screen. For example my Laptop gives me:
Available pscreens:
LVDS1 resolution: 1280x800, offset: 1600+0
DVI1 resolution: 1600x1200, offset: 0+0
Since 0x0 is the upper left corner of the logical screen, this output means my laptop is to the right of my external screen. I can tell rdesktop to use either screen by supplying -o <output name> on the command line. In this case
-o LVDS1
will make rdesktop use my laptop screen "fullscreen"
-o DVI1
will make rdesktop use my external screen "fullscreen"
The resulting rdesktop window has no borders and decorations. It will simply (try to) fill the entire screen.

I put my code into pscreen.c but there are some hooks and minor changes in rdesktop.c, xwin.c, proto.h, Makefile.in, configure.ac.

This was my first time ever using xlib so my code may have certain issues. It was rather tricky to force the window's position without telling X to "override_redirect". There are propably neater ways to achieve this and there may be redundant code as well.

I hope this helps others.

Discussion

  • Martin
    Martin
    2010-08-27