如何使X11窗口跨越多个显示器 [英] How to make X11 window span multiple monitors

查看:360
本文介绍了如何使X11窗口跨越多个显示器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用XRes​​izeWindow()使一个窗口,将跨越2台显示器,但?窗口管理器?它被限制为一个。

有没有提示或财产,我可以与窗口告诉WM不是要限制其关联?

有关我的测试情况下,我有两个1600x1200分辨率的显示器,NVIDIA公司是presenting为一体3200x1200屏幕KDE4。 XDisplayWidth(显示,0);返回3200和XDisplayHeight(显示,0);返回1200。

当我打电话

  XCreateWindow(显示器,DefaultRootWindow(显示器),
              220,0,1700,930,
              1,[预设(显示屏幕),
              输入 - 输出,CopyFromParent,
              CWCursor,&安培;属性);

在220,0窗口1700x930我在0,0得到一个窗口1593x930,保持它完全在左侧显示器。任何XResizeWindow比被缩小到1593年大(我假设的7个像素的窗口装饰,这是很好的。)

但是,如果我再XMoveWindow(显示器,赢,800,0),它会移动窗口横跨屏幕,然后我可以放大至3200宽(上下浮动几个像素)。

有什么我可以做的,告诉窗口管理器,或谁是这样做的,不限制窗口,一台监视器,让我使用整个屏幕?

谢谢!

 %xrandr -q --verbose
xrandr:无法获取伽玛大小默认输出
画面0:最低3200 * 1200,目前3200 * 1200,最高3200 x 1200的
默认连接3200x1200 + 0 + 0(0x161)正常(正常)0毫米点¯x0毫米
    标识符:0x160
    时间戳:64409661
    亚像素:未知
    克隆:
    CRTC:0
    CRTCs:0
    变换:1.000000 0.000000 0.000000
                0.000000 1.000000 0.000000
                0.000000 0.000000 1.000000
               过滤:
3200x1200(0x161)192.0MHz *电流
    H:宽3200开始结束0 0 3200总歪斜0时钟60.0KHz
    五:高度1200开始结束0 0 1200总时钟值50.0Hz


解决方案

在一般情况下,一个应用程序不应该试图严格控制其窗口大小和位置,如WM应该是聪明,然后将窗户最好的时尚。如果你想反正控制,请尝试使用 XSizeHints 是这样的:

  XSizeHints SH;
sh.width = sh.min_width = 1700;
sh.height = sh.min_height = 930;
sh.h = 220;
sh.y = 0;
sh.flags = PSize | PMinSize | p位置;
XSetWMNormalHints(DPY,赢了,&安培; SH);
XMapWindow(DPY,赢);

仓库管理系统将尊重 MIN_WIDTH 并不会缩小窗口比这个小。

如果你需要一个全屏窗口跨越多个显示器,这是做不同,看到的这里

I'm trying to use XResizeWindow() to make a window which will span 2 monitors, but the ?window manager? is limiting it to one.

Is there a hint or property I can associate with the window to tell the WM not to limit it?

For my test case, I have two 1600x1200 monitors that nVidia is presenting as one 3200x1200 screen to KDE4. XDisplayWidth(display, 0); returns 3200 and XDisplayHeight(display, 0); returns 1200.

When I call

XCreateWindow(display, DefaultRootWindow(display),
              220, 0, 1700, 930,
              1, DefaultDepth(display,screen),
              InputOutput, CopyFromParent,
              CWCursor, &attributes);

for a window 1700x930 at 220,0 I get a window 1593x930 at 0,0, keeping it entirely on the left monitor. Any XResizeWindow larger than that gets shrunk to 1593. (I assume the 7 pixels are window decoration, which is fine.)

But, if I then XMoveWindow(display, win, 800, 0), it will move the window to span the screens, and I can then enlarge it up to 3200 wide (minus a few pixels).

Is there anything I can do to tell the window manager, or whoever is doing this, not to limit the window to a single monitor, and let me use the entire screen?

Thanks!

%xrandr -q --verbose
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 3200 x 1200, current 3200 x 1200, maximum 3200 x 1200
default connected 3200x1200+0+0 (0x161) normal (normal) 0mm x 0mm
    Identifier: 0x160
    Timestamp:  64409661
    Subpixel:   unknown
    Clones:    
    CRTC:       0
    CRTCs:      0
    Transform:  1.000000 0.000000 0.000000
                0.000000 1.000000 0.000000
                0.000000 0.000000 1.000000
               filter: 
3200x1200 (0x161)  192.0MHz *current
    h: width  3200 start    0 end    0 total 3200 skew    0 clock   60.0KHz
    v: height 1200 start    0 end    0 total 1200           clock   50.0Hz

解决方案

In general, an application should not try to rigidly control its window size and position, as WM is supposed to be smart and place the windows in the best possible fashion. If you want control anyway, try using XSizeHints like this:

XSizeHints sh;
sh.width = sh.min_width = 1700;
sh.height = sh.min_height = 930;
sh.h = 220;
sh.y = 0;
sh.flags = PSize | PMinSize | PPosition;
XSetWMNormalHints(dpy, win, &sh);
XMapWindow(dpy, win);

WMs will respect min_width and will not shrink the window smaller than this.

If you need a fullscreen window spanning multiple monitors, this is done differently, see here.

这篇关于如何使X11窗口跨越多个显示器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