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

Support non-X11 windowing systems #504

Merged
merged 1 commit into from
Dec 11, 2020

Conversation

wb9688
Copy link
Contributor

@wb9688 wb9688 commented Dec 5, 2020

Fixes #492

@raveit65 raveit65 requested a review from a team December 5, 2020 15:52
@raveit65
Copy link
Member

raveit65 commented Dec 5, 2020

@wmww
Can you please do a review?

Copy link

@wmww wmww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have not tested, but code looks good to me

Copy link
Member

@lukefromdc lukefromdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't work on Wayland (older wayfire version in use for this test) with a MATE x11 session also running: got
cannot parse arguments: cannot open display

@lukefromdc lukefromdc requested a review from a team December 6, 2020 05:08
@wmww
Copy link

wmww commented Dec 6, 2020

Does master on X11 work for you? I don't understand how this PR could have broken it on X11.

@lukefromdc
Copy link
Member

lukefromdc commented Dec 6, 2020 via email

@wb9688
Copy link
Contributor Author

wb9688 commented Dec 7, 2020

I tested that this works on both Wayfire (Wayland) and Openbox (X11).

@lukefromdc: GTK prefers Wayland over X11, so I have no idea how you could get that error on Wayland.

@lukefromdc
Copy link
Member

lukefromdc commented Dec 7, 2020 via email

@wmww
Copy link

wmww commented Dec 7, 2020

@lukefromdc you can generally fix that sort of thing with environment variables. I don't know your exact setup so I can't give a magic incantation, but somewhere in here is probably the solution to your problem: https://discourse.ubuntu.com/t/environment-variables-for-wayland-hackers/12750

@raveit65
Copy link
Member

raveit65 commented Dec 7, 2020

I get a crash in wayfire session with that PR in a virtual machine with fedora 32. Of course atril runs fine under X11.

