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

Immediate breakages from overview plugin (upd: only if placed on the left) #1149

Open
nick87720z opened this issue Dec 28, 2021 · 2 comments

Comments

@nick87720z
Copy link

nick87720z commented Dec 28, 2021

I decided to better analyze breakages, caused by overview plugin. First attempt was in bug #730 , but assertion warnings have more complex reasons to appear, than I described in that bug. Decided to start fresh one.

Session files list

When some file is opened (without plugin), list of opened files is saved right in editor config.

[files]
...
FILE_NAME_0=719;Sh;0;EUTF-8;0;1;0;%2Fhome%2Fnick87720z%2Fdev%2Fmisc%2Ffdopenres;0;4

When overview plugin is loaded, last line (FILE_NAME_0=) vanishes from config immediately, and if unloaded - it's back. Looks like, config is saved each time time module is toggled, and active Overview somehow inhibits that line from config.

Editor keys

I checked only some keys:

  • Home, End, Ctrl+S, Ctrl+W - don't work.
  • Ctrl+O, Arrows, Page Up, Page Down - work
  • Ctrl+Shift+S - segmentation fault (Save All, not Save As)

Terminal output

I'm not sure if this is reason though, but now I have more exact logs of what when happens, comparing to #730 .

# Starting editor with enabled overview causes this
(geany:19031): Geany-CRITICAL **: 17:24:02.222: document_grab_focus: assertion 'doc != NULL' failed

Now there's only one empty document (remember - files list disappears from config just on plugin load).

# Attempt to close document while Overview is on, per each close request (even for same document - e.g. if closing manually)
(geany:19031): Geany-CRITICAL **: 17:24:37.353: remove_page: assertion 'doc != NULL' failed
# document still remains opened, closing doesn't work at all

Besides this (note - I removed empty lines to not waste space)

# Opening modules manager (may be not due to overview, but I got it during test). Appears on each attempt, not just first.

(geany:3988): Gtk-WARNING **: 17:22:53.980: Negative content width -9 (allocation 1, extents 5x5) while allocating gadget (node entry, owner GtkEntry)
(geany:3988): Gtk-WARNING **: 17:22:53.980: Negative content height -1 (allocation 1, extents 1x1) while allocating gadget (node entry, owner GtkEntry)
(geany:3988): Gtk-WARNING **: 17:22:53.980: Negative content width -1 (allocation 1, extents 1x1) while allocating gadget (node scrolledwindow, owner GtkScrolledWindow)
(geany:3988): Gtk-WARNING **: 17:22:53.980: Negative content height -1 (allocation 1, extents 1x1) while allocating gadget (node scrolledwindow, owner GtkScrolledWindow)
(geany:3988): Gtk-CRITICAL **: 17:22:53.980: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar
(geany:3988): Gtk-CRITICAL **: 17:22:53.980: gtk_widget_get_preferred_width_for_height: assertion 'height >= 0' failed
(geany:3988): Gtk-WARNING **: 17:22:53.980: gtk_widget_size_allocate(): attempt to allocate widget with width 10 and height -17
(geany:3988): Gtk-CRITICAL **: 17:22:53.980: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar

# Overview on/off causes no log
# As well as when modules manager is closed

Solution idea

I remember, there were more focus issues around overview plugin. Even if all breakages are fixed with proper focus management, could be better to make one of views able to maintain multiple renders (not editablee views), so that logically there would be only one editing area. Additional area would be used for Overview scrollbar type - obviously, they should differ with scale (smaller font and size), so that performance would not be wasted to downscaling of relatively supersampled image, whose render could be also more resource-hungry.

Using geany-1.38, geany plugins 1.38, gtk+-3.24.29, glib-2.68.4.

@nick87720z nick87720z changed the title Immediate breakages from overview plugin Immediate breakages from overview plugin (upd: if placed on the left) Dec 28, 2021
@nick87720z
Copy link
Author

nick87720z commented Dec 28, 2021

I just found reason - breakages only happen if overview option to place on the left is enabled. Once this option is off, all breakages disappear - all keys work, session file list is saved, documents close. No more those failed assertions.

Could be that it depends on the order, in which widgets are created. Could be similar case as with "second editor" pane option, where second pane is as primitive as possible in features, comparing to primary editor pane.

@nick87720z nick87720z changed the title Immediate breakages from overview plugin (upd: if placed on the left) Immediate breakages from overview plugin (upd: only if placed on the left) Dec 28, 2021
@elextr
Copy link
Member

elextr commented Dec 28, 2021

Could be that it depends on the order, in which widgets are created. Could be similar case as with "second editor" pane option, where second pane is as primitive as possible in features, comparing to primary editor pane.

Not so much the order they are created, but probably the way they are arranged. Geany knows nothing about new windows that plugins add, so if they are placed in the widget tree where Geany thinks a "standard" window should be, it might well get confused. The split window problems are indeed due to Geany having no idea that this second editing widget exists or that it should do anything in it. There does not seem to be any simple short term solution to this.

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