-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[V3-Linux] Fix linux compile and systray OnClicks #3886
base: v3-alpha
Are you sure you want to change the base?
Conversation
WalkthroughThe pull request introduces several significant updates to the project, including new features such as documentation for events, SvelteKit templates, and commands for updating build assets and generating runtime. It also adds options for window positioning and file associations. Modifications include a refactor of the Taskfile, upgrades to dependencies, and various bug fixes across platforms. The changes aim to enhance functionality and user interaction, particularly in the system tray and window management. Changes
Possibly related PRs
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
v3/pkg/application/webview_window_linux.go (1)
Line range hint
442-444
: Critical: Fix incorrect mouse event ignore stateThe
setIgnoreMouseEvents
method is using the current state instead of the new state, which prevents the ignore state from being updated correctly.Apply this fix:
func (w *linuxWebviewWindow) setIgnoreMouseEvents(ignore bool) { - w.ignoreMouse(w.ignoreMouseEvents) + w.ignoreMouseEvents = ignore + w.ignoreMouse(ignore) }mkdocs-website/docs/en/changelog.md (1)
41-41
: Consider expanding the changelog entry with implementation details.While the entry correctly documents the fix, it could be more informative by mentioning:
- The specific Linux systray click events implemented (single click, double click, and middle click)
- The compilation issue that was resolved
Suggested expansion:
- Fixed Linux systray `OnClick` and `OnRightClick` implementation by @atterpac in [#3886](https://github.com/wailsapp/wails/pull/3886) + Fixed Linux systray click events and compilation issues by @atterpac in [#3886](https://github.com/wailsapp/wails/pull/3886): + - Implemented `OnClick` support for single and double clicks + - Implemented `OnRightClick` support for middle mouse clicks + - Fixed Linux webview compilation errors from recent merge
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (3)
mkdocs-website/docs/en/changelog.md
(1 hunks)v3/pkg/application/systemtray_linux.go
(2 hunks)v3/pkg/application/webview_window_linux.go
(1 hunks)
🔇 Additional comments (4)
v3/pkg/application/webview_window_linux.go (2)
299-301
: LGTM: Window positioning logic is well-implemented
The window positioning logic correctly handles both centered and custom positions using the parent window options.
Line range hint 1-1
: Verify systray implementation files
The PR objectives mention systray OnClick functionality changes, but this file only contains window management code. We should verify the systray implementation.
✅ Verification successful
Let me gather more context about the systray implementation to verify the changes.
Systray click handlers are properly implemented across platforms
The changes in systemtray_linux.go
correctly implement the systray click handlers by calling the parent's clickHandler
and rightClickHandler
functions, which are defined in the base SystemTray
struct. The implementation aligns with the PR's objectives:
- The base
SystemTray
struct insystemtray.go
defines the click handler functions - Linux implementation now properly calls these handlers in
Activate
andSecondaryActivate
methods - The changes replace debug print statements with actual handler invocations
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for systray-related files in the Linux implementation
echo "Searching for systray-related files..."
rg -l "systray|tray|OnClick|OnRightClick" --type go
# Search for recent changes to systray files
echo "Checking recent changes to systray files..."
git log -p --since="1 week ago" -- "*systray*.go" "*tray*.go"
Length of output: 2716
Script:
#!/bin/bash
# Check the systemtray.go file for click handler definitions
echo "Checking systemtray.go for click handlers..."
rg -A 5 "clickHandler|rightClickHandler" v3/pkg/application/systemtray.go
# Check other platform implementations
echo -e "\nChecking Windows implementation..."
rg -A 5 "OnClick|OnRightClick" v3/pkg/application/systemtray_windows.go
echo -e "\nChecking Darwin implementation..."
rg -A 5 "OnClick|OnRightClick" v3/pkg/application/systemtray_darwin.go
Length of output: 1097
v3/pkg/application/systemtray_linux.go (2)
701-701
: LGTM: Proper implementation of systray click handler
The change correctly implements the systray click handler by invoking the parent's clickHandler method instead of just printing coordinates. This aligns with the PR objective to fix systray OnClick functionality.
718-718
: LGTM: Proper implementation of systray right-click handler
The change correctly implements the systray right-click handler by invoking the parent's rightClickHandler method. This aligns with the PR objective to implement systray OnRightClick functionality.
A recent merge added some broken code to the linux webview implementation, this PR corrects that to properly compile linux
Adds the implementation for OnClick and OnRightClick for Linux systray
OnClick may be a single click or a double click / OnRightClick is typically a middle mouse click it varies OS to OS and depending on DE
See very long thread for more information on that sauce
Summary by CodeRabbit
New Features
InitialPosition
option.Bug Fixes
Improvements
go-webview2
library.