awesome-shifty icon indicating copy to clipboard operation
awesome-shifty copied to clipboard

Screen property doesn't work

Open myuhe opened this issue 12 years ago • 8 comments

My rc.lua is

shifty.config.tags  = {
   emacs         = {layout = awful.layout.suit.max, init = false, float = false ,position = 1, screen = 1, mwfact = 0.40, spawn = "emacs"},
   www           = {leave_kills = true, position = 7, screen = 2, spawn = "firefox"}
}

Then, emacs tag shold be shown on screen 1, and www tag shold be shown on screen 2 too.

But each tag is shown on screen mouse hovered.

myuhe avatar Jan 12 '13 00:01 myuhe

Confirmed.

Despite tag's screen value, all tags are creating on mouse hovered screen. Only tags with init=true are creating on proper screen. Also, windows, moved to another screen by "modkey+o" do not appear on target screen.

tbondarchuk avatar Jan 14 '13 12:01 tbondarchuk

I experience the same issue. Although in my case it also does not work with tags with init=true (unless i move cursor on second screen). Could it be the spawn function that does not obey the scr param ?

I am running awesome 3.5-2 on arch linux.

jcharest avatar Jan 15 '13 18:01 jcharest

I have only 1 screen (and don't have free time now to trying emulate more screens), if anyone fix it and send me pull request - it will be great.

cdump avatar Jan 24 '13 07:01 cdump

I can't send a pull request (yet) because of my non-existant lua knowledge, but I've debugged the problem a bit so far. I'll describe what I found out now, I'lll post more information as I get them. The problem lies in the match function in init.lua. The target_screen local is initialized to the current screen, and only overwritten, if the shifty.config.apps entry contains a screen. Later, when a matching tag object for the tag name is searched, only the tag objects for the current screen are considered:

local sel = awful.tag.selectedlist(target_screen)

As the current screen may not be the designated screen for the tag, another tag is created on the current screen, even if on the target screen, the correct tag already exists because of init=true. I do not know what the proper fix would be, though, as tag creation always should take the specified screen, not the current, and probably a target screen defined in shifty.config.apps should beat shifty.config.tags. Also, tag creation in "translate target names to tag objects, creating missing ones" block does not honor the shifty.config.tags settings at all. @cdump , can you help here?

criemen avatar Aug 25 '13 11:08 criemen

Okay, I've got a workaround for the issue, but I don't know the implications of it. As my file is littered with debug statements, I can't really post a patch, but the changes made by me are: in the function set where the local scr is defined, I replaced "(not awful.tag.getscreen(t) and awful.tag.getscreen(preset)) or" with "preset.screen or" In the function match "name2tags(tn, target_screen) or" was removed, and I commented out "if awful.tag.getscreen(t) == mouse.screen then" and the corresponding "end" Now everything seems to work fine, but I'm not sure because I don't use all functions of shifty.

criemen avatar Aug 25 '13 13:08 criemen

This "patch" do not work for me. I still have "one big screen" instead of "two seperate sceens". :(

socek avatar Aug 25 '13 20:08 socek

I can post my whole "patch" which generates lots of debug informations I used during debugging, if you're able to read code, it may help you in understanding the problem, have a look here: https://gist.github.com/Corni/6344126

criemen avatar Aug 26 '13 17:08 criemen

Three years later the problem still exists.

I installed shifty today and after an hour or so of trying to use the screen property I decided to look at the source code.

The problem begins here: https://github.com/cdump/awesome-shifty/blob/master/init.lua#L367

spawn_with_shell is used with a scr second parameter, the problem is that the spawn_with_shell function in awful.util doesn't take a screen parameter.

It used to in 3.5 as seen here: https://github.com/awesomeWM/awesome/blob/v3.5/lib/awful/util.lua.in#L85-L90

but no longer in the later versions of awesome (v3.5.9): https://github.com/awesomeWM/awesome/blob/v3.5.9/lib/awful/util.lua.in#L86-L91

This makes the spawn propery useless because it spawns everything in the main screen always instead of using the tags.

Here in the actual spawn C code, it seems that by default default_screen is used. https://github.com/awesomeWM/awesome/blob/v3.5.9/spawn.c#L351-L362

MarceColl avatar Oct 21 '16 11:10 MarceColl