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

Toolbar customization bugs #4542

Open
4 tasks
rolandlo opened this issue Dec 29, 2022 · 4 comments · May be fixed by #5114
Open
4 tasks

Toolbar customization bugs #4542

rolandlo opened this issue Dec 29, 2022 · 4 comments · May be fixed by #5114
Labels

Comments

@rolandlo
Copy link
Member

There are a few bugs with the toolbar customization. They should be listed here:

Affects versions :

  • OS: Linux
  • (Linux only) Desktop environment: Wayland
  • Which version of libgtk do you use: 3.24.34
  • Version of Xournal++: latest master
  • Installation method: PPA/built from source

Describe the bug

  • When closing the application with toolbar customization dialog open, lots of warnings are written to the console like:
(xournalpp:118628): GLib-GObject-WARNING **: 21:38:35.989: instance with invalid (NULL) class pointer

(xournalpp:118628): GLib-GObject-CRITICAL **: 21:38:35.989: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(xournalpp:118628): GLib-GObject-WARNING **: 21:38:35.989: instance with invalid (NULL) class pointer

(xournalpp:118628): GLib-GObject-CRITICAL **: 21:38:35.989: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(xournalpp:118628): GLib-GObject-WARNING **: 21:38:35.989: instance with invalid (NULL) class pointer

(xournalpp:118628): GLib-GObject-CRITICAL **: 21:38:35.989: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(xournalpp:118628): GLib-GObject-WARNING **: 21:38:35.989: invalid unclassed pointer in cast to 'GtkToolbar'

(xournalpp:118628): Gtk-CRITICAL **: 21:38:35.989: gtk_toolbar_get_n_items: assertion 'GTK_IS_TOOLBAR (toolbar)' failed

(xournalpp:118628): Gtk-CRITICAL **: 21:38:35.989: gtk_toolbar_get_n_items: assertion 'GTK_IS_TOOLBAR (toolbar)' failed

(xournalpp:118628): Gtk-CRITICAL **: 21:38:35.989: gtk_widget_get_style_context: assertion 'GTK_IS_WIDGET (widget)' failed

(xournalpp:118628): Gtk-CRITICAL **: 21:38:35.989: gtk_style_context_remove_class: assertion 'GTK_IS_STYLE_CONTEXT (context)' failed

Compare #1189, where the app crashed (which doesn't happen any more).

  • When dragging and dropping an icon outside of the Xournal++ window onto another Window that accepts drag&drop (e.g. VS Code), the icon gets removed from the toolbar and is lost.

  • In gtk_selection_data_set we have format = 0 (instead of 8; it stands for the number of bits in a unit) in multiple places in ToolbarCustomizeDialog.cpp and ToolbarAdapter.cpp. This results in some warnings like

(xournalpp:120080): Gtk-CRITICAL **: 22:02:12.206: _gtk_selection_request: assertion '(data.format >= 8) && (data.format % 8 == 0)' failed

in the above case and looks wrong, see https://docs.gtk.org/gtk3/method.SelectionData.set.html.

Expected behavior

  1. No warnings
  2. Icon is put back onto the toolbar where it was taken from
  3. Correct format, no warnings
  4. No missing redraws

Additional context
A good reference on drag&drop in Gtk is http://www.compsci.hunter.cuny.edu/~sweiss/course_materials/csci493.70/lecture_notes/GTK_dragndrop.pdf

@rolandlo rolandlo added the bug label Dec 29, 2022
@jhilmer
Copy link
Contributor

jhilmer commented Jan 1, 2023

All the warnings disapear after I have initialized the parent attribute of ColorToolItem. commit 58d55b0
#4543

@rolandlo
Copy link
Member Author

rolandlo commented Jan 1, 2023

The warnings disappear indeed, but instead I get a message "Segmentation fault" after closing the app with open customization dialog.

@jhilmer
Copy link
Contributor

jhilmer commented Jan 3, 2023

PR #4559 fixes the SEGV

@bhennion
Copy link
Contributor

Note that the toolbar customization mechanism will have to be entire rewritten before moving to gtk4 (the GtkToolbar widget was removed and the Drag and Drop system of GTK got replaced).

@bhennion bhennion linked a pull request Sep 24, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants