如何在 XWindows 中获取装饰窗口的内部尺寸?

发布于 2024-08-02 02:11:50 字数 372 浏览 3 评论 0原文

如果我创建一个全屏窗口,其中 m_winwm_winh 是全屏尺寸,那么它似乎为我创建了一个窗口,其中外部尺寸是全屏,内部尺寸是根据“装饰”(窗口边框)尺寸较小。 有没有办法查询窗口以获取其内部宽度和高度?

m_win=XCreateWindow(m_display, m_rootwin, m_winx, m_winy, m_winw, m_winh, 0, 
CopyFromParent,CopyFromParent,m_visual,CWColormap|CWEventMask,&attributes);

这是在linux上的。

If I create a full screen window where m_winw and m_winh is the full screen size, it seems to create a window for me where the outside dimension is the full screen and the inside is smaller based on the "decoration" (window border) size. Is there a way to query the window to get it's inside width and height?

m_win=XCreateWindow(m_display, m_rootwin, m_winx, m_winy, m_winw, m_winh, 0, 
CopyFromParent,CopyFromParent,m_visual,CWColormap|CWEventMask,&attributes);

This is on linux.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

盗梦空间 2024-08-09 02:11:50

请参阅 XGetWindowAttributes、XGetGeometry。 根据手册页:

宽度和高度成员设置为窗口的内部尺寸,不包括边框。

See XGetWindowAttributes, XGetGeometry. According to the man page:

The width and height members are set tothe inside size of the window, not including the border.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文