简体   繁体   English

xcb 初始 window position

[英]xcb Initial window position

I have a question regarding xcb windows.我有一个关于 xcb windows 的问题。 I am creating a xcb window using position and size.我正在使用 position 和大小创建一个 xcb window。 I get the following log messages, based on my implementation:根据我的实现,我收到以下日志消息:

create: x:560 y:300 width:800 height:600
map window:
XCB_CONFIGURE_NOTIFY: x:560 y:300 width:800 height:600
XCB_CONFIGURE_NOTIFY: x:90 y:77 width:800 height:600
XCB_CONFIGURE_NOTIFY: x:90 y:77 width:800 height:600

What I did我做了什么

  1. create window at specific position在特定的 position 创建 window
  2. map window map window
  3. event loop事件循环

there are three configure notify events.有三个配置通知事件。 the x/y position is relative to the parent window (parent is set to screen root and there is no reparent message because its a borderless window). x/y position 是相对于父 window 的(父设置为屏幕根并且没有 reparent 消息,因为它是无边框窗口)。 I do a xcb_translate_coordinates using window and root as parent.我使用 window 和 root 作为父级执行 xcb_translate_coordinates。 Why is the window moved to a different location?为什么 window 被移动到不同的位置?

I think it's because the window manager you're using stores the last position of the window before closing it and reestablish it when the application is re-launched and mapped onto the screen.我认为这是因为您使用的 window 管理器在关闭它之前存储了 window 的最后一个 position,并在应用程序重新启动并映射到屏幕时重新建立它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM