|
1 | | ---- electron/shell/browser/native_window_views.cc.orig 2025-05-07 07:36:13 UTC |
| 1 | +--- electron/shell/browser/native_window_views.cc.orig 2025-05-12 02:18:43 UTC |
2 | 2 | +++ electron/shell/browser/native_window_views.cc |
3 | | -@@ -50,7 +50,7 @@ |
| 3 | +@@ -51,7 +51,7 @@ |
4 | 4 | #include "ui/wm/core/shadow_types.h" |
5 | 5 | #include "ui/wm/core/window_util.h" |
6 | 6 |
|
|
9 | 9 | #include "base/strings/string_util.h" |
10 | 10 | #include "shell/browser/browser.h" |
11 | 11 | #include "shell/browser/linux/unity_service.h" |
12 | | -@@ -294,7 +294,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper: |
| 12 | +@@ -295,7 +295,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper: |
13 | 13 | params.parent = parent->GetNativeWindow(); |
14 | 14 |
|
15 | 15 | params.native_widget = new ElectronDesktopNativeWidgetAura(this); |
|
18 | 18 | std::string name = Browser::Get()->GetName(); |
19 | 19 | // Set WM_WINDOW_ROLE. |
20 | 20 | params.wm_role_name = "browser-window"; |
21 | | -@@ -319,7 +319,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper: |
| 21 | +@@ -320,7 +320,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper: |
22 | 22 | std::string window_type; |
23 | 23 | options.Get(options::kType, &window_type); |
24 | 24 |
|
|
27 | 27 | // Set _GTK_THEME_VARIANT to dark if we have "dark-theme" option set. |
28 | 28 | if (options.ValueOrDefault(options::kDarkTheme, false)) |
29 | 29 | SetGTKDarkThemeEnabled(true); |
30 | | -@@ -426,7 +426,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper: |
| 30 | +@@ -427,7 +427,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper: |
31 | 31 | if (window) |
32 | 32 | window->AddPreTargetHandler(this); |
33 | 33 |
|
|
36 | 36 | // On linux after the widget is initialized we might have to force set the |
37 | 37 | // bounds if the bounds are smaller than the current display |
38 | 38 | SetBounds(gfx::Rect(GetPosition(), bounds.size()), false); |
39 | | -@@ -462,7 +462,7 @@ void NativeWindowViews::SetGTKDarkThemeEnabled(bool us |
| 39 | +@@ -463,7 +463,7 @@ void NativeWindowViews::SetGTKDarkThemeEnabled(bool us |
40 | 40 | } |
41 | 41 |
|
42 | 42 | void NativeWindowViews::SetGTKDarkThemeEnabled(bool use_dark_theme) { |
|
108 | 108 | auto display = |
109 | 109 | display::Screen::GetScreen()->GetDisplayNearestWindow(GetNativeWindow()); |
110 | 110 | gfx::Rect window_bounds_in_screen = display.work_area(); |
111 | | -@@ -1361,7 +1361,7 @@ void NativeWindowViews::SetMenu(ElectronMenuModel* men |
| 111 | +@@ -1362,7 +1362,7 @@ void NativeWindowViews::SetMenu(ElectronMenuModel* men |
112 | 112 | } |
113 | 113 |
|
114 | 114 | void NativeWindowViews::SetMenu(ElectronMenuModel* menu_model) { |
|
117 | 117 | // Remove global menu bar. |
118 | 118 | if (global_menu_bar_ && menu_model == nullptr) { |
119 | 119 | global_menu_bar_.reset(); |
120 | | -@@ -1416,7 +1416,7 @@ void NativeWindowViews::SetParentWindow(NativeWindow* |
| 120 | +@@ -1417,7 +1417,7 @@ void NativeWindowViews::SetParentWindow(NativeWindow* |
121 | 121 | void NativeWindowViews::SetParentWindow(NativeWindow* parent) { |
122 | 122 | NativeWindow::SetParentWindow(parent); |
123 | 123 |
|
|
126 | 126 | if (IsX11()) { |
127 | 127 | auto* connection = x11::Connection::Get(); |
128 | 128 | connection->SetProperty( |
129 | | -@@ -1462,7 +1462,7 @@ void NativeWindowViews::SetProgressBar(double progress |
| 129 | +@@ -1463,7 +1463,7 @@ void NativeWindowViews::SetProgressBar(double progress |
130 | 130 | NativeWindow::ProgressState state) { |
131 | 131 | #if BUILDFLAG(IS_WIN) |
132 | 132 | taskbar_host_.SetProgressBar(GetAcceleratedWidget(), progress, state); |
|
135 | 135 | if (unity::IsRunning()) { |
136 | 136 | unity::SetProgressFraction(progress); |
137 | 137 | } |
138 | | -@@ -1556,7 +1556,7 @@ bool NativeWindowViews::IsVisibleOnAllWorkspaces() con |
| 138 | +@@ -1557,7 +1557,7 @@ bool NativeWindowViews::IsVisibleOnAllWorkspaces() con |
139 | 139 | if (const auto* view_native_widget = widget()->native_widget_private()) |
140 | 140 | return view_native_widget->IsVisibleOnAllWorkspaces(); |
141 | 141 |
|
|
144 | 144 | if (IsX11()) { |
145 | 145 | // Use the presence/absence of _NET_WM_STATE_STICKY in _NET_WM_STATE to |
146 | 146 | // determine whether the current window is visible on all workspaces. |
147 | | -@@ -1579,7 +1579,7 @@ content::DesktopMediaID NativeWindowViews::GetDesktopM |
| 147 | +@@ -1580,7 +1580,7 @@ content::DesktopMediaID NativeWindowViews::GetDesktopM |
148 | 148 | #if BUILDFLAG(IS_WIN) |
149 | 149 | window_handle = |
150 | 150 | reinterpret_cast<content::DesktopMediaID::Id>(accelerated_widget); |
|
153 | 153 | window_handle = static_cast<uint32_t>(accelerated_widget); |
154 | 154 | #endif |
155 | 155 | aura::WindowTreeHost* const host = |
156 | | -@@ -1677,7 +1677,7 @@ void NativeWindowViews::SetIcon(HICON window_icon, HIC |
| 156 | +@@ -1678,7 +1678,7 @@ void NativeWindowViews::SetIcon(HICON window_icon, HIC |
157 | 157 | SendMessage(hwnd, WM_SETICON, ICON_BIG, |
158 | 158 | reinterpret_cast<LPARAM>(app_icon_.get())); |
159 | 159 | } |
|
162 | 162 | void NativeWindowViews::SetIcon(const gfx::ImageSkia& icon) { |
163 | 163 | auto* tree_host = views::DesktopWindowTreeHostLinux::GetHostForWidget( |
164 | 164 | GetAcceleratedWidget()); |
165 | | -@@ -1773,7 +1773,7 @@ bool NativeWindowViews::CanMinimize() const { |
| 165 | +@@ -1774,7 +1774,7 @@ bool NativeWindowViews::CanMinimize() const { |
166 | 166 | bool NativeWindowViews::CanMinimize() const { |
167 | 167 | #if BUILDFLAG(IS_WIN) |
168 | 168 | return minimizable_; |
|
171 | 171 | return true; |
172 | 172 | #endif |
173 | 173 | } |
174 | | -@@ -1829,7 +1829,7 @@ void NativeWindowViews::HandleKeyboardEvent( |
| 174 | +@@ -1830,7 +1830,7 @@ void NativeWindowViews::HandleKeyboardEvent( |
175 | 175 | if (widget_destroyed_) |
176 | 176 | return; |
177 | 177 |
|
|
180 | 180 | if (event.windows_key_code == ui::VKEY_BROWSER_BACK) |
181 | 181 | NotifyWindowExecuteAppCommand(kBrowserBackward); |
182 | 182 | else if (event.windows_key_code == ui::VKEY_BROWSER_FORWARD) |
183 | | -@@ -1848,7 +1848,7 @@ void NativeWindowViews::OnMouseEvent(ui::MouseEvent* e |
| 183 | +@@ -1849,7 +1849,7 @@ void NativeWindowViews::OnMouseEvent(ui::MouseEvent* e |
184 | 184 | // Alt+Click should not toggle menu bar. |
185 | 185 | root_view_.ResetAltState(); |
186 | 186 |
|
|
0 commit comments