Skip to content

Conversation

@Wing-summer
Copy link

相关讨论为 #202 ,本 PR 提交实现的功能和修复说明:

对于 X11 和 wayland 库采用懒加载解析模式,方便解耦和降低复杂依赖

  • 为 Linux 的基于 X11 桌面提供系统右键菜单支持(已修复鼠标在高分辨屏幕点击菜单位置不对问题)
  • 为 Linux 的基于 wayland 的桌面提供系统右键菜单弹出支持
  • 若为基于其他协议的,回退,不支持系统右键菜单弹出支持
  • 修复鼠标在非标题栏位置点击弹出右键菜单的问题
  • 修复 m_hitTestVisibleItems 的 for-range 循环警告

注意事项:

  1. 对于 Linux X11,系统右键菜单弹出支持需要 DE 支持_GTK_SHOW_WINDOW_MENU,如果不支持则无效
  2. 对于 Linux Wayland,系统右键菜单弹出支持需要 DE 支持xdg_toplevel以及XDG_TOPLEVEL_SHOW_WINDOW_MENU,如果不支持则无效

测试:

该补丁在 Qt6.10.1 + KDE 测试通过,其他 Qt 版本和 Linux 桌面可能需要仓库拥有者以及主要维护者的测试。

Copy link
Collaborator

@wangwenx190 wangwenx190 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码没有大问题,但有些小细节可能需要注意下

@wangwenx190
Copy link
Collaborator

该补丁在 Qt6.10.1 + KDE 测试通过,其他 Qt 版本和 Linux 桌面可能需要仓库拥有者以及主要维护者的测试。

感谢,能支持最新版本就挺好了,我们会在稍微老一点的版本上测试一下。最主要的问题应该是此版代码不支持qt5,不过qwk在Linux上是否需要支持qt5本身也是有待商榷。

Copy link
Collaborator

@wangwenx190 wangwenx190 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

辛苦了,感谢!还是有些细节有待商榷

@Wing-summer
Copy link
Author

麻烦老哥了,我又重新修改整成一个提交了,有时间再审查一下。那个协议版权声明顺序错的范围有点太大了,我不想改了,我只改动了我 PR 涉及的部分。

Copy link
Collaborator

@wangwenx190 wangwenx190 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

真是辛苦你了,只有一处小问题了

@wangwenx190
Copy link
Collaborator

麻烦老哥了,我又重新修改整成一个提交了,有时间再审查一下。那个协议版权声明顺序错的范围有点太大了,我不想改了,我只改动了我 PR 涉及的部分。

没问题的,辛苦了,其他没有涉及的文件确实不必改,否则这个PR的内容就有些不明确了

@wangwenx190 wangwenx190 self-assigned this Dec 4, 2025
@wangwenx190 wangwenx190 added the enhancement New feature or request label Dec 4, 2025
@wangwenx190
Copy link
Collaborator

辛苦了,我认为没什么问题了。我让另一位维护者也看一下 @SineStriker

Copy link
Collaborator

@wangwenx190 wangwenx190 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. +2

@SineStriker
Copy link
Contributor

直接引 x11 和 wayland 的头文件应该就不需要定义这些结构了吧,在 xlibint 里有。

@SineStriker
Copy link
Contributor

linuxdesktopenvapi.h 最好不要有这个文件,能不能写到 qwindowkit_linux.h 里去,目前这个文件还是空的。

@Wing-summer
Copy link
Author

直接引 x11 和 wayland 的头文件应该就不需要定义这些结构了吧,在 xlibint 里有。

xlib 在以后 Wayland 为唯一桌面环境的时候,可能不会存在。如果直接引用头文件,这就要求用户需要安装对应的包。里面用的结构体也不算太多,而且 x11 已经可以说稳定了,应该不会有结构体上的改动。

对于 Wayland 来说, qt 提供的前置声明就够用了,相关函数也只是用到了一些结构体指针和宏定义的枚举。

@Wing-summer
Copy link
Author

linuxdesktopenvapi.h 最好不要有这个文件,能不能写到 qwindowkit_linux.h 里去,目前这个文件还是空的。

这个没问题,今晚我可以仿照 Windows 写的方式写一下。

@Wing-summer
Copy link
Author

linuxdesktopenvapi.h 最好不要有这个文件,能不能写到 qwindowkit_linux.h 里去,目前这个文件还是空的。

你好,linuxdesktopenvapi 相关的内容已移动到 qwindowkit_linux 相关的内容,麻烦再看看有没有其他问题。

@wangwenx190
Copy link
Collaborator

我认为没什么问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants