Skip to content

Commit f9cbb69

Browse files
authored
Use GTK compat function with WEBVIEW_HINT_FIXED (#1322)
gtk_widget_set_size_request() was called when WEBVIEW_HINT_FIXED was passed into webview_set_size(). That function is meant to set a minimum size. Instead we can call gtk_window_set_default_size() (GTK 4) or gtk_window_resize() (GTK 3).
1 parent 5c8ee40 commit f9cbb69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/include/webview/detail/backends/gtk_webkitgtk.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ protected:
182182

183183
noresult set_size_impl(int width, int height, webview_hint_t hints) override {
184184
gtk_window_set_resizable(GTK_WINDOW(m_window), hints != WEBVIEW_HINT_FIXED);
185-
if (hints == WEBVIEW_HINT_NONE) {
185+
if (hints == WEBVIEW_HINT_NONE || hints == WEBVIEW_HINT_FIXED) {
186186
gtk_compat::window_set_size(GTK_WINDOW(m_window), width, height);
187-
} else if (hints == WEBVIEW_HINT_FIXED || hints == WEBVIEW_HINT_MIN) {
187+
} else if (hints == WEBVIEW_HINT_MIN) {
188188
gtk_widget_set_size_request(m_window, width, height);
189189
} else if (hints == WEBVIEW_HINT_MAX) {
190190
gtk_compat::window_set_max_size(GTK_WINDOW(m_window), width, height);

0 commit comments

Comments
 (0)