fix(electrobun): clear min-size in configure handler during resize (prevents GTK bounce-back)

This commit is contained in:
Hibryda 2026-03-25 18:06:06 +01:00
parent 6d0a65eb65
commit 8f4ec379ee
2 changed files with 7 additions and 4 deletions

View file

@ -175,11 +175,14 @@ static gboolean reenable_webview(gpointer data)
*/
static gboolean on_configure(GtkWidget *widget, GdkEventConfigure *event, gpointer data)
{
fprintf(stderr, "[agor-resize] CONFIGURE size=%dx%d pos=%d,%d\n",
event->width, event->height, event->x, event->y);
/* If resize is active, reset the re-enable timer */
if (resize_active) {
/* CRITICAL: During active resize, re-clear min-size on EVERY configure.
* GTK's layout cycle re-asserts the WebView's preferred size after each
* WM resize step, sending a conflicting ConfigureRequest that cancels the drag. */
clear_min_size(GTK_WIDGET(stored_window), 0);
GdkGeometry geom = { .min_width = 400, .min_height = 300, .max_width = 32767, .max_height = 32767 };
gtk_window_set_geometry_hints(stored_window, NULL, &geom, GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE);
if (reenable_timer_id) g_source_remove(reenable_timer_id);
reenable_timer_id = g_timeout_add(500, reenable_webview, NULL);
}

Binary file not shown.