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

Can't open kdevelop open project dialog when using qgnomeplatform #102

Open
wengxt opened this issue Jun 7, 2022 · 5 comments
Open

Can't open kdevelop open project dialog when using qgnomeplatform #102

wengxt opened this issue Jun 7, 2022 · 5 comments

Comments

@wengxt
Copy link

wengxt commented Jun 7, 2022

System: Archlinux
Version: 0.8.4
KDevelop: 22.04

Try to launch open project dialog in kdevelop, but the UI just freeze and no dialog is displayed.

Same action works fine when not having qgnomeplatform-qt5 package installed.

@grulja
Copy link
Collaborator

grulja commented Jun 7, 2022

Do you have xdg-desktop-portal and xdg-desktop-portal-gtk (or -gnome) installed? Can you show me output from dbus-monitor --session while trying to open a project? Is there any error when you open KDevelop from terminal?

@wengxt
Copy link
Author

wengxt commented Jun 7, 2022

Though it's a little bit weird setup, I don't have xdg-desktop-portal-gtk, but xdg-desktop-portal-kde. But some other app like kwrite open file dialog works fine.

I can see tons of repeated log flushing, some sample like this:

method return time=1654580882.334966 sender=:1.41 -> destination=:1.320 serial=46345 reply_serial=6274
   object path "/org/freedesktop/portal/desktop/request/1_320/qt3509047335"
method call time=1654580882.337337 sender=:1.320 -> destination=org.freedesktop.portal.Desktop serial=6277 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.portal.FileChooser; member=OpenFile
   string "x11:1193756210"
   string "打开工程"
   array [
      dict entry(
         string "directory"
         variant             boolean true
      )
      dict entry(
         string "filters"
         variant             array [
               struct {
                  string "所有文件 "
                  array [
                     struct {
                        uint32 0
                        string "*"
                     }
                  ]
               }
            ]
      )
      dict entry(
         string "handle_token"
         variant             string "qt1418613426"
      )
      dict entry(
         string "modal"
         variant             boolean true
      )
      dict entry(
         string "multiple"
         variant             boolean false
      )
   ]
method call time=1654580882.337849 sender=:1.41 -> destination=org.freedesktop.DBus serial=46346 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.impl.portal.desktop.kde',interface='org.freedesktop.DBus.Properties',member='PropertiesChanged',path='/org/freedesktop/portal/desktop/request/1_320/qt1418613426',arg0='org.freedesktop.impl.portal.Request'"
method return time=1654580882.337863 sender=org.freedesktop.DBus -> destination=:1.41 serial=33014 reply_serial=46346
method call time=1654580882.337898 sender=:1.41 -> destination=org.freedesktop.DBus serial=46347 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.impl.portal.desktop.kde',interface='org.freedesktop.impl.portal.Request',path='/org/freedesktop/portal/desktop/request/1_320/qt1418613426'"
method return time=1654580882.337909 sender=org.freedesktop.DBus -> destination=:1.41 serial=33015 reply_serial=46347
method call time=1654580882.337937 sender=:1.41 -> destination=org.freedesktop.DBus serial=46348 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=StartServiceByName
   string "org.freedesktop.impl.portal.desktop.kde"
   uint32 0
method return time=1654580882.337950 sender=org.freedesktop.DBus -> destination=:1.41 serial=33016 reply_serial=46348
   uint32 2
method call time=1654580882.338105 sender=:1.41 -> destination=org.freedesktop.DBus serial=46349 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner
   string "org.freedesktop.impl.portal.desktop.kde"
method return time=1654580882.338113 sender=org.freedesktop.DBus -> destination=:1.41 serial=33017 reply_serial=46349
   string ":1.320"
method call time=1654580882.338341 sender=:1.41 -> destination=:1.320 serial=46350 path=/org/freedesktop/portal/desktop/request/1_320/qt1418613426; interface=org.freedesktop.DBus.Properties; member=GetAll
   string "org.freedesktop.impl.portal.Request"
method call time=1654580882.338465 sender=:1.320 -> destination=org.freedesktop.DBus serial=6278 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',path='/org/freedesktop/portal/desktop/request/1_320/qt3509047335',interface='org.freedesktop.portal.Request',member='Response'"
error time=1654580882.338525 sender=:1.320 -> destination=:1.41 error_name=org.freedesktop.DBus.Error.UnknownObject reply_serial=46350
   string "No such object path '/org/freedesktop/portal/desktop/request/1_320/qt1418613426'"
method call time=1654580882.338804 sender=:1.41 -> destination=:1.320 serial=46351 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.impl.portal.FileChooser; member=OpenFile
   object path "/org/freedesktop/portal/desktop/request/1_320/qt1418613426"
   string ""
   string "x11:1193756210"
   string "打开工程"
   array [
      dict entry(
         string "modal"
         variant             boolean true
      )
      dict entry(
         string "multiple"
         variant             boolean false
      )
      dict entry(
         string "directory"
         variant             boolean true
      )
      dict entry(
         string "filters"
         variant             array [
               struct {
                  string "所有文件 "
                  array [
                     struct {
                        uint32 0
                        string "*"
                     }
                  ]
               }
            ]
      )
   ]
method return time=1654580882.338930 sender=:1.41 -> destination=:1.320 serial=46352 reply_serial=6277
   object path "/org/freedesktop/portal/desktop/request/1_320/qt1418613426"
method call time=1654580882.341511 sender=:1.320 -> destination=org.freedesktop.portal.Desktop serial=6280 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.portal.FileChooser; member=OpenFile
   string "x11:2473943568"
   string "打开工程"
   array [
      dict entry(
         string "directory"
         variant             boolean true
      )
      dict entry(
         string "filters"
         variant             array [
               struct {
                  string "所有文件 "
                  array [
                     struct {
                        uint32 0
                        string "*"
                     }
                  ]
               }
            ]
      )
      dict entry(
         string "handle_token"
         variant             string "qt3989797115"
      )
      dict entry(
         string "modal"
         variant             boolean true
      )
      dict entry(
         string "multiple"
         variant             boolean false
      )
   ]
method call time=1654580882.342166 sender=:1.41 -> destination=org.freedesktop.DBus serial=46353 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.impl.portal.desktop.kde',interface='org.freedesktop.DBus.Properties',member='PropertiesChanged',path='/org/freedesktop/portal/desktop/request/1_320/qt3989797115',arg0='org.freedesktop.impl.portal.Request'"
method return time=1654580882.342192 sender=org.freedesktop.DBus -> destination=:1.41 serial=33018 reply_serial=46353
method call time=1654580882.342235 sender=:1.41 -> destination=org.freedesktop.DBus serial=46354 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.impl.portal.desktop.kde',interface='org.freedesktop.impl.portal.Request',path='/org/freedesktop/portal/desktop/request/1_320/qt3989797115'"
method return time=1654580882.342248 sender=org.freedesktop.DBus -> destination=:1.41 serial=33019 reply_serial=46354
method call time=1654580882.342253 sender=:1.41 -> destination=org.freedesktop.DBus serial=46355 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=StartServiceByName
   string "org.freedesktop.impl.portal.desktop.kde"
   uint32 0
method return time=1654580882.342265 sender=org.freedesktop.DBus -> destination=:1.41 serial=33020 reply_serial=46355
   uint32 2
method call time=1654580882.342435 sender=:1.41 -> destination=org.freedesktop.DBus serial=46356 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner
   string "org.freedesktop.impl.portal.desktop.kde"
method return time=1654580882.342452 sender=org.freedesktop.DBus -> destination=:1.41 serial=33021 reply_serial=46356
   string ":1.320"
method call time=1654580882.342730 sender=:1.41 -> destination=:1.320 serial=46357 path=/org/freedesktop/portal/desktop/request/1_320/qt3989797115; interface=org.freedesktop.DBus.Properties; member=GetAll
   string "org.freedesktop.impl.portal.Request"
method call time=1654580882.343023 sender=:1.320 -> destination=org.freedesktop.DBus serial=6281 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',path='/org/freedesktop/portal/desktop/request/1_320/qt1418613426',interface='org.freedesktop.portal.Request',member='Response'"
error time=1654580882.343084 sender=:1.320 -> destination=:1.41 error_name=org.freedesktop.DBus.Error.UnknownObject reply_serial=46357
   string "No such object path '/org/freedesktop/portal/desktop/request/1_320/qt3989797115'"

I noticed that xdg-desktop-portal-kde seems to crash with infinite recursion (it tries to launch portal via qgnomeplatform and cause recursion ).

I wonder if it's possible add a blocklist in qgnomeplatform to forcibly not using portal for the portal program itself?

@grulja
Copy link
Collaborator

grulja commented Jun 7, 2022

That is indeed a weird setup.

This happens because you open a dialog using QGnomePlatform, which will use xdg-desktop-portal when possible in order to get native GTK dialogs, but because it goes to xdg-desktop-portal-kde and tries to open a native dialog from there and you have QGnomePlatform loaded, it again calls xdg-desktop-portal and over and over.

Unfortunately I have no idea how to break this cycle. I will try to think about it.

@wengxt
Copy link
Author

wengxt commented Jun 7, 2022

I guess one way is to check whether current process is kde portal by checking value of QCoreApplication::applicationName (or some other similar way). If detected, fallback to a non-portal code path.

@grulja
Copy link
Collaborator

grulja commented Jun 7, 2022

I guess one way is to check whether current process is kde portal by checking value of QCoreApplication::applicationName (or some other similar way). If detected, fallback to a non-portal code path.

Good idea. I will try that.

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

No branches or pull requests

2 participants