[rave@f32 ~]$ atril
Segmentation fault (core dumped)
[root@f32 ccpp-2020-12-07-23:35:14.422268-5795]# cat backtrace
[New LWP 5795]
[New LWP 5796]
[New LWP 5797]
[New LWP 5799]
[New LWP 5800]
[New LWP 5798]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `atril'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  wl_list_insert (list=0x0, elm=elm@entry=0x5558bd892bd8) at src/wayland-util.c:46
46		elm->prev = list;

@raveit65
Copy link
Member

raveit65 commented Dec 8, 2020

Hmm,
i can confirm that atril runs fine in wayfire-session on baremetal in fedora rawhide (34) with nouveau graphic driver.
It's the same RPM package what i used for f32, only rebuilt against fedora rawhide.
Still wondering what goes wrong with f32 when i use a wayfire-session in qemu VM.
In fedora 32 i use nvidia driver for production, in result wayfire doesn't run on baremetal.

@wb9688
Copy link
Contributor Author

wb9688 commented Dec 8, 2020

@raveit65: In the VM where it doesn't work, could you run Atril in GDB and post the backtrace? And does it also happen in Weston?

@raveit65
Copy link
Member

raveit65 commented Dec 8, 2020

Atrils runs fine fine in a weston session in same f32 VM :)
weston
It is poosible that the gtk warning is unrelated and already there.
Not sure what the other ones meant.

I will to get a stacktrace again for the wayfire session. But i think this must be another issue with wayfire in f32 and/or VM, because atril runs fine in 2 other use cases for me.

@raveit65
Copy link
Member

raveit65 commented Dec 8, 2020

Ok, and now the cordump from wayfire session in VM

[rave@f32 ~]$ coredumpctl dump
           PID: 3203 (atril)
           UID: 1000 (rave)
           GID: 1001 (rave)
        Signal: 11 (SEGV)
     Timestamp: Tue 2020-12-08 18:46:49 CET (2min 29s ago)
  Command Line: atril
    Executable: /usr/bin/atril
 Control Group: /user.slice/user-1000.slice/session-5.scope
          Unit: session-5.scope
         Slice: user-1000.slice
       Session: 5
     Owner UID: 1000 (rave)
       Boot ID: d56b8011ad4c4383a7a906aa04057624
    Machine ID: fa96f12544b6439cb689db4930916d12
      Hostname: f32.mother.loc
       Storage: /var/lib/systemd/coredump/core.atril.1000.d56b8011ad4c4383a7a906aa04057624.3203.1607449609000000.lz4
       Message: Process 3203 (atril) of user 1000 dumped core.
                
                Stack trace of thread 3203:
                #0  0x00007f72a3aa8224 wl_list_insert (libwayland-client.so.0 + 0xa224)
                #1  0x00007f72a3aa5105 queue_event (libwayland-client.so.0 + 0x7105)
                #2  0x00007f72a3aa5739 wl_display_dispatch_queue (libwayland-client.so.0 + 0x7739)
                #3  0x00007f72a3aa59af wl_display_roundtrip_queue (libwayland-client.so.0 + 0x79af)
                #4  0x00007f72900e260c roundtrip (libEGL_mesa.so.0 + 0x2660c)
                #5  0x00007f72900d76ab dri2_initialize (libEGL_mesa.so.0 + 0x1b6ab)
                #6  0x00007f72900d3e97 _eglInitializeDisplay (libEGL_mesa.so.0 + 0x17e97)
                #7  0x00007f72900cfd08 eglInitialize (libEGL_mesa.so.0 + 0x13d08)
                #8  0x00007f72a5c9aada _ZN7WebCore15PlatformDisplay20initializeEGLDisplayEv (libwebkit2gtk-4.0.so.37 + 0x1f94ada)
                #9  0x00007f72a5ce4090 _ZN7WebCore22PlatformDisplayWayland6createEP10wl_display (libwebkit2gtk-4.0.so.37 + 0x1fde090)
                #10 0x00007f72a5c9a5fb _ZN7WebCore15PlatformDisplay21createPlatformDisplayEv (libwebkit2gtk-4.0.so.37 + 0x1f945fb)
                #11 0x00007f72a5c9a6a0 _ZZSt9call_onceIZN7WebCore15PlatformDisplay13sharedDisplayEvEUlvE_JEEvRSt9once_flagOT_DpOT0_ENUlvE0_4_FUNEv (libwebkit2gtk-4.0.so.37 + 0x1f946a0)
                #12 0x00007f72a75a1acf __pthread_once_slow (libpthread.so.0 + 0x11acf)
                #13 0x00007f72a5c9a770 __gthread_once (libwebkit2gtk-4.0.so.37 + 0x1f94770)
                #14 0x00007f72a48998ed _ZN6WebKit23AcceleratedBackingStore17checkRequirementsEv (libwebkit2gtk-4.0.so.37 + 0xb938ed)
                #15 0x00007f72a489dd8b _ZN6WebKit27HardwareAccelerationManagerC2Ev (libwebkit2gtk-4.0.so.37 + 0xb97d8b)
                #16 0x00007f72a489de0c _ZN3WTF14NeverDestroyedIN6WebKit27HardwareAccelerationManagerENS_22AnyThreadsAccessTraitsEEC4IJEEEDpOT_ (libwebkit2gtk-4.0.so.37 + 0xb97e0c)
                #17 0x00007f72a48a723d _ZN6WebKit14WebPreferences23platformInitializeStoreEv (libwebkit2gtk-4.0.so.37 + 0xba123d)
                #18 0x00007f72a46fdb56 _ZN6WebKit14WebPreferences6createERKN3WTF6StringES4_S4_ (libwebkit2gtk-4.0.so.37 + 0x9f7b56)
                #19 0x00007f72a46ffd33 _ZN6WebKit14WebPreferences24createWithLegacyDefaultsERKN3WTF6StringES4_S4_ (libwebkit2gtk-4.0.so.37 + 0x9f9d33)
                #20 0x00007f72a46e45fd _ZN6WebKit12WebPageGroupC2ERKN3WTF6StringE (libwebkit2gtk-4.0.so.37 + 0x9de5fd)
                #21 0x00007f72a46e48a6 _ZN6WebKit12WebPageGroup6createERKN3WTF6StringE (libwebkit2gtk-4.0.so.37 + 0x9de8a6)
                #22 0x00007f72a473cc8c _ZN6WebKit14WebProcessPoolC2ERN3API24ProcessPoolConfigurationE (libwebkit2gtk-4.0.so.37 + 0xa36c8c)
                #23 0x00007f72a473d60b _ZN6WebKit14WebProcessPool6createERN3API24ProcessPoolConfigurationE (libwebkit2gtk-4.0.so.37 + 0xa3760b)
                #24 0x00007f72a47ddc40 webkitWebContextConstructed (libwebkit2gtk-4.0.so.37 + 0xad7c40)
                #25 0x00007f72a783e2e7 g_object_new_internal (libgobject-2.0.so.0 + 0x192e7)
                #26 0x00007f72a783f6ad g_object_new_with_properties (libgobject-2.0.so.0 + 0x1a6ad)
                #27 0x00007f72a7840331 g_object_new (libgobject-2.0.so.0 + 0x1b331)
                #28 0x00007f72a47d9169 createDefaultWebContext (libwebkit2gtk-4.0.so.37 + 0xad3169)
                #29 0x00007f72a777490d g_once_impl (libglib-2.0.so.0 + 0x7c90d)
                #30 0x00007f72a47d9825 webkit_web_context_get_default (libwebkit2gtk-4.0.so.37 + 0xad3825)
                #31 0x00007f72a47e6585 webkitWebViewConstructed (libwebkit2gtk-4.0.so.37 + 0xae0585)
                #32 0x00007f72a783e2e7 g_object_new_internal (libgobject-2.0.so.0 + 0x192e7)
                #33 0x00007f72a783f6ad g_object_new_with_properties (libgobject-2.0.so.0 + 0x1a6ad)
                #34 0x00007f72a7840331 g_object_new (libgobject-2.0.so.0 + 0x1b331)
                #35 0x00007f72a85a48c2 ev_web_view_new (libatrilview.so.3 + 0x428c2)
                #36 0x0000560609f1c538 ev_window_init (atril + 0x41538)
                #37 0x00007f72a7858498 g_type_create_instance (libgobject-2.0.so.0 + 0x33498)
                #38 0x00007f72a783e205 g_object_new_internal (libgobject-2.0.so.0 + 0x19205)
                #39 0x00007f72a783ffac g_object_new_valist (libgobject-2.0.so.0 + 0x1afac)
                #40 0x00007f72a784030d g_object_new (libgobject-2.0.so.0 + 0x1b30d)
                #41 0x0000560609f1de0f ev_window_new (atril + 0x42e0f)
                #42 0x0000560609f072c4 ev_application_open_window (atril + 0x2c2c4)
                #43 0x0000560609f02903 load_files (atril + 0x27903)
                #44 0x00007f72a73ed042 __libc_start_main (libc.so.6 + 0x27042)
                #45 0x0000560609f029be _start (atril + 0x279be)
                
                Stack trace of thread 3205:
                #0  0x00007f72a74c237d syscall (libc.so.6 + 0xfc37d)
                #1  0x00007f72a7799616 g_cond_wait_until (libglib-2.0.so.0 + 0xa1616)
                #2  0x00007f72a771a4a1 g_async_queue_pop_intern_unlocked (libglib-2.0.so.0 + 0x224a1)
                #3  0x00007f72a777524a g_thread_pool_wait_for_new_task (libglib-2.0.so.0 + 0x7d24a)
                #4  0x00007f72a77747f2 g_thread_proxy (libglib-2.0.so.0 + 0x7c7f2)
                #5  0x00007f72a7599432 start_thread (libpthread.so.0 + 0x9432)
                #6  0x00007f72a74c7913 __clone (libc.so.6 + 0x101913)
                
                Stack trace of thread 3208:
                #0  0x00007f72a75a04e8 futex_abstimed_wait_cancelable (libpthread.so.0 + 0x104e8)
                #1  0x00007f72a2d8775d _ZNSt18condition_variable17__wait_until_implINSt6chrono8durationIlSt5ratioILl1ELl1000000000EEEEEESt9cv_statusRSt11unique_lockISt5mutexERKNS1_10time_pointINS1_3_V212steady_clockET_EE (libjavascriptcoregtk-4.0.so.18 + 0x143975d)
                #2  0x00007f72a2d878df _ZN7bmalloc9Scavenger16threadEntryPointEPS0_ (libjavascriptcoregtk-4.0.so.18 + 0x14398df)
                #3  0x00007f72a0bceb44 execute_native_thread_routine (libstdc++.so.6 + 0xd8b44)
                #4  0x00007f72a7599432 start_thread (libpthread.so.0 + 0x9432)
                #5  0x00007f72a74c7913 __clone (libc.so.6 + 0x101913)
                
                Stack trace of thread 3206:
                #0  0x00007f72a74bcaaf __GI___poll (libc.so.6 + 0xf6aaf)
                #1  0x00007f72a774aaae g_main_context_poll (libglib-2.0.so.0 + 0x52aae)
                #2  0x00007f72a774abe3 g_main_context_iteration (libglib-2.0.so.0 + 0x52be3)
                #3  0x00007f72a862bfbd dconf_gdbus_worker_thread (libdconfsettings.so + 0xafbd)
                #4  0x00007f72a77747f2 g_thread_proxy (libglib-2.0.so.0 + 0x7c7f2)
                #5  0x00007f72a7599432 start_thread (libpthread.so.0 + 0x9432)
                #6  0x00007f72a74c7913 __clone (libc.so.6 + 0x101913)
                
                Stack trace of thread 3204:
                #0  0x00007f72a74bcaaf __GI___poll (libc.so.6 + 0xf6aaf)
                #1  0x00007f72a774aaae g_main_context_poll (libglib-2.0.so.0 + 0x52aae)
                #2  0x00007f72a774abe3 g_main_context_iteration (libglib-2.0.so.0 + 0x52be3)
                #3  0x00007f72a774ac31 glib_worker_main (libglib-2.0.so.0 + 0x52c31)
                #4  0x00007f72a77747f2 g_thread_proxy (libglib-2.0.so.0 + 0x7c7f2)
                #5  0x00007f72a7599432 start_thread (libpthread.so.0 + 0x9432)
                #6  0x00007f72a74c7913 __clone (libc.so.6 + 0x101913)
                
                Stack trace of thread 3207:
                #0  0x00007f72a74bcaaf __GI___poll (libc.so.6 + 0xf6aaf)
                #1  0x00007f72a774aaae g_main_context_poll (libglib-2.0.so.0 + 0x52aae)
                #2  0x00007f72a774ae33 g_main_loop_run (libglib-2.0.so.0 + 0x52e33)
                #3  0x00007f72a79a06aa gdbus_shared_thread_func (libgio-2.0.so.0 + 0x1226aa)
                #4  0x00007f72a77747f2 g_thread_proxy (libglib-2.0.so.0 + 0x7c7f2)
                #5  0x00007f72a7599432 start_thread (libpthread.so.0 + 0x9432)
                #6  0x00007f72a74c7913 __clone (libc.so.6 + 0x101913)

Refusing to dump core to tty (use shell redirection or specify --output)

Copy link
Member

@raveit65 raveit65 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,
atril runs fine under wayfire session on baremetal and weston session in VM.
I tested also presentation and fullscreen mode with pdf. Works like expected.

@raveit65
Copy link
Member

@lukefromdc
Was you able to get it working on your box?
Or can i merge it?

@lukefromdc
Copy link
Member

lukefromdc commented Dec 11, 2020 via email

@raveit65 raveit65 merged commit a23d153 into mate-desktop:master Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Wayland
4 participants