[nautilus/wip/oholy/compress-dialog-x11] compress-dialog-controller: Really fix the cropped popover on X11
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/oholy/compress-dialog-x11] compress-dialog-controller: Really fix the cropped popover on X11
- Date: Tue, 9 Aug 2022 14:02:02 +0000 (UTC)
commit 747b7ab81bcbadbcf98011f36fee75cfbf369626
Author: Ondrej Holy <oholy redhat com>
Date: Tue Aug 9 15:45:15 2022 +0200
compress-dialog-controller: Really fix the cropped popover on X11
The commit 441124c tried to fix the cropped popover on X11 with twice the
height window. This is still not enough with some translations, or when the
larger font is used. Let's resize the window using the preferred popover
size to avoid those issues.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2018
src/nautilus-compress-dialog-controller.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/nautilus-compress-dialog-controller.c b/src/nautilus-compress-dialog-controller.c
index 6c5b6964c..be31bf1fe 100644
--- a/src/nautilus-compress-dialog-controller.c
+++ b/src/nautilus-compress-dialog-controller.c
@@ -400,13 +400,20 @@ popover_on_show (GtkWidget *widget,
}
#ifdef GDK_WINDOWING_X11
+ /* Workaround for https://gitlab.gnome.org/GNOME/nautilus/-/issues/2018 */
if (GDK_IS_X11_DISPLAY (gdk_display_get_default ()))
{
- int w, h;
+ GtkWidget *vbox;
+ int w, h, y;
- /* Workaround for https://gitlab.gnome.org/GNOME/nautilus/-/issues/2018 */
- gtk_window_get_default_size (GTK_WINDOW (self->compress_dialog), &w, &h);
- gtk_window_resize (GTK_WINDOW (self->compress_dialog), w, h * 2);
+ /* The vbox child is used instead of the dialog itself to get size
+ without the title bar, client side decorations etc. */
+ vbox = gtk_bin_get_child (GTK_BIN (self->compress_dialog));
+ gtk_widget_translate_coordinates (widget, vbox, 0, gtk_widget_get_margin_top (vbox), NULL, &y);
+
+ gtk_widget_get_preferred_width (widget, NULL, &w);
+ gtk_widget_get_preferred_height (widget, NULL, &h);
+ gtk_window_resize (GTK_WINDOW (self->compress_dialog), w, y + h);
}
#endif
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]