Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

schortcut doesn't work #661

Closed
Cherkah opened this issue Mar 10, 2024 · 23 comments
Closed

schortcut doesn't work #661

Cherkah opened this issue Mar 10, 2024 · 23 comments
Labels
bug Something isn't working

Comments

@Cherkah
Copy link

Cherkah commented Mar 10, 2024

the crow shortcuts does work:

  • neither for pop-up nor main window && notification
  • the text is not captured for transmission to the program.

Steps to reproduce

  1. put/keep Crow in system shortcut settings
  2. select the translation required mode (e.g pop-up) in the app settings -> General & be online
  3. open any file / web browser with text that you want to translate
  4. select your text in and press on the default keys (ctr-alt-e) to translate
  5. observe no pop-up or no notification or no translation text in the main window

Expected behavior
translate my text selection or at least see my selection in the main window

Environment (archlinux)

  • OS: endeavours
  • Desktop environment: KDE plasma 6 + Wayland + Nvidia gpu
  • Crow Translate version: 2.11.1

Additional context
debug info: if you give me a Strace statement to provide you technical info about this issue because i do not observe any relevant info about shortcut issue so fare

@Cherkah Cherkah added the bug Something isn't working label Mar 10, 2024
@Shatur
Copy link
Member

Shatur commented Mar 10, 2024

Could you try the following command in console?

qdbus io.crow_translate.CrowTranslate /io/crow_translate/CrowTranslate/MainWindow open

@Cherkah
Copy link
Author

Cherkah commented Mar 10, 2024

i did it (qdbus V5) and the main window appear and nothing else.
do you expect something else?

@Shatur
Copy link
Member

Shatur commented Mar 10, 2024

That's expected! So you have D-Bus working.
Now select something and try the following:

qdbus io.crow_translate.CrowTranslate /io/crow_translate/CrowTranslate/MainWindow translateSelection

@Cherkah
Copy link
Author

Cherkah commented Mar 10, 2024

works as expected.

@Shatur
Copy link
Member

Shatur commented Mar 10, 2024

Great!
It means that Crow is working as expected and the issue in shortcut registration on Plasma side.
Try removing Crow from global shortcuts in system settings and adding it back.

@Cherkah
Copy link
Author

Cherkah commented Mar 10, 2024

ok adding it back + installe Qdbus v5 (the app is still in Qt v5) do the tricks.

thanks

@Shatur
Copy link
Member

Shatur commented Mar 10, 2024

Glad to hear!

@Cherkah
Copy link
Author

Cherkah commented Mar 10, 2024

an other thing:
add Crow from global shortcuts in system settings do not remain after reboot.
i must add it each time i reboot the device !
do you have any idea ?

@Shatur
Copy link
Member

Shatur commented Mar 10, 2024

Noticed it too, but I afraid that it's a Plasma 6 issue :(

@Cherkah
Copy link
Author

Cherkah commented Mar 10, 2024

ok i'm gonna to pointed it out to bugs.kde platform.
You did your best.
if you already reported it on this platform maybe you can provide the link so that i can write something on it ?!

regards

@Shatur
Copy link
Member

Shatur commented Mar 10, 2024

ok i'm gonna to pointed it out to bugs.kde platform.

It would be great.

if you already reported it on this platform maybe you can provide the link so that i can write something on it ?!

No, I didn't open a bug report about this. Feel free to report it.
Looks like global shortcuts registered by .desktop files like this:

[Desktop Action TranslateSelectedText]
Exec=qdbus io.crow_translate.CrowTranslate /io/crow_translate/CrowTranslate/MainWindow translateSelection
Name=Translate selected text
Name[fi_FI]=Käännä valittu teksti
Name[pt_PT]=Traduzir o texto selecionado
Name[ru_RU]=Перевести выделенный текст
X-KDE-Shortcuts=Ctrl+Alt+E

doesn't persist after reboot.

@Cherkah
Copy link
Author

Cherkah commented Mar 10, 2024

@Shatur find below the answer from bugs.kde.org:

https://bugs.kde.org/show_bug.cgi?id=483086

Nicolas Fella nicolas.fella@gmx.de changed:

       What    |Removed                     |Added

         Status|REPORTED                    |RESOLVED
     Resolution|---                         |UPSTREAM

--- Comment #4 from Nicolas Fella nicolas.fella@gmx.de ---
These applications need to be adjusted to support global shortcuts on Wayland.

Please contact the application's author and ask them to implement the Global
Shortcuts portal:
https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.GlobalShortcuts.html

@Shatur
Copy link
Member

Shatur commented Mar 10, 2024

You reported it wrong. Shortcuts do work. They don't persist between reboots, that's the bug.

@nicolasfella
Copy link

@Shatur find below the answer from bugs.kde.org:

https://bugs.kde.org/show_bug.cgi?id=483086

Nicolas Fella nicolas.fella@gmx.de changed:

       What    |Removed                     |Added
         Status|REPORTED                    |RESOLVED
     Resolution|---                         |UPSTREAM

--- Comment #4 from Nicolas Fella nicolas.fella@gmx.de --- These applications need to be adjusted to support global shortcuts on Wayland.

Please contact the application's author and ask them to implement the Global Shortcuts portal: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.GlobalShortcuts.html

This was referring to global shortcuts based on QHotKey, which does not work on Wayland. The proper way to do these kinds of shortcuts is to use the portal.

Defining shortcuts via desktop file actions is supposed to work, and I see where it's going wrong. https://invent.kde.org/plasma/kglobalacceld/-/merge_requests/46 fixes that

@Shatur
Copy link
Member

Shatur commented Mar 16, 2024

This was referring to global shortcuts based on QHotKey, which does not work on Wayland. The proper way to do these kinds of shortcuts is to use the portal.

Yep! We support both, QHotkey for X11 and shortcuts for in .desktop for Wayland.

https://invent.kde.org/plasma/kglobalacceld/-/merge_requests/46 fixes that

I guess so. Shortcuts from .desktop work by itself, but after reboot I need to remove and add the app back in the global shortcuts settings.

@Shatur
Copy link
Member

Shatur commented Mar 20, 2024

Opened a bug report: https://bugs.kde.org/show_bug.cgi?id=484093

@dmnmsc
Copy link
Contributor

dmnmsc commented Apr 2, 2024

That's expected! So you have D-Bus working. Now select something and try the following:

qdbus io.crow_translate.CrowTranslate /io/crow_translate/CrowTranslate/MainWindow translateSelection

For some reason in-app shortcuts are not working in gnome (wayland session) either. But setting the same shortcut with gnome system shortcuts and adding this line as a command works as expected.

@Shatur
Copy link
Member

Shatur commented Apr 2, 2024

For some reason in-app shortcuts are not working in gnome (wayland session) either.

Yes, it's expected. Wayland doesn't provide API for global shortcuts, you need to register them yourself. KDE just have a convenient feature to define shortcuts in .desktop file and import them in settings.

@dmnmsc
Copy link
Contributor

dmnmsc commented Apr 2, 2024

KDE just have a convenient feature to define shortcuts in .desktop file and import them in settings.

Oh, didn't know about this KDE feature. Thanks.

Maybe a "how to translate selected text in wayland" explanation in the readme helps non-techie users like me.

Anyway, thanks for creating this amazing app!

@Shatur
Copy link
Member

Shatur commented Apr 2, 2024

Maybe a "how to translate selected text in wayland" explanation in the readme helps non-techie users like me.

Yes, I think it's a good idea... Maybe you can open a PR?

@dmnmsc
Copy link
Contributor

dmnmsc commented Apr 3, 2024

Sure! Already done.

@Cherkah
Copy link
Author

Cherkah commented Jun 29, 2024

@Shatur : the same issue still occured.
with a popup: impossible de trouver le programme « qdbus.

qdbus io.crow_translate.CrowTranslate /io/crow_translate/CrowTranslate/MainWindow translateSelection

the code above works only if i replace qdbus by qdbus6

qdbus6 io.crow_translate.CrowTranslate /io/crow_translate/CrowTranslate/MainWindow translateSelection

Operating System: EndeavourOS
KDE Plasma Version: 6.1.1
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2
Graphics Platform: Wayland

@Shatur
Copy link
Member

Shatur commented Jun 29, 2024

It's because on your system you have qdbus6 instead of qdbus. I will autodetect it in the next release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Development

No branches or pull requests

4 participants