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

edit_box not working (walkabout) #217

Closed
Dassadar opened this issue Mar 6, 2016 · 23 comments
Closed

edit_box not working (walkabout) #217

Dassadar opened this issue Mar 6, 2016 · 23 comments
Milestone

Comments

@Dassadar
Copy link

Dassadar commented Mar 6, 2016

Hello,

I have an issue with edit_box which are not displaying.

For example, here is the result for simple-control-sizes.rb sample:
0ab6ec59

I am on Ubuntu 15.10, and my Shoes build is 3.3.0 r2333.

Can you please help?

Thx in advance,
David

@ccoupe
Copy link

ccoupe commented Mar 6, 2016

Note the previous conversation is here. shoes/shoes-deprecated#282 This seems to be something very strange on David's system. I can't think of any way for Shoes to not have edit_boxes.

You could try the 3.3.1 beta -
http://walkabout.mvmanila.com/public/shoes/shoes-3.3.1-gtk3-x86_64.install
It will replace your existing 3.3.0 but that's probably not a loss for you considering.

@Dassadar
Copy link
Author

Dassadar commented Mar 6, 2016

Not a loss, but not a gain either: I get the exact same faulty display... :-/

@ccoupe
Copy link

ccoupe commented Mar 6, 2016

Which version of 15.10 are you using (there are many). I'll have to put in a VM and see if I can recreate your problem. That takes time so I don't want to pick an Ubuntu that isn't the same as yours.

@passenger94
Copy link
Contributor

works for me (ubuntu 14.04) !
very strange ??

@ccoupe
Copy link

ccoupe commented Mar 6, 2016

I really can't think of how this could happen. I don't think you can disable multi line text boxes unless there is some very odd theming going on and that would break other apps, not just Shoes. He's not getting messages on the launch terminal or in Shoes console. How could this happen?

@passenger94
Copy link
Contributor

it's ok on win7 also !
Also tested with your version you linked, all fine !
head scratching ....

@ccoupe
Copy link

ccoupe commented Mar 7, 2016

Since shoes uses the systems Gtk3, It might be useful to know what @Dassadar gtk lib is. For instance : on my 14.04 system

$ ls -ld /usr/lib/x86_64-linux-gnu/libgtk-3*
drwxr-xr-x 2 root root    4096 Sep  4  2015 /usr/lib/x86_64-linux-gnu/libgtk-3-0
lrwxrwxrwx 1 root root      20 Jun 30  2015 /usr/lib/x86_64-linux-gnu/libgtk-3.so -> libgtk-3.so.0.1000.8
lrwxrwxrwx 1 root root      20 Jun 30  2015 /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 -> libgtk-3.so.0.1000.8
-rw-r--r-- 1 root root 5297920 Jun 30  2015 /usr/lib/x86_64-linux-gnu/libgtk-3.so.0.1000.8

which matches up with Syntapic's number of 3.10.8

@ccoupe
Copy link

ccoupe commented Mar 7, 2016

I can confirm @Dassadar problem. I installed 15.10 Desktop (AMD aka x86_64) in a OracleBox VM and samples/simple-control-sizes.rb is missing the edit_box !!! I'm using the Shoes 3.3.1 beta. Gtk3 appears to be 3.16.7 so that's not wildly newer. FWIW it only takes an hour or two install and I still hate the new desktop. 15.10 doesn't ship with alternates like Gnome Shell either.

@ccoupe
Copy link

ccoupe commented Mar 7, 2016

When closing the window from the command below, we do get a small clue.

ccoupe@ubu15-10:~$ .shoes/walkabout/shoes .shoes/walkabout/samples/simple-control-sizes.rb 
vlc not at standard location 

(shoes-bin:4697): Gdk-WARNING **: losing last reference to undestroyed window

@ccoupe
Copy link

ccoupe commented Mar 7, 2016

I took this opportunity to update the wiki with how to build Shoes from source. https://github.com/Shoes3/shoes3/wiki/Building-Shoes-on-Linux so some good has come from this bug since that page was out-of-date-by-a-lot.

Edit_boxes are missing in that Shoes and the Gdk-WARNING **: losing last reference to undestroyed window only happens on scripts that have edit boxes when closed from the window button. Tested with samples/simple-control-sizes and my http://walkabout.mvmanila.com/public/share/isp.rb sample which writes to a edit_box and writes a file entry every interval (it set it 15 secs). The log file exists. No complaints from Gtk about setting contents on the edit box - it just doesn't show on screen. Perhaps there is (newish) gtk flag to set when creating that box?

gtk.c:1233

@passenger94
Copy link
Contributor

for info : Edit_box is a gtk_text_view inside a gtk_scrolled_window, maybe problem is coming from alternate version of gtk_scrolled_window
@ccoupe maybe it's worth trying to compile with a regular gtk_scrolled_window in lieu of gtk_scrolled_window_alt_new, just too see if problem comes from there ...

@ccoupe
Copy link

ccoupe commented Mar 7, 2016

@passenger94 - I'll try that tomorrow. It's late here.

@passenger94
Copy link
Contributor

I can see one problematic change between 3.10 and 3.16 in gtkscrolledwindow.c
gtkscrolledwindow now have a gdk_window
in 3.10 was :
https://github.com/GNOME/gtk/blob/gtk-3-10/gtk/gtkscrolledwindow.c#L575
in 3.16 :
https://github.com/GNOME/gtk/blob/gtk-3-16/gtk/gtkscrolledwindow.c#L1187

i don't know if it's what we are dealing with but could be ! (the alt version says explicitely that it doesn't have a window, like in 3.10 :
https://github.com/Shoes3/shoes3/blob/master/shoes/native/gtkscrolledwindowalt.c#L54)

So, If gtk_scrolled_window_alt_new is the problem, i would next try this :
gtk_widget_set_has_window(GTK_WIDGET(scrolledwindowAlt), TRUE);

Don't know but smells strong ...

@ccoupe
Copy link

ccoupe commented Mar 7, 2016

@passenger94 - That fixed it on 3.16. Wonderful! That fix crashes 3.10 so we do have another interesting problem. We need to test the Gtk version version at runtime (not compile time).

@passenger94
Copy link
Contributor

Nice !
no wonders it crashes 3.10 !!

We need to test the Gtk version version at runtime

maybe looking at the return of gtk_widget_get_has_window() is enough ?
what do you think ?

Edit : sorry, it's confusing ...
i mean check if parent of scrolledwindowAlt, which is regular scrolledwindow has a window, then process accordingly

@ccoupe
Copy link

ccoupe commented Mar 7, 2016

gtk_widget_set_has_window(GTK_WIDGET(scrolledwindowAlt), gtk_widget_get_has_window(scrolledwindowAlt));

Seems to work.

@passenger94
Copy link
Contributor

no, there we are checking ourself !!! ;-)
look at the parent, then fork

if (gtk_widget_get_has_window(scrolledwindowAlt->parent_instance)) {
  gtk_widget_set_has_window(GTK_WIDGET(scrolledwindowAlt), TRUE);
} else {
  gtk_widget_set_has_window(GTK_WIDGET(scrolledwindowAlt), FALSE);
}

or yes, better, like you did

gtk_widget_set_has_window(GTK_WIDGET(scrolledwindowAlt), gtk_widget_get_has_window(scrolledwindowAlt->parent_instance))

hmmm, probably a cast is missing : GTK_WIDGET((scrolledwindowAlt->parent_instance))

ccoupe pushed a commit that referenced this issue Mar 7, 2016
@ccoupe
Copy link

ccoupe commented Mar 7, 2016

parent-instance or parent->instance don't exist. I'm busy so I can't look it up myself

@passenger94
Copy link
Contributor

just corrected sorry, parent_instance
GTK_WIDGET(scrolledwindowAlt->parent_instance)

@passenger94
Copy link
Contributor

ok this works on 3.10

gtk_widget_set_has_window(GTK_WIDGET(scrolledwindowAlt), 
    gtk_widget_get_has_window(GTK_WIDGET(&scrolledwindowAlt->parent_instance)));

parent_instance is not a pointer !

@passenger94
Copy link
Contributor

For info, This change appeared in 3.16 !

@ccoupe ccoupe added this to the 3.3.1 milestone Mar 7, 2016
@ccoupe
Copy link

ccoupe commented Mar 7, 2016

That works on Ubuntu 15.10. I've uploaded a new beta (same address as above) if @Dassadar would be so kind to try it and report back. In my 15.10, the download does solve the problem.

ccoupe pushed a commit that referenced this issue Mar 7, 2016
ccoupe pushed a commit that referenced this issue Mar 7, 2016
@Dassadar
Copy link
Author

Dassadar commented Mar 7, 2016

This fixes: thanks for the investigation!

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

3 participants