[WPE] WPE Platform: add window minimization to WPEToplevel#32021
Closed
siwei-li wants to merge 1 commit intoWebKit:mainfrom
Closed
[WPE] WPE Platform: add window minimization to WPEToplevel#32021siwei-li wants to merge 1 commit intoWebKit:mainfrom
siwei-li wants to merge 1 commit intoWebKit:mainfrom
Conversation
Collaborator
|
EWS run on previous version of this PR (hash 5e652a4) Details |
carlosgcampos
requested changes
Aug 12, 2024
Contributor
There was a problem hiding this comment.
Suggested change
| static void toplevelStateChangedCallback(WebKitWebView* view, WPEToplevelState previousState) | |
| static void toplevelStateChangedCallback(WPEView* view, WPEToplevelState previousState) |
Contributor
There was a problem hiding this comment.
We don't need this, the view we receive here is the WPEView
Contributor
There was a problem hiding this comment.
Suggested change
| webkitWebViewMonitorWindowState(WebKitWebView* view, WindowStateEvent::Type type, CompletionHandler<void()>&& completionHandler) | |
| monitorToplevelState(WPEView* view, TopevelStateEvent::Type type, CompletionHandler<void()>&& completionHandler) |
Contributor
There was a problem hiding this comment.
Suggested change
| static const char* windowStateEventID = "wpe-toplevel-state-event"; | |
| static const char* toplevelStateEventID = "wpe-toplevel-state-event"; |
Contributor
There was a problem hiding this comment.
Suggested change
| struct WindowStateEvent { | |
| struct ToplevelStateEvent { |
Contributor
There was a problem hiding this comment.
Let's use Toplevel instead of Window everywhere, since it better matches the WPE API name
Contributor
There was a problem hiding this comment.
Suggested change
| g_signal_connect_object(view, "toplevel-state-changed", G_CALLBACK(toplevelStateChangedCallback), nullptr, G_CONNECT_AFTER); | |
| g_signal_connect_after(view, "toplevel-state-changed", G_CALLBACK(toplevelStateChangedCallback), nullptr); |
Comment on lines
137
to
140
Contributor
There was a problem hiding this comment.
Suggested change
| if (!wpe_toplevel_maximize(toplevel)) { | |
| completionHandler(); | |
| return; | |
| } | |
| if (wpe_toplevel_maximize(toplevel)) { | |
| return; | |
| } |
Contributor
There was a problem hiding this comment.
And then remove this return.
Comment on lines
159
to
164
Comment on lines
183
to
185
Contributor
There was a problem hiding this comment.
Suggested change
| if (wpe_toplevel_get_state(toplevel) & WPE_TOPLEVEL_STATE_MAXIMIZED) | |
| wpe_toplevel_unmaximize(toplevel); | |
| return; | |
| if ((wpe_toplevel_get_state(toplevel) & WPE_TOPLEVEL_STATE_MAXIMIZED) && wpe_toplevel_unmaximize(toplevel)) | |
| return; |
https://bugs.webkit.org/show_bug.cgi?id=276905 Reviewed by NOBODY (OOPS!). Add toplevel minimization support to the webdriver. Wayland compositor does not notify when the minimization actually happens, hence we only ask the toplevel to be minimized. * Source/WebKit/UIProcess/API/wpe/WebKitWebViewWPE.cpp: (WindowStateEvent::WindowStateEvent): (WindowStateEvent::~WindowStateEvent): (WindowStateEvent::complete): (toplevelStateChangedCallback): (webkitWebViewMonitorWindowState): (webkitWebViewMaximizeWindow): (webkitWebViewMinimizeWindow): (webkitWebViewRestoreWindow):
5e652a4 to
0acefe3
Compare
Collaborator
|
EWS run on current version of this PR (hash 0acefe3) Details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
0acefe3
0acefe3