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

Screen property doesn't work #8

Open
myuhe opened this issue Jan 12, 2013 · 8 comments
Open

Screen property doesn't work #8

myuhe opened this issue Jan 12, 2013 · 8 comments
Labels

Comments

@myuhe
Copy link

myuhe commented Jan 12, 2013

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.

@tbondarchuk
Copy link

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.

@jcharest
Copy link

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.

@cdump
Copy link
Owner

cdump commented Jan 24, 2013

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.

@criemen
Copy link

criemen commented Aug 25, 2013

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
Copy link

criemen commented Aug 25, 2013

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.

@socek
Copy link

socek commented Aug 25, 2013

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

@criemen
Copy link

criemen commented Aug 26, 2013

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

@MarceColl
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants