Closed IgnorantGuru closed 11 years ago
Debug info has been added so please update to the latest next branch before providing the above info. This doesn't appear to be a simple failure of workspace detection as spacefm should fall back to old behavior in that case, so unable to reproduce this.
After updating please run in a terminal:
killall spacefm
spacefm
Then run 'spacefm -r DIR', and provide the output from the original terminal. Also please provide items 1-5 above - thanks.
hya
1) Your desktop manager in use none 2) Your window manager i3 window manager 3) Is the window manager set to do anything unusual with the spacefm window, eg move to another workspace (aka desktop), stick it to all workspaces, etc? yes i define spacefm to always open on desktop #6, but the addtional window also opens up in the right dsektop. 4) The output of spacefm --version spacefm-git-20130307-1 5) Does omitting the '-r' also open a new window? yes 6) If you run the first instance of spacefm in a terminal, are any warnings printed? so the thing is if i run the command in the terminal it seems to not launch the additonal window. attached is the term output for issuing within the terminal and via keyboard bind:
handle_parsed_commandline_args files = (nil) get_current_desktop_index = 2 fm_main_window_get_on_current_desktop = (nil) new_tab handle_parsed_commandline_args mw = 0x17b6020
handle_parsed_commandline_args files = 0x203a130 get_current_desktop_index = 2 fm_main_window_get_on_current_desktop = 0x17b6020 reuse_tab handle_parsed_commandline_args mw = 0x17b6020
handle_parsed_commandline_args files = 0x202ef30 get_current_desktop_index = 2 fm_main_window_get_on_current_desktop = 0x17b6020 reuse_tab handle_parsed_commandline_args mw = 0x17b6020
TASK_COMMAND=spacefm -r /home/zeltak/ SPAWN=/bin/bash /tmp/spacefm-zeltak-0e9a5cdc.tmp/1c4bc7ee-tmp.sh run pid = 30219 handle_parsed_commandline_args files = 0x20a2e10 get_current_desktop_index = 5 fm_main_window_get_on_current_desktop = (nil) reuse_tab child finished pid=30219 exit_status=0 handle_parsed_commandline_args mw = 0x17b6300
TASK_COMMAND=spacefm /home/zeltak/Downloads SPAWN=/bin/bash /tmp/spacefm-zeltak-0e9a5cdc.tmp/06464070-tmp.sh run pid = 30536 handle_parsed_commandline_args files = 0x23b11f0 get_current_desktop_index = 5 fm_main_window_get_on_current_desktop = (nil) new_tab child finished pid=30536 exit_status=0 handle_parsed_commandline_args mw = 0x17b65e0
TASK_COMMAND=spacefm -r /home/zeltak/ SPAWN=/bin/bash /tmp/spacefm-zeltak-0e9a5cdc.tmp/38bb9ef9-tmp.sh run pid = 30946 handle_parsed_commandline_args files = 0x26ccf80 get_current_desktop_index = 5 fm_main_window_get_on_current_desktop = (nil) reuse_tab child finished pid=30946 exit_status=0 handle_parsed_commandline_args mw = 0x17b68c0
hope this helps
thx
Z
Thanks for the info. In 74111f8, spacefm began looking at what workspace existing windows are on when opening a new window or tab. One problem with this is the gtk function for determining what workspace a window is on does not work properly. As I could not find other code for this thus far, spacefm is not aware when a window changes workspace. It simply notes what workspace a window is on when the window is first created. While this is not ideal, it's better than the previous behavior of not opening a new window on the current workspace if a window is open on another workspace.
I think your problem is that the original spacefm window is opened on desktop 3, but you have your window manager set to move it to desktop 6. spacefm thus thinks the first window is still on desktop 3. When you use -r to open a new DIR, it doesn't find any spacefm windows on desktop 6, so it opens a new one. However, subsequent -r commands should reuse the second window, so at most you should see two windows. If you close the first window the problem should clear.
Probably if you remove the window manager rule that moves it to desktop 6 this will avoid the problem. I'll leave this issue open pending further methods for determining a window's workspace.
Submitted a gtk bug report
IgnorantGuru : For workspace checks (and also compatibility with virtual workspaces as well, which are slightly less straightforward) what you'd want to do is either use libwnck or look at how libwnck does those functions. I've had to use it myself, so I can point you to how to do that.
@zeltak: This problem should now be corrected in next - spacefm should find a window on the current desktop, even if it was moved, and will also detect windows stuck to all workspaces. Please update and test. If there is still a problem, please run in a terminal:
killall spacefm
spacefm
Then run 'spacefm -r DIR', and provide the output from the original terminal.
@BwackNinja: Thanks for the suggestion, I'll keep libwnck in mind. In this case getting the desktop of an arbitrary window actually wasn't so bad, just poorly documented. Just need to get atom _NET_WM_DESKTOP instead of _NET_CURRENT_DESKTOP.
thx ignorantguru works well now
best
Z
Thanks for testing.
Received elsewhere:
Changes introduced in https://github.com/IgnorantGuru/spacefm/commit/74111f863034defc4f1f6b9fb84c112e8abd1bb2 may be causing this - perhaps workspace detection is failing. I may add some debug code for this to the next branch shortly. In the meantime anyone who sees this please provide:
1) Your desktop manager in use
2) Your window manager
3) Is the window manager set to do anything unusual with the spacefm window, eg move to another workspace (aka desktop), stick it to all workspaces, etc?
4) The output of spacefm --version
5) Does omitting the '-r' also open a new window?
6) If you run the first instance of spacefm in a terminal, are any warnings printed?
As a temporary workaround, instead of
you can probably use