Commit Graph

6786 Commits

Author SHA1 Message Date
Uli Schlachter 5cbd4402d9 awful.autofocus: Handle sticky clients (#603)
Closes https://github.com/awesomeWM/awesome/pull/610.
Fixes https://github.com/awesomeWM/awesome/issues/603.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-31 15:33:51 +01:00
Emmanuel Lepage Vallee bd8e2d2ca8 typo: replace 'wibox' with 'context' where relevant
Closes https://github.com/awesomeWM/awesome/pull/613.
2015-12-31 15:33:22 +01:00
Daniel Hahler 9fec4f71bc Merge pull request #605 from psychon/api-doc
Fix API documentation broken in eb8577a424
2015-12-23 18:14:07 +01:00
Daniel Hahler 908950376e Merge pull request #609 from psychon/icons
Fix client icons
2015-12-23 18:10:18 +01:00
Uli Schlachter b2be471faf Fix icons
Since commit ea94f7f7e6, the code has a preferred icon size and it tries to
find the closest matching icon. However, the default size of 0 and thus this
never returned any icon at all (no icon matches better than an icon of size
0x0).

Fix this by saying "every icon is better than no icon at all".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-23 14:19:18 +01:00
Uli Schlachter daff5cd58b Refactor _NET_WM_ICON parsing
This shouldn't change the logic here, but hopefully makes it easier to
understand.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-23 14:16:24 +01:00
Uli Schlachter 16994f3b12 Fix API documentation broken in eb8577a424
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-22 18:31:48 +01:00
Uli Schlachter 4ad516c63a Remove some unused fields from globalconf
These fields were only ever written to since commit 19137a55c3.
This commit removes the fields and the code that sets them.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-22 17:25:45 +01:00
Uli Schlachter b70af4cf2b Fix regrabbing of keys on layout change
In commit 532ec0cd, we started grabbing keys on the client window directly
instead of its parent window (the frame window). This commit fixes one place
which was overlooked back then.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-22 17:24:01 +01:00
Daniel Hahler 0eac1ee91e Travis: use travis_retry with `apt-get update`
Ref: https://travis-ci.org/awesomeWM/awesome/jobs/96732636
2015-12-17 00:22:23 +01:00
Uli Schlachter a86d1137ee Select button press/release events on drawins
Some words about X11 event handling: Every X11 client can select input on any
window. For this, inside the X11 server each window has for each client a
bitmask for the kind of events that this client is interested in. When a mouse
button is pressed inside of a window, a corresponding event is generated for
that window and sent to all X11 clients which asked for
XCB_EVENT_MASK_BUTTON_PRESS. When no client is interested in this event, the
event is propagated to the parent window and the same procedure is done again
here. This continues up until the root window is reached.

Some words about the event masks that awesome uses: For clients, we ask for
button press events on the frame window that we reparent the client window into
so that we get any kind of press on the titlebar (and also events inside of the
client window if the client itself doesn't care for click events?). We are also
interested in button presses / releases on the root window. However, before this
commit, we didn't actually ask for button events on drawins (e.g. the wibox).
This worked fine, because no one asked for these events and the event propagated
to the root window where it was then sent to awesome.

However, newer Qt versions do something weird and the above broke. I don't
actually know what is going on. I know about the above propagation rules, but
looking at protocol traces of what Qt does, awesome should still get the button
events. During startup, Qt asks for button events on its own windows. After a
hotplug event, it asks the same again, but now also includes the root window.
So... how can Qt asking for button events on the root window cause awesome not
to get them? I have no idea.

(And yes, I guess that Qt asking for mouse events on the root window is a bug,
but I have no idea how exactly this happens nor about any other side effects of
it).

This commit makes us ask for button events on our drawins so that the server
will send them to us. This is the right thing to do anyway and it was reported
to have some positive effects.

Ref: https://github.com/awesomeWM/awesome/issues/415
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-13 18:10:29 +01:00
Daniel Hahler 15a242d195 Merge pull request #578 from lukash/client_icon_size
Add an option to set the preferred client icon size
2015-12-13 15:41:13 +01:00
Daniel Hahler f7fcee76df Merge pull request #594 from blueyed/pr-552
Add an optional filter to `awful.menu.clients`
2015-12-12 21:19:32 +01:00
Daniel Hahler 9031a81396 doc fixes to awful.menu.clients 2015-12-12 20:12:08 +01:00
Dario Gjorgjevski c5ad6069d4 Add an optional filter to `awful.menu.clients` 2015-12-12 20:12:08 +01:00
Daniel Hahler ae5d4b5512 Merge pull request #571 from psychon/scrolling_layout
Add a scroll layout
2015-12-12 20:01:32 +01:00
Daniel Hahler 833b10eb9b Merge pull request #593 from psychon/editorconfig
Vim modelines and editorconfig
2015-12-12 19:13:53 +01:00
Daniel Hahler 981987764e Merge pull request #586 from psychon/widget_funcs
Widgets: set_width / set_height
2015-12-12 19:13:28 +01:00
Daniel Hahler 69da6ee0db Merge pull request #576 from psychon/spawn_exit_code
At exit code support to spawn
2015-12-12 19:10:48 +01:00
Uli Schlachter feb7b36728 Add an EditorConfig file
I didn't (and couldn't) actually test this in any way, but hopefully this makes
it easier to edit awesome's source without vim.

Thanks to Daniel Hahler for telling me about this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-12 17:48:42 +01:00
Uli Schlachter 63653bed76 Add the right vim modeline to all lua files
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-12 17:42:33 +01:00
Uli Schlachter a141370704 Add a vim modeline to all C source
Most of the files already had this, at least.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-12 17:42:16 +01:00
Uli Schlachter 5db6c04c42 Add vim modelines to all shell scripts
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-12 17:36:35 +01:00
Uli Schlachter 469433e10a awful.spawn.with_line_callback: Use an arguments table
Having many arguments can easily get confusing and hard to understand. This
commit uses a table instead so that we have names that identify what each
callback does.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-12 17:27:33 +01:00
Daniel Hahler e39504a30f Make textbox widget respect the current theme
Without this fix `wibox.widget.textbox` ignores current theme font
setting and resets it to the initial one.
It becomes handy when the initial theme is tweaked during runtime, ie.
in `rc.lua`. Other AwesomeWM components like `awful` (taglist,
tasklist, menu) are aware and do respect the actual theme settings.

Closes https://github.com/awesomeWM/awesome/pull/89.
2015-12-11 00:55:33 +01:00
Uli Schlachter ce965424c3 gears.object:weak_connect_signal: Use a weak-value table (#520)
Lua will remove objects as values from a weak table before these objects are
finalized, but as values only in the next garbage collection cycle after the
object was finalized. Up to now, gears.object uses a table with weak keys so
that :disconnect_signal() works. This means that a signal can still call methods
which were already considered garbage by the garbage collector and thus can use
userdata from the C side which was already finalized. Crashes and other bugs
result.

This commit changes the code so that the function is also a value in the weak
table. Thus, the GC will remove the entry before the object is finalized.

Special magic is needed for Lua 5.1, because there only userdata has the
behavior that we want while we have a function. We do some magic with function
environments to make this work...

Closes https://github.com/awesomeWM/awesome/pull/567.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-10 23:19:52 +01:00
Uli Schlachter 0fdecfb2df Add a test case capturing problems with weak_connect_signal (#520)
This adds a cyclic dependency between the function used for the weak signal and
an object with a __gc metamethod. The problem occurs since the GC will first
finalize the object (call its __gc metamethod) and only in the next generation
will it actually collect the garbage and remove the functions from weak-tables
using it as a key.

And yes this needs special code for Lua 5.1 because there __gc doesn't work on
tables. :-(

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-10 23:19:52 +01:00
Uli Schlachter 970a92bb51 spec for gears.object: Test weak signals better
Since weak signals specifically exist to do magic with the garbage collector, do
a couple of garbage collection cycles and verify that this does not disconnect
the callback function prematurely (the function is kept alive since it is a
local variable).

(I actually did a mistake that makes this enhanced test fail and fixed it before
committing)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-10 23:19:52 +01:00
actionless eb8577a424 feat(lib: menubar): dpi support in menubar
Closes https://github.com/awesomeWM/awesome/pull/580.
2015-12-10 23:18:43 +01:00
Barlik f6d08274a6 Use integer size when creating titlebar
Closes https://github.com/awesomeWM/awesome/pull/584.
2015-12-10 23:13:24 +01:00
Lukáš Hrázký ea94f7f7e6 add an option to set the preferred client icon size
_NET_WM_ICON contains a list of icons and until now, the first one was
picked without regard to it's size. This adds a global option to set
the preferred icon size. When getting the client icon, the best size
match is picked. The size can be set via
awesome.set_preferred_icon_size() and the default is 0, which will pick
the smallest non-zero size icon available.

Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
2015-12-07 22:59:32 +01:00
ShadowKyogre 742cbd7122 Call :set_bg for the mouse finder's wibox
Before this, it was trying to assign it to `.bg`, which isn't how
backgrounds are stored on wiboxes.

Closes https://github.com/awesomeWM/awesome/pull/587.
2015-12-06 19:33:13 +01:00
Uli Schlachter f4077def8e Add :set_{width,height} to widgets (#291)
This adds new functions to all widgets that allow to force a specific
width/height. These values override the result from :fit().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-05 12:31:33 +01:00
Uli Schlachter c2be60fb54 wibox.widget.base: Factor out functions available on all widgets
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-05 12:25:25 +01:00
actionless 0516203610 feat(lib: awful: hotkeys_popup): widget to show awesome and third-party keybindings
Closes https://github.com/awesomeWM/awesome/pull/421.
2015-12-02 01:02:15 +01:00
dyslesiq ecf6b55b55 Added value check of required 'Name' entry in .desktop parsing
Closes https://github.com/awesomeWM/awesome/pull/574.
2015-12-01 20:17:21 +01:00
Uli Schlachter 97048de60e Remove useless information from awesome -v
Most of this information isn't interesting. If you are getting awesome from a
distro, then the time, hostname and username of the build are likely 'random
stuff' and if you are building awesome yourself, then the hostname and username
are obviously yours and the time can still be interfered based on the awesome's
binary ctime.

The GCC version shouldn't make any difference at all.

Closes https://github.com/awesomeWM/awesome/pull/566.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-01 20:17:21 +01:00
Daniel Hahler 56e85d45d4 default config: enhance list of default floating clients
Closes https://github.com/awesomeWM/awesome/pull/329
2015-12-01 20:17:21 +01:00
Uli Schlachter c02969bb0e wibox.widget.systray: Also emit redraw_needed
When emitting layout_changed, the widget is relayouted. If this doesn't actually
change anything, nothing will be redrawn. Thus, this also emits redraw_needed to
force redraws.

This fixes a race condition with some weird tray icons. A new tray icon is
created and the systray is updated. Then this new icon is destroyed immediately
again and at the same time another icon is created. Then, the systray isn't
updated since the number of icons (=the layout) did not actually change.
However, it needs to be updated and so we ended up with broken/missing icons.

Fixes: https://github.com/awesomeWM/awesome/issues/487
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-29 12:33:13 +01:00
Uli Schlachter 2f5ade49c2 test-spawn.lua: Also test exit statuses
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-29 11:57:35 +01:00
Uli Schlachter 44a3e27e81 awful.spawn.with_line_callback: Add exit callback
This adds support for the callback that was added in the previous commit to this
function. We can just pass on the function that the caller gives us.

Fixes: https://github.com/awesomeWM/awesome/issues/185
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-29 11:56:05 +01:00
Uli Schlachter a8ac146bd0 awesome.spawn: Add exit status support
This adds a new argument to awesome.spawn. This argument is a function that will
be called with the exit status once the spawned process terminates. For normal
exit, the function is called with "exit" and the exit code. If the process is
terminated by a signal, the function will be called with "signal" and the signal
number of the signal that caused termination.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-29 11:53:12 +01:00
Uli Schlachter 1c8aa0f5f4 Add a scroll layout
This allows scrolling a widget if there is too few space available. There are
several different modes available for how the scrolling "looks like".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-22 18:19:53 +01:00
Daniel Hahler 58bd21ad79 layout.arrange: fix screen arg in call to tag.getgap
Fixes https://github.com/awesomeWM/awesome/pull/568#issuecomment-158682756.
2015-11-22 00:30:21 +01:00
▟ ▖▟ ▖ 8557a7e0e4 properly flush dbus connection after send 2015-11-21 16:36:02 +01:00
▟ ▖▟ ▖ 33d4100ea0 prevent segfault when dbus signal creation failed 2015-11-21 16:35:52 +01:00
▟ ▖▟ ▖ e8d209fde6 fix typo 2015-11-21 16:35:42 +01:00
Frederik 0d2e6d2068 Get LuaRocks via HTTPS instead of HTTP
[ci skip]

Closes https://github.com/awesomeWM/awesome/pull/570.
2015-11-20 17:17:52 +01:00
Daniel Hahler 269bb90e18 Only use useless_gap with multiple tiled clients
Fixes https://github.com/awesomeWM/awesome/issues/564.
Closes https://github.com/awesomeWM/awesome/pull/568.
2015-11-20 17:17:21 +01:00
Uli Schlachter 6ca85af53b Set WM_CLASS and WM_NAME on all our windows (#551)
The only exception is the window for _NET_SUPPORTING_WM_CHECK. That window
already had a _NET_WM_NAME property before and doesn't get a WM_NAME property in
this commit. I just decided for myself that it doesn't need one. :-)

Right after startup with the default config we now have the following situation:

$ xwininfo -root -tree

xwininfo: Window id: 0x2d7 (the root window) (has no name)

  Root window id: 0x2d7 (the root window) (has no name)
  Parent window id: 0x0 (none)
     7 children:
     0x200011 "Awesome drawin": ("awesome" "awesome")  1500x20+0+0  +0+0
     0x200010 "Awesome drawin": ("awesome" "awesome")  1x1+0+0  +0+0
     0x20000d "Awesome drawin": ("awesome" "awesome")  100x30+0+0  +0+0
     0x20000a "Awesome no input window": ("awesome" "awesome")  1x1+-1+-1  +-1+-1
     0x200009 "Awesome systray window": ("awesome" "awesome")  1x1+-1+-1  +-1+-1
     0x200008 "awesome": ("awesome" "awesome")  1x1+-1+-1  +-1+-1
     0x200007 "Awesome WM_Sn selection owner window": ("awesome" "awesome")  1x1+-1+-1  +-1+-1

One of those drawin is the awful.wibox. Another drawin is created by awful.menu.
I guess that the third one is created by awful.tooltip, but I'm not sure. Wow,
so many windows...

Closes https://github.com/awesomeWM/awesome/pull/556.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-19 22:23:25 +01:00