You are not logged in.
Pages: 1
Topic closed
I want to have title bars in all my windows while I don't want to have the title bar in Chromium for example.
I've this in my rc.lua:
awful.rules.rules = {
-- All clients will match this rule.
{ rule = { },
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = true,
keys = clientkeys,
buttons = clientbuttons } },
...
{ rule = { class = "Chromium" },
properties = { border_width = 0 },
callback = awful.titlebar.remove }
}
And I uncommented this line to get title bars for all other windows:
awful.titlebar.add(c, { modkey = modkey })
But it seems like it doesn't work.
What am I doing wrong?
Thanks.
Last edited by mt22 (2012-06-07 07:48:13)
Offline
Hi,
I have something like this in my rc.lua:
function titlebar_add_with_settings(c)
awful.titlebar.add(c, { modkey = modkey, height = 16, font = "Terminus 6"})
end
awful.rules.rules = {
-- ...
{ rule = {},
except_any = { class = { "XTerm", "luakit", "Zathura" } },
callback = titlebar_add_with_settings
},
-- ...
}
I bet you'll end up with funny race conditions if you add the titlebar and then remove it later on. So I think it's better not to add it in the first place.
Offline
Thanks Vain it worked!
But what do you mean when you say that if I remove the titlebar later I'll end up with race conditions? Maybe are you saying that I remove it and then the rules are executed independently of that anyway?
If so, isn't there a better way to do that?
Offline
But what do you mean when you say that if I remove the titlebar later I'll end up with race conditions?
Well, you added a titlebar for all windows (this is done through the "manage" signal). Plus, using "rules", you removed the titlebar for some windows. So your code tried to do something like this:
A new window spawns.
["manage"] Add a titlebar.
["rules"] Remove the titlebar for some windows.
Are you sure that this always happens in this particular order? I am not. Maybe something like this happens instead:
A new window spawns.
["rules"] Remove the titlebar for some windows (ouch! there is none!)
["manage"] Add a titlebar.
2. and 3. are mixed up here. Now, all your windows still have titlebars.
See, I really don't know if the order of execution is guaranteed. I haven't read Awesome's source code regarding this issue. So, my code avoids the whole issue because only one action is involved:
A new window spawns.
["rules"] Add a titlebar iff it's not XTerm/luakit/whatever.
I think/hope this is the best way to do it.
Offline
Thanks for the clear explanation.
One last thing, I've noticed that if I add titlebars to windows (even to all windows, by only uncommenting that line as suggested in the official wiki) it happens that by switching to another workspace and switching back again to a workspace with tiling layout titlebars are not redrawn on all windows, and they only appear if I move the mouse.
I don't know if that's a bug or a strange behaviour that affect only my system, anyway to reproduce that behaviour:
1. Open at least 3 windows in a workspace with the tiling layout
2. Switch to another workspace
3. Switch back to the workspace of step 1
The titlebar of the window in the bottom right corner should disappear and reappear by moving the mouse to another window.
Do you know is that's normal? I'm using the last Awesome version (not the git one).
Offline
I've been using titlebars for quite a while and I've never seen anything like this. Can't reproduce it either.
Do you use something like xcompmgr? Could be related. Compositing always causes problems on my hardware, so I don't use it.
If you want to investigate further, I guess it's best to check the Awesome mailing lists.
Offline
At the moment I'm not using any compositing manager. Anyway, thanks fot the advice. I think I'll ask to the Awesome community.
Offline
What am I doing wrong?
Rules are interpreted before manage singnal is emitted and acted upon. You remove the titlebar at the time there was no titlebar.
I want to have title bars in all my windows while I don't want to have the title bar in Chromium
The simplest solution code wise is to apply reverse logic:
- In rules table you add the titlebar to windows you do not want to have a titlebar.
- In manage signal handler you remove titlebar from windows that already have it, and add it to all others
Proof of concept
<cut>
{ rule = { class = "Xmessage", instance = "xmessage" },
properties = { floating = true }, callback = awful.titlebar.add },
<cut>
client.add_signal("manage", function (c, startup)
if c.titlebar then awful.titlebar.remove(c)
else awful.titlebar.add(c, {modkey = modkey}) end
<cut>
You need to install an RTFM interface.
Offline
Thanks anrxc, it worked too.
About that strange behaviour of the disappearing titlebar I want to correct myself, first of all it does not properly "disappear", but sometimes it is covered by other overlapping windows, and moreover I noticed it mostly happens with terminal windows (3 terminal windows should be enough to reproduce the problem), I tried urxvt and then lxterminal, with the same result.
It is like window sizes were wrongly computed, it happens when I switch workspace and then back again (to the tiled one with the 3 terminals open) and then when I move the mouse over other windows, sizes are recomputed correctly.
anrxc, do you know anything about that?
Last edited by mt22 (2012-06-08 08:21:54)
Offline
Sounds like an old bug I vaguely remembe, but it should definitely not be present in v3.4.11.
I use titlebars only on floating windows, couldn't notice this. One last thing that comes to mind you are not ignoring size hints and maybe there is some weird interaction going on with those terminals size requests and titlebars which are drawn on top of them. Try to ignore size hints.
You need to install an RTFM interface.
Offline
Try to ignore size hints.
I've already tried that... same result unfortunately
At the moment in this debian machine I get:
~ $ awesome -v
awesome debian/3.4.11-1-1-g04eec72 (Pickapart)
• Build: Feb 6 2012 10:04:11 for x86_64 by gcc version 4.6.2 (@zelenka)
• D-Bus support: ✔
Offline
Make a backup copy of your rc.lua and start awesome with a copy of default rc.lua with exception of enabled titlebars. Try to reproduce the problem. If you can reproduce take some screenshots and post to the bug tracker https://awesome.naquadah.org/bugs/
You need to install an RTFM interface.
Offline
Maybe I'm a little late, but since I experienced the same problem and found a better solution I'm gonna post it:
Adding to the
awful.rules.rules = {
Just a titlebar boolean value on its own existence:
-- Titlebars
{ rule_any = { type = { "dialog", "normal" } },
properties = { titlebars_enabled = false } },
Offline
{ rule = {}, except_any = { class = { "XTerm", "luakit", "Zathura" } }, callback = titlebar_add_with_settings }
Sorry, for necro bumping, but this is little important for search engines indexing for folks who are finding it. Thanks BTW.
Experiment at-least.
Offline
And apparently it can still be found perfectly fine for a necrobump anyway.
Closing this old topic.
Offline
Pages: 1
Topic closed