gmc-holle / xfdashboard

Maybe a Gnome shell like dashboard for Xfce
GNU General Public License v2.0
120 stars 14 forks source link

Click on icon in quicklaunch should activate running instance instead of starting new one #97

Closed gmc-holle closed 9 years ago

gmc-holle commented 9 years ago

Add an option to switch between the following behaviours when clicking an icon in quicklaunch:

alejandro-perez commented 9 years ago

Makes total sense. Thanks!

alejandro-perez commented 9 years ago

BTW, dragging the icon should always create a new instance :)

gmc-holle commented 9 years ago

This behaviour is now implemented with last commit 7205d024a4d7ecdaf41c17b2269700582a8908fc

alejandro-perez commented 9 years ago

Thanks! I've tried it and it seems to work pretty well!

A minor issue is that, if possible, I'd rather prefer switching the active workspace to the one where the window is, instead of moving the window to the active one.

For instance, if I have a terminal in WS 2, but I'm at WS 4 watching youtube, I'd like to click on the terminal on the left and be moved to WS 2, raising (if needed) the terminal window.

If you don't like this behaviour, just omit my comment. Thanks anyway!!!!!

gmc-holle commented 9 years ago

Sorry, I haven't tested this behaviour :( And no, it wasn't intented to move the window to the current workspace. It should behave exactly the way you describe.

Should be fixed with commit 2f77e9a85ae1a865a955731542f3abafb34abf7f

alejandro-perez commented 9 years ago

It is, thanks!

That's an awesome response time!

Thanks again!

userxfce commented 9 years ago

Wow. This alone and it already deserves a release!

alejandro-perez commented 9 years ago

Hi,

there should be a minor error somewhere. For some reason, Kile (latex editor) is not shown in the left panel (running apps), although it is shown in the window list. See the attached snapshot. Kile is the app under the mouse pointer, but not shown on the left panel. Other KDE apps are shown, so I wonder why this particular one does not show. I does happen in daemon and non-daemon mode.

snapshot

alejandro-perez commented 9 years ago

BTW, as its current state, for me this is as usable as GNOME Shell (or even more), 100 times faster, and as stable. It has bugs, but GS does too.

Great job, truly.

gmc-holle commented 9 years ago

It depends how this application was started and what informationen are provided by the system.

At the moment xfdashboard tries the following in this order:

1.) Get process ID of the window and check for enviroment variables of this process for GIO_LAUNCHED_DESKTOP_FILE and GIO_LAUNCHED_DESKTOP_FILE_PID. In addition check that the process ID stored in GIO_LAUNCHED_DESKTOP_FILE_PID matches the process ID of window. If it does the variable GIO_LAUNCHED_DESKTOP_FILE tells us the desktop file (e.g. firefox.desktop) which was used to launch this application.

2.) Get all possible instance name for this window, e.g. class name, instance name, and check if we can find one (and only one) corresponding desktop file.

Yeah and sadly 1.) only works for systems running Linux. *BSD is not supported as I don't have or use any BSD system.

So if this application "Kile" is not recognized then the algorithms above fail.

Assuming (and seeing at your screenshot) that the window title contains "Kile" you could start xfdashboard in non-daemon mode in a terminal window, debug messages turned on and filtered to "Kile". Use the following command to get the debug message, check them for privacy and post it here. Then I could try to find out what is going wrong.

G_MESSAGES_DEBUG=xfdashboard xfdashboard | grep -i kile
alejandro-perez commented 9 years ago

Hope this helps. As you can see, the icon and the window previous are ok.

(xfdashboard:6115): xfdashboard-DEBUG: Found desktop file '/usr/share/applications/kde4/kile.desktop' with desktop ID 'kde4-kile.desktop' at search path '/usr/share/applications'
(xfdashboard:6115): xfdashboard-DEBUG: Window 'erp-submission-rev1.tex – Kile' created
(xfdashboard:6115): xfdashboard-DEBUG: Enviroment set at /proc/4635/environ is 1317 bytes long for window 'erp-submission-rev1.tex – Kile'
(xfdashboard:6115): xfdashboard-DEBUG: Resolved enviroment variables of window 'erp-submission-rev1.tex – Kile' to desktop ID '<nil>'
(xfdashboard:6115): xfdashboard-DEBUG: Resolved window names of 'erp-submission-rev1.tex – Kile' to desktop ID '<nil>'
(xfdashboard:6115): xfdashboard-DEBUG: Could not resolve window 'erp-submission-rev1.tex – Kile' to any desktop ID
(xfdashboard:6115): xfdashboard-DEBUG: Could not create texture for window 'erp-submission-rev1.tex – Kile': Unable to query pixmap size
(xfdashboard:6115): xfdashboard-DEBUG: Successfully suspended live texture updates for window 'erp-submission-rev1.tex – Kile'
(xfdashboard:6115): xfdashboard-DEBUG: Resuming live texture updates for window 'erp-submission-rev1.tex – Kile'
(xfdashboard:6115): xfdashboard-DEBUG: Added window content for 'erp-submission-rev1.tex – Kile' with ref-count 1
(xfdashboard:6115): xfdashboard-DEBUG: Released resources for window 'erp-submission-rev1.tex – Kile' to handle live texture updates
(xfdashboard:6115): xfdashboard-DEBUG: Removing window content for window 'erp-submission-rev1.tex – Kile' with ref-count 1
gmc-holle commented 9 years ago

Yes, I see. Did you start "Kile" via xfdashboard or did you start it in a different way?

Anyway, both ways to resolve window names to application desktop files do not work for this application. I have another idea for a third algorithm to resolve the window to an application but it is only an idea. So far it is not easy to implement and may be error-prone :(

alejandro-perez commented 9 years ago

I runned it both ways, and it failed :(

Ok, I'll check it whenever it is ready, no rushes :)

Thanks!

gmc-holle commented 9 years ago

I think I found the reason why - at least - the second method did not recognize your application "kile" is running. But it is a different issue so I created a new issue #99 to track it and I'll keep this one closed.

alejandro-perez commented 9 years ago

Makes sense to me. Thanks