Commit 1a3b36a3 authored by Benoît Minisini's avatar Benoît Minisini
Browse files

Fix csd size computation.

[GB.GTK]
* BUG: Fix csd size computation.

[GB.GTK3]
* BUG: Fix csd size computation.
parent a33b3121
Pipeline #370594955 passed with stage
in 26 minutes and 32 seconds
......@@ -644,7 +644,7 @@ int gControl::screenY()
return pr->screenY() + y() + pr->clientY() - pr->scrollY();
}
static void send_configure (gControl *control)
static void send_configure(gControl *control)
{
GtkWidget *widget;
GdkEvent *event;
......
......@@ -235,6 +235,10 @@ static gboolean cb_configure(GtkWidget *widget, GdkEventConfigure *event, gMainW
data->bufW = event->width - data->_csd_w;
data->bufH = event->height - data->_csd_h;
#ifdef DEBUG_RESIZE
fprintf(stderr, "-> %d %d\n", data->bufW, data->bufH);
#endif
data->emitResize();
......@@ -2055,17 +2059,18 @@ void gMainWindow::calcCsdSize()
}
gtk_widget_get_allocation(border, &ba);
gtk_widget_get_allocation(frame, &wa);
if (wa.width == 1 && wa.height == 1)
if (ba.width <= 1 && ba.height <= 1)
return;
//fprintf(stderr, "border: %d %d layout: %d %d\n", ba.width, ba.height, wa.width, wa.height);
gtk_widget_get_allocation(frame, &wa);
if (wa.width <= 1 && wa.height <= 1)
return;
_csd_w = ba.width - wa.width;
_csd_h = ba.height - wa.height;
#ifdef DEBUG_RESIZE
fprintf(stderr, "calcCsdSize: %s: csd = %d %d\n", name(), _csd_w, _csd_h);
fprintf(stderr, "calcCsdSize: border: %d %d layout: %d %d\n", ba.width, ba.height, wa.width, wa.height);
fprintf(stderr, "calcCsdSize: --> %s: csd = %d %d\n", name(), _csd_w, _csd_h);
#endif
if (!isResizable())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment