Skip to content

feat:add Kwin controller init - #43

Open
lava114514 wants to merge 3 commits into
MaaXYZ:mainfrom
lava114514:kwin
Open

feat:add Kwin controller init#43
lava114514 wants to merge 3 commits into
MaaXYZ:mainfrom
lava114514:kwin

Conversation

@lava114514

@lava114514 lava114514 commented Jul 14, 2026

Copy link
Copy Markdown

添加kwin控制器相关

由 Sourcery 提供的摘要

为兼容 KWin 的 Wayland 环境添加一个新的控制器实现,并通过框架绑定暴露其原生构造函数。

新功能:

  • 引入 NewKWinController,用于在支持 XDG Screencast Portal 和 uinput 的 Wayland 组合器上创建控制器。

改进:

  • 扩展原生框架绑定以包含 MaaKWinControllerCreate,并将其注册到框架入口列表中。
Original summary in English

Summary by Sourcery

Add a new controller implementation for KWin-compatible Wayland environments and expose its native constructor through the framework bindings.

New Features:

  • Introduce NewKWinController for creating controllers on Wayland compositors supporting the XDG Screencast Portal and uinput.

Enhancements:

  • Extend native framework bindings to include MaaKWinControllerCreate and register it in the framework entry list.

新功能:

  • 引入 NewKWinController 构造函数,用于创建面向 KWin Wayland 环境的控制器。

增强:

  • 扩展原生框架绑定以暴露 MaaKWinControllerCreate,并将其注册到框架入口列表中。
Original summary in English

由 Sourcery 提供的摘要

为兼容 KWin 的 Wayland 环境添加一个新的控制器实现,并通过框架绑定暴露其原生构造函数。

新功能:

  • 引入 NewKWinController,用于在支持 XDG Screencast Portal 和 uinput 的 Wayland 组合器上创建控制器。

改进:

  • 扩展原生框架绑定以包含 MaaKWinControllerCreate,并将其注册到框架入口列表中。
Original summary in English

Summary by Sourcery

Add a new controller implementation for KWin-compatible Wayland environments and expose its native constructor through the framework bindings.

New Features:

  • Introduce NewKWinController for creating controllers on Wayland compositors supporting the XDG Screencast Portal and uinput.

Enhancements:

  • Extend native framework bindings to include MaaKWinControllerCreate and register it in the framework entry list.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - 我在这里给出了一些整体性的反馈:

  • NewKWinController 的文档注释和函数之间隔着一个空行和额外注释;在 Go 中,导出的函数注释应该紧贴在对应的 func 声明上一行(例如,可以把参数说明合并进主文档注释,或者把参数说明移到函数下面)。
  • 建议将 NewKWinController 构造函数的报错信息和行为与现有的控制器构造函数(例如 NewWlRootsController)对齐,这样在控制器创建失败时,调用方能看到一致的错误文案和语义。
给 AI 代理的提示
Please address the comments from this code review:

## Overall Comments
- The doc comment for `NewKWinController` is separated from the function by a blank line and additional comments; in Go the exported function comment should be directly above the `func` line (e.g., collapse the parameter notes into the main doc comment or move them below the function).
- Consider aligning the `NewKWinController` constructor’s error message and behaviour with the existing controller constructors (e.g., `NewWlRootsController`) so callers see consistent error text and semantics when controller creation fails.

Sourcery 对开源项目是免费的——如果你觉得我们的代码审查有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的代码审查。
Original comment in English

Hey - I've left some high level feedback:

  • The doc comment for NewKWinController is separated from the function by a blank line and additional comments; in Go the exported function comment should be directly above the func line (e.g., collapse the parameter notes into the main doc comment or move them below the function).
  • Consider aligning the NewKWinController constructor’s error message and behaviour with the existing controller constructors (e.g., NewWlRootsController) so callers see consistent error text and semantics when controller creation fails.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The doc comment for `NewKWinController` is separated from the function by a blank line and additional comments; in Go the exported function comment should be directly above the `func` line (e.g., collapse the parameter notes into the main doc comment or move them below the function).
- Consider aligning the `NewKWinController` constructor’s error message and behaviour with the existing controller constructors (e.g., `NewWlRootsController`) so callers see consistent error text and semantics when controller creation fails.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@dongwlin

Copy link
Copy Markdown
Member

函数签名对不上喔

@lava114514
lava114514 marked this pull request as draft July 15, 2026 09:17
@dongwlin

Copy link
Copy Markdown
Member

Interception那个可以不用理会

@lava114514
lava114514 marked this pull request as ready for review July 16, 2026 15:22

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - 我已经审查了你的更改,看起来很棒!


Sourcery 对开源项目是免费的——如果你喜欢我们的审查,请考虑分享 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据这些反馈来改进为你提供的审查。
Original comment in English

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@dongwlin

Copy link
Copy Markdown
Member

但我挺好奇的,为什么kwin这边就没有用固定宽度类型,这对ffi好像不太合适吧。 @MistEO 看看

@dongwlin

Copy link
Copy Markdown
Member

但我挺好奇的,为什么kwin这边就没有用固定宽度类型,这对ffi好像不太合适吧。 @MistEO 看看

@MistEO 看看

@litwak913

Copy link
Copy Markdown
Contributor

@dongwlin 先暂时别合了,我在合并两个 Linux 控制器

MaaXYZ/MaaFramework#1406

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants