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

Geany doesn't get focus #3531

Open
sarduk opened this issue Jul 23, 2023 · 9 comments
Open

Geany doesn't get focus #3531

sarduk opened this issue Jul 23, 2023 · 9 comments
Labels
can't reproduce A developer couldn't reproduce the issue

Comments

@sarduk
Copy link

sarduk commented Jul 23, 2023

Ubuntu22.04 desktop with LUKS, GNOME 42.9
FileManager: Nautilus (alias Files) 42.6

I set Geany as the default application to open text files
from the FileManager GUI if i click on a .txt file then Geany doesn't get focus,
instead an alert/dialog is displayed which disappears after a few seconds,
this alert/dialog contains the geany logo and the file name,
to be able to assign focus to Geany I have to switch between running programs with ALT+TAB

I checked what happens with other editors
with Gedit and Libreoffice it doesn't occur, it only occurs with Geany
more specifically, it does not occur if you double-click on the file, then all works
however, it occurs if you open the context menu with the keyboard menu key > open file >

with Dconf Editor searched the Nautilus configurations
also searched in geany configurations ~/.config/geany/geany.conf
still didn't solve

@elextr
Copy link
Member

elextr commented Jul 23, 2023

Since it works from the file manager this looks most likely to be your desktop setup. Set the keyboard shortcut to run exactly the same command as the file manager runs on double click.

The dialog with Geany logo and the filename is not something Geany creates AFAIK, its more likely to be your desktop.

@ineuw
Copy link

ineuw commented Aug 6, 2023

It is not a mystery, and has nothing to do with Geany. I have the identical issue, and have been researching and studying the topic for months. I am also using Kubuntu 22.04.2, and its GTK/Gnome relative, Linux Mint Cinnamon 21.2.

The initial focus acquiring behavior was taken over by the window one is working in. In this context, the desktop is counted as a window. This also applies to opening Firefox where the home page is DuckDuckGo.

Running Geany, or any other software, from a .sh file, is the only quick solution I can think of. This would set the focus after Geany is open. 'xdotool click 1'. I haven't tried this particular code but most of my apps' .desktop files use .sh files to accommodate shell commands before or after starting an app.

I hope this helps, but I feel that this is not a good long term solution.

On the other hand, this may be resolved from within Geany.

@elextr
Copy link
Member

elextr commented Aug 6, 2023

I hope this helps, but I feel that this is not a good long term solution.

Correct, X11 tools don't necessarily work on Wayland systems which is where the world is going.

On the other hand, this may be resolved from within Geany.

This part cannot, see #3538 (comment)

@AmvrakiaFm
Copy link

AmvrakiaFm commented Aug 14, 2023

Same here, Ubuntu 22.04 & 23.04.
Very annoying, I have to click twice every time. Even if I reload a file from Filezilla, I have to click on Geany to get it on screen. Please, find a way to fix this.

@elextr
Copy link
Member

elextr commented Aug 14, 2023

First a comment, with Linux Mint Cinnamon, default settings, open-in-geany in the file manager (Nemo) always brings Geany to the front with the notebook page containing the selected file having focus, both when Geany is first started, and when the selected file is added to an open instance.

Everybody who is complaining, the problem is not with Geany, it is with your window manager and/or the settings you use that tell the window manager not to grant Geany's focus request. Perhaps enquire on your window manager support what settings need to be changed, or if you need to use a different window manager.

@AmvrakiaFm
Copy link

Any other apps, working perfect. They get focus. Everything exept Ver.38 of Geany.
Damn, I wish had never update!

@elextr elextr added the can't reproduce A developer couldn't reproduce the issue label Aug 16, 2023
@elextr
Copy link
Member

elextr commented Aug 16, 2023

As I said, it works for me, and I presume for other main contributors to Geany since none have commented. Since it can't be reproduced "somebody" who has the problem needs to provide a reproducing environment and debug what if anything other apps do different to Geany if they work.

Note that Geany is a portable GTK application available on Gnome, KDE, Xfce, Windows, Macos so it does not use any desktop specific APIs that other less portable apps might use. But if "somebody" wants to contribute and support a desktop portability library for such specific functions it would likely be accepted.

@ineuw
Copy link

ineuw commented Sep 11, 2023

I forgot to mention that my comments are exclusively about the X11 windowing system. Also, that apps can monitor movement and easily set focus to themselves. Of the two apps mentioned, I know observed that LibreOffice has a history of increasing sophistication.

@elextr
Copy link
Member

elextr commented Sep 12, 2023

Note that Geany is a portable GTK application available on Gnome, KDE, Xfce, Windows, Macos so it does not use any desktop specific APIs

To be clear, Gedit is a Gnome application, it is "integrated with that desktop" to quote the linked page, not a plain GTK application like Geany.

As @ineuw says Libreoffice has the resources to maintain integration with individual desktops, so for example Debian has a libreoffice-gnome integration package and I am aware of an evolution integration package and I am sure it has specific integration with Windows and Macos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can't reproduce A developer couldn't reproduce the issue
Projects
None yet
Development

No branches or pull requests

4 participants