Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with "Lua Script" after upgrade (GTK 3) #690

Open
lingvoboard opened this issue Feb 9, 2018 · 11 comments
Open

Problem with "Lua Script" after upgrade (GTK 3) #690

lingvoboard opened this issue Feb 9, 2018 · 11 comments

Comments

@lingvoboard
Copy link

lingvoboard commented Feb 9, 2018

Before upgrade

Geany 1.32, GTK 2.24.32, GLib 2.54.3
geany-1.32.0-1-x86_64.pkg.tar.xz, geany-plugins-1.32-2-x86_64.pkg.tar.xz
Arch Linux, Theme: BlueMenta

Plugin "Lua Script"
geany.choose("Snippets:", {"bla", "bla", "bla"})
http://geany-plugins.sourceforge.net/geanylua/geanylua-ref.html#choose

Screenshot1:

After upgrade

Geany 1.32, GTK 3.22.26, GLib 2.54.3
geany-1.32.0-2-x86_64.pkg.tar.xz, geany-plugins-1.32-4-x86_64.pkg.tar.xz

Screenshot2:

@codebrainz
Copy link
Member

GTK+ 3.22 broke all themes again, try an up to date theme like Adwaita or other popular one that has been fixed since.

@Skif-off
Copy link
Contributor

Skif-off commented Nov 7, 2020

GTK2 vs. GTK3:
geany choose
Xubuntu 20.04, Geany 1.37, GTK 3.24.20, GLib 2.64.3.

Is this the same problem? I tried Adwaita, Greybird (my default theme), Numix, but with the same result. Is this exactly a theme problem?
Maybe someone know, how to fix it?

@b4n
Copy link
Member

b4n commented Nov 7, 2020

Doesn't look like a theme problem from @Skif-off's screenshots (I can't see the first one from the OP BTW), looks like incorrect widget packing with GTK3's defaults.

@b4n
Copy link
Member

b4n commented Nov 7, 2020

@Skif-off try:

diff --git a/geanylua/glspi_dlg.c b/geanylua/glspi_dlg.c
index f0553853..c7d9718a 100644
--- a/geanylua/glspi_dlg.c
+++ b/geanylua/glspi_dlg.c
@@ -163,10 +163,14 @@ static gint glspi_choose(lua_State* L)
 	scroll=gtk_scrolled_window_new(NULL, NULL);
 	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
 		GTK_POLICY_AUTOMATIC,  GTK_POLICY_AUTOMATIC);
+	gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_IN);
 	gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),scroll);
+#if GTK_CHECK_VERSION(3, 0, 0)
+	gtk_widget_set_vexpand(scroll, TRUE);
+#endif
 	gtk_container_add(GTK_CONTAINER(scroll),tree);
 
-	gtk_widget_set_size_request(tree, 320, 240);
+	gtk_widget_set_size_request(scroll, 320, 240);
 	gtk_widget_show_all(dialog);
 	gtk_window_set_resizable(GTK_WINDOW(dialog), TRUE);
 

(the shadow type is just me not liking the borderless scrolled view when there is no other widgets making a border)

However, I don't understand why you see a "missing image" image under GTK3.

@Skif-off
Copy link
Contributor

Skif-off commented Nov 8, 2020

@b4n , thanks, looks better:
2020-11-08_14-40-13

However, I don't understand why you see a "missing image" image under GTK3.

Maybe problem here: GTK_MESSAGE_OTHER (without icon) replaced by GTK_MESSAGE_INFO (with icon)?

@b4n
Copy link
Member

b4n commented Nov 8, 2020

Maybe problem here: GTK_MESSAGE_OTHER (without icon) replaced by GTK_MESSAGE_INFO (with icon)?

Well, IIUC that just aliases GTK_MESSAGE_OTHER to GTK_MESSAGE_INFO on GTK < 2.10 (presumably because GTK_MESSAGE_OTHER is new in 2.10 or something like that?). Should not affect GTK 2.24 vs 3.x AFAICT.

@Skif-off
Copy link
Contributor

Skif-off commented Nov 8, 2020

What OS are you using? If it Debian or any non Ubuntu-based distribution then maybe this problem was born here https://salsa.debian.org/gnome-team/gtk3/-/tree/ubuntu/focal/debian/patches ?

Rebuilding for all GTK 3 packages only with patchs from Debian will stay last way of checking :)

@b4n
Copy link
Member

b4n commented Nov 8, 2020

I'm on Debian Buster :) I'm not totally sure which dialog you're showing, but for me e.g. the dialog examples and a couple other that display this kind of dialogs all come without an image at all.

@Skif-off
Copy link
Contributor

Skif-off commented Nov 9, 2020

I think message-dialog-restore-traditional-look-on-unity.patch creates a problem, because only this patch contains the words GtkMessageDialog, GtkWidget, icon and image. (By the way this bug exists in geany.input()'s window too.)

@b4n, will you add your patch to upstream?

@Skif-off
Copy link
Contributor

Win10, 1.37 GTK2 vs. 1.38 GTK3:
gtk2vs3
Simple script:

geany.choose('Test:', {"one", "two", "three"})

Xubuntu, GTK3 with vs. without @b4n 's patch:
w/w

@johnraff
Copy link

This patch: #690 (comment) worked for me on Debian Bullseye. (I had to remove the two commented lines to get it to build.)
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants