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

notebook example freezes when I try to detach tab. #260

Open
jnez137 opened this issue Jul 19, 2022 · 15 comments
Open

notebook example freezes when I try to detach tab. #260

jnez137 opened this issue Jul 19, 2022 · 15 comments
Assignees
Labels
Bug Examples GTK 4 GTK 4 only macOS mac specific Windows MS Windows specific

Comments

@jnez137
Copy link

jnez137 commented Jul 19, 2022

Describe the bug
I am using macOS and I found that when I try to detach a tab in the notebooks.f90 example, the UI essentially freezes and I can only close it. None of the other buttons or notebook tabs work after a drag n drop event. I'm guessing this is an issue with my machine or OS, but was hoping to get some confirmation.

Expected behavior
If I try to detach a tab that the rest of the UI will work afterwards. Note that as far as I can tell/know, every other example works fine on my machine, so odd to me that this specific thing does now work.

To Reproduce

  1. Open Notebooks example
  2. Grab a tab with the mouse (doesn't matter which one)
  3. Move it either off the window or to the other notebook (doesn't matter to me)
  4. After doing this the UI will become unresponsive; no buttons will work and you can only close the app.

Here is an example of it frozen after I tried to move page two of the bottom notebook off screen. Note how page two is separated from the other two tabs. At this point no widget on the UI is responsive and I must close the app.
image

Your system:

  • OS version: macOS 12.3.1 (apple silicon/M1)
  • Compiler version: fortran 12.0.0 20211218 (experimental)
  • GTK branch: gtk4

Additional context
I discovered this as I was working on my own UI and I could not figure out why every time I tried to detach a notebook tab that my UI froze. I then checked your example and got the exact same behavior.

@vmagnin
Copy link
Owner

vmagnin commented Jul 19, 2022

Thanks for this precise bug report, and for reporting that other examples are running fine on macOS / M1 !

On my side:

  • GFortran 11.2.0, GTK 4.6.5, Linux Kubuntu 22.04: no freeze. I can move the tab to the other notebook. But if I move it off the window, it will finally reappear a few seconds later (sometimes 10 seconds).
    • With GTK 3.24.33, nothing happens if I try to move it off the window.
  • GFortran 12.1.1, GTK 4.7.0, Linux Fedora Rawhide (37): I can not move it off the window, and I can not move it to the other notebook. The problem looks like https://gitlab.gnome.org/GNOME/gtk/-/issues/4423

See also: https://gitlab.gnome.org/GNOME/gtk/-/issues/?search=gtknotebook&sort=updated_desc&state=opened&first_page_size=20

The freeze problem could be a GTK 4 bug on the macOS implementation.

But I will print and study more deeply the notebooks.f90 example. Sometimes, subtle bugs are revealed on a specific OS.

@vmagnin
Copy link
Owner

vmagnin commented Jul 19, 2022

@jnez137
Copy link
Author

jnez137 commented Jul 20, 2022 via email

@vmagnin
Copy link
Owner

vmagnin commented Jul 20, 2022

Jeremy @jnez137 ,

I have read https://docs.gtk.org/gtk4/class.Notebook.html and https://docs.gtk.org/gtk4/method.Notebook.set_tab_detachable.html
I don't think that if we move a tab off the window it should be destroyed. My understanding is that the Drag aNd Drop operation is canceled. Of course, it should not freeze the application! Another great place to obtain help about GTK is the GNOME Discourse.

Your work about that optical design application is interesting. I am curious about what you can achieve.

Also, I am interested if you have comments about the gtk-fortran installation instructions for macOS. I don't know if they are up-to-date.

@vmagnin vmagnin added the macOS mac specific label Jul 20, 2022
@jnez137
Copy link
Author

jnez137 commented Jul 21, 2022 via email

@vmagnin
Copy link
Owner

vmagnin commented Jul 21, 2022

Thanks Jeremy for your return, that may be useful for other mac users.

Note that I have added some functionalities in notebooks.f90 yesterday. It works fine with GFortran, but with Intel ifx I had a severe freeze under Linux (the desktop was frozen and I had to kill the process in a terminal screen).

@vmagnin
Copy link
Owner

vmagnin commented Sep 30, 2022

I have tested notebooks.f90 on macOS 12.6, with GFortran 12.2.0 and GTK 4.8.1. I have tried to drop and drag a tab from the upward notebook to the downward notebook, which should work. But on macOS, the example is frozen (but the closing cross works):

% ./notebooks
 group name = <group>

(<unknown>:575): GLib-GObject-WARNING **: 17:27:16.436: ../gobject/gsignal.c:2772: instance '0x7f9fe18cd180' has no handler with id '491'
 You have exited the GLib main loop, bye, bye...

@jnez137
Copy link
Author

jnez137 commented Oct 11, 2022 via email

@vmagnin
Copy link
Owner

vmagnin commented Apr 28, 2023

GTK 4.10.3 on macOS 12.6.4:

mac@intosh examples % ./notebooks
 group name = <group>
2023-04-28 19:18:47.215 notebooks[488:3114] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'There are 0 items on the pasteboard, but 1 drag images. There must be 1 draggingItem per pasteboardItem.'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007ff811ec1e8b __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007ff811c1fe48 objc_exception_throw + 48
	2   CoreFoundation                      0x00007ff811ec1cf2 +[NSException exceptionWithName:reason:userInfo:] + 0
	3   AppKit                              0x00007ff81524ccf6 -[NSDraggingSession(NSInternal) _initWithPasteboard:draggingItems:clippingRect:source:] + 222
	4   AppKit                              0x00007ff814d1de54 -[NSCoreDragManager beginDraggingSessionWithItems:fromWindow:withClipRect:event:source:] + 1719
	5   AppKit                              0x00007ff81507eb27 -[NSView(NSDrag) beginDraggingSessionWithItems:event:source:] + 246
	6   libgtk-4.1.dylib                    0x000000010ff8f663 _gdk_macos_drag_begin + 217
	7   libgtk-4.1.dylib                    0x000000010ff98e5a gdk_macos_surface_drag_begin + 252
	8   libgtk-4.1.dylib                    0x000000010fdb5764 gtk_notebook_motion + 585
	9   libgtk-4.1.dylib                    0x000000010fcdc4c7 _gtk_marshal_VOID__DOUBLE_DOUBLEv + 153
	10  libgobject-2.0.0.dylib              0x000000010f794cd7 _g_closure_invoke_va + 212
	11  libgobject-2.0.0.dylib              0x000000010f7aa176 g_signal_emit_valist + 992
	12  libgobject-2.0.0.dylib              0x000000010f7aabe4 g_signal_emit + 120
	13  libgtk-4.1.dylib                    0x000000010fd4501b gtk_event_controller_motion_handle_event + 68
	14  libgtk-4.1.dylib                    0x000000010fd433eb gtk_event_controller_handle_event + 235
	15  libgtk-4.1.dylib                    0x000000010fe514f9 gtk_widget_run_controllers + 205
	16  libgtk-4.1.dylib                    0x000000010fd9eb9e gtk_propagate_event_internal + 301
	17  libgtk-4.1.dylib                    0x000000010fd9e075 gtk_main_do_event + 2136
	18  libgtk-4.1.dylib                    0x000000010fe65b14 surface_event + 12
	19  libgtk-4.1.dylib                    0x000000010ff88b27 _gdk_marshal_BOOLEAN__POINTERv + 122
	20  libgtk-4.1.dylib                    0x000000010ffc3052 gdk_surface_event_marshallerv + 146
	21  libgobject-2.0.0.dylib              0x000000010f794cd7 _g_closure_invoke_va + 212
	22  libgobject-2.0.0.dylib              0x000000010f7aa176 g_signal_emit_valist + 992
	23  libgobject-2.0.0.dylib              0x000000010f7aabe4 g_signal_emit + 120
	24  libgtk-4.1.dylib                    0x000000010ffc2648 gdk_surface_handle_event + 313
	25  libgtk-4.1.dylib                    0x000000010ffaf2e5 _gdk_event_queue_flush + 54
	26  libgtk-4.1.dylib                    0x000000010ffc32fd gdk_surface_flush_events + 30
	27  libgobject-2.0.0.dylib              0x000000010f794cd7 _g_closure_invoke_va + 212
	28  libgobject-2.0.0.dylib              0x000000010f7aa176 g_signal_emit_valist + 992
	29  libgobject-2.0.0.dylib              0x000000010f7aabe4 g_signal_emit + 120
	30  libgtk-4.1.dylib                    0x000000010ffb3d06 gdk_frame_clock_flush_idle + 43
	31  libglib-2.0.0.dylib                 0x00000001103c8c7f g_timeout_dispatch + 67
	32  libglib-2.0.0.dylib                 0x00000001103cbd87 g_main_context_dispatch + 273
	33  libglib-2.0.0.dylib                 0x00000001103cc074 g_main_context_iterate + 438
	34  libglib-2.0.0.dylib                 0x00000001103cc0cc g_main_context_iteration + 55
	35  libgio-2.0.0.dylib                  0x00000001105bed77 g_application_run + 521
	36  notebooks                           0x000000010f4f7b55 MAIN__ + 436
	37  notebooks                           0x000000010f4f7c11 main + 57
	38  dyld                                0x000000011833c52e start + 462
)
libc++abi: terminating with uncaught exception of type NSException

Program received signal SIGABRT: Process abort signal.

Backtrace for this error:
#0  0x110a198be
#1  0x110a18a9d
[...]
#48  0x10f4f7c10
zsh: abort      ./notebooks

@vmagnin
Copy link
Owner

vmagnin commented Apr 28, 2023

Crash when dragging notebook tabs on MacOS

https://gitlab.gnome.org/GNOME/gtk/-/issues/5605

@vmagnin
Copy link
Owner

vmagnin commented Apr 29, 2023

GTK 4.10.3 on MSYS2/Windows 10, with drag and drop:

$ ./notebooks.exe
 group name = <group>
Segmentation fault

@vmagnin vmagnin added the Windows MS Windows specific label Apr 29, 2023
@vmagnin
Copy link
Owner

vmagnin commented Nov 7, 2023

On macOS 12.7 with GTK 4.12.3, notebooks does not crash and is not frozen when trying to drag&drop a tab, although the drag&drop does not work.

@jnez137
Copy link
Author

jnez137 commented Nov 17, 2023 via email

@vmagnin
Copy link
Owner

vmagnin commented Mar 29, 2024

On macOS 12.7.4 with GTK 4.14.1, no crash and no freeze, but the drag&drop still not working and printing many of these messages:

(<unknown>:704): Gdk-CRITICAL **: 10:52:12.646: _gdk_macos_surface_update_fullscreen_state: assertion 'GDK_IS_MACOS_SURFACE (self)' failed

@vmagnin vmagnin added the GTK 4 GTK 4 only label May 7, 2024
@vmagnin
Copy link
Owner

vmagnin commented May 7, 2024

The gtk3 branch is not affected by this problem. It is specific to GTK 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Examples GTK 4 GTK 4 only macOS mac specific Windows MS Windows specific
Projects
None yet
Development

No branches or pull requests

2 participants