Commit Graph

1056 Commits

Author SHA1 Message Date
Uli Schlachter 67faf52bab Properly update multiple taglists
My recent refactoring accidentally made the taglist only connect to the signal
for the first screen on which a taglist is created. This commit fixes the code
so that it connects for all screens.

Fixes https://github.com/awesomeWM/awesome/issues/500

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-10-09 20:59:18 +02:00
actionless 0e3009936c feat(lib: awful: key): save current hotkeys 2015-09-30 13:17:12 +02:00
Uli Schlachter a71d12f07b awful.client.cycle: Fix API docs
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-29 00:28:26 +02:00
Uli Schlachter 3e9fdea650 test-leaks: Fix with Lua 5.1
I have no idea why this needs collectgarbage() to be called twice.

On the other hand, I can explain the change in tooltip.lua. Lua 5.2 introduced
"ephermeron tables". This means that in the following sitation, lua 5.2 can
collect the entry from the table, while 5.1 keeps the entry alive, because the
table has a strong reference to the value and that in turn has a strong
reference to the key:

  t = setmetatable({}, { __mode = "k"})
  do
    local k = {}
    t[k] = function() print(k) end
  end
  collectgarbage("collect")
  print(next(t, nil))

To handle this incompatibility, this commit just removes the whole indirection
through the module-level variable "data".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-27 16:04:20 +02:00
Uli Schlachter abc5a552a4 Make tasklist garbage-collectable
Again, instead of directly connecting to various signals for updating a
tasklist, this commit changes the code so that there is just a single, global
connections and based on this a weak table with all tasklist instances is used
do the updates.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-27 14:20:24 +02:00
Uli Schlachter 40db0b7337 Make taglists garbage-collectable
Similar to what the previous commit does for layoutboxes, this changes the code
for the taglist so that there is only a single, global connection to the various
signals and these update all taglists via weak tables.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-27 14:03:59 +02:00
Uli Schlachter 6f2e7bba25 Make layoutbox kind-of garbage-collectable
Instead of connecting to the needed tag-update-signal again for every layoutbox,
this now just creates a single connection and updates all layoutboxes from here.
A new weak table is used to find the layoutboxes from these callbacks.
Additionally, layoutboxes are now per-screen unique. So even if you try to
create three layoutboxes for screen 1, the code will now always return the same
instance.

This kind-of fixes the leak test for layoutboxes. The problem is that the
default config also creates a layoutbox and adds it to a wibox. Since this is
now the same layoutbox, the test still fails. Just removing the layoutbox-part
from the default config makes this problem go away.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-27 13:19:12 +02:00
Uli Schlachter e9377c4808 Make textclock garbage-collectable
This fixes the textclock-specific part of the test that the previous commit
added.

To fix this, gears.timer.weak_start_new() is used. This function creates a timer
that is automatically stopped when its callback function is garbage collected.
The callback function is saved as a member of the texbox widget that is the
"widget behind the textclock". Thus, the timer can only be stopped after the
widget is garbage-collected, but the timer does not keep the widget alive.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-27 12:44:10 +02:00
Daniel Hahler bf630de74e Merge pull request #438 from blueyed/ewmh-activate-raise-always
ewmh.activate: raise a client always
2015-09-25 10:16:03 +02:00
Daniel Hahler bd39a70b62 Merge pull request #474 from blueyed/ewmh-activate-only-focus-visible
ewmh.activate: only focus visible clients
2015-09-25 10:15:25 +02:00
Daniel Hahler 116c90c8d8 minor: taglist.taglist_label: join if / remove indent 2015-09-25 01:29:00 +02:00
Daniel Hahler f4d6011f23 awful.widget.taglist: handle/display urgent property always
For non-selected tags, display the urgent bg/fg always.
Previously, this was skipped in case the tag had the focused client,
which is possible since a while.

Ref: https://github.com/awesomeWM/awesome/issues/455#issuecomment-143072993
2015-09-25 01:07:51 +02:00
Daniel Hahler b824d00284 ewmh.activate: only focus visible clients
Since focus can be moved to non-visible clients nowadays, this needs to be
checked in the `request::activate` handler.

Fixes https://github.com/awesomeWM/awesome/issues/455.
2015-09-25 00:18:33 +02:00
Daniel Hahler 81e59cdfc8 ewmh.activate: raise a client always
When a client is not visible, this would adjust its stacking order
still.

This also addresses https://github.com/awesomeWM/awesome/issues/472,
because it raises unminimized clients after they got focused.
2015-09-24 23:38:14 +02:00
Daniel Hahler 7cbf3e8bee Fix tooltip.set_geometry: provide textbox context
Closes https://github.com/awesomeWM/awesome/pull/467.
2015-09-23 10:35:13 +02:00
Alastair Robertson b7669161a0 Add optional limit for nmaster/ncol based on number of tiled windows
Closes https://github.com/awesomeWM/awesome/pull/430.
2015-09-19 12:05:28 +02:00
Daniel Hahler 42aea011d2 placement.no_offscreen: add optional screen argument
This is used by `tooltip.place` then to tie the tooltip to the screen of
the mouse.  Without this, a tooltip from the tasklist might get moved to
the screen above the tasklist, if it gets considered to be on that
screen given its coordinates.

Closes https://github.com/awesomeWM/awesome/pull/437.
2015-09-16 10:39:12 +02:00
Kazunobu Kuriyama a005ad22b1 Correct indentation of keyboardlayout.lua
Correct the indentation of keyboardlayout.lua, so that it complies with
the vim modeline at the bottom of the file.
2015-09-13 01:35:50 +09:00
Kazunobu Kuriyama 81e667feab keyboardlayout: Extend allowable 'group_names' pattern range
Extend the range of the 'group_names' patterns which is currently
restricted to typical ones like

    pc+us+ru:2+de:3+ba:4+inet

to more general ones such as

    macintosh_vndr/apple(alukbd)+macintosh_vndr/jp(usmac)+macintosh_vndr/jp(mac):2

so that the keyboardlayout widget can handles all possible patterns
returned by awesome.xkb_get_layout_group().
2015-09-13 01:19:00 +09:00
Abdo Roig-Maranges 57755b3db2 Add missing hints argument in `awful.movetoscreen`
Closes https://github.com/awesomeWM/awesome/pull/441.
2015-09-11 22:30:47 +02:00
Daniel Hahler 6d8347df90 ewmh.activate: make hints optional
Ref: https://github.com/awesomeWM/awesome/pull/441.

Closes https://github.com/awesomeWM/awesome/pull/444.
2015-09-11 22:30:07 +02:00
Uli Schlachter ca9242da4b Merge branch 'new_widget_system3' 2015-09-11 17:17:06 +02:00
Daniel Hahler 52154d0f15 Fix client.cycle's screen param handling
Broken since fc950f6.

Closes https://github.com/awesomeWM/awesome/pull/443.
2015-09-10 20:43:52 +02:00
Daniel Hahler fbc72624d7 Activate focused client with `awful.client.movetoscreen`
The default config has this:

    awful.key({ modkey, }, "o", awful.client.movetoscreen                        ),

This moves the client to the next screen and focuses that screen.

But it does not ensure that the client is raised above any existing
windows, e.g. when moving a floating client.

This patch emits the `request::activate` signal if the client is
currently focused, but only if the screen property actually has changed.

Closes https://github.com/awesomeWM/awesome/pull/98.
2015-09-09 13:29:09 +02:00
Uli Schlachter 26699d5ad7 graph and progressbar: Convert to new system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:51:36 +02:00
Daniel Hahler a251331683 awful.rules: factor out `matches`
This factors out `matches` and uses it in `matches_list` (renamed
from `does_match`) to short-circuit the successful case - where not all
rules have to get checked.

Closes https://github.com/awesomeWM/awesome/pull/431.
2015-09-03 22:56:07 +02:00
Daniel Hahler 285f24d234 Fix awful.rules.does_match: use _rules as arg 2015-09-03 22:55:54 +02:00
Uli Schlachter ad9e57d0c1 spawn_with_line_callback: Add missing return
Whoops.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-03 19:57:57 +02:00
Daniel Hahler 2b2c230f43 Merge pull request #323 from actionless/grow-master
Add "master_fill_policy" tag property and its support in "tile" and "corner" layouts

Closes https://github.com/awesomeWM/awesome/pull/323/files.
2015-09-03 08:53:19 +02:00
Daniel Hahler 7c8e97ca31 Merge pull request #406 from psychon/spawn_with_pipes2
Spawn with pipes

Closes https://github.com/awesomeWM/awesome/pull/406.
2015-09-02 22:47:09 +02:00
Uli Schlachter 0e20fef2bd Add awful.util.spawn_with_line_callback
This new function spawns a program, similarly to awful.spawn, but captures its
output. On each line of output on stdout / stderr, a Lua function is called with
this line. There are different callbacks for stdout and stderr. When both stdout
and stderr are closed, another callback function is called. The intention for
this last callback is "the program is done", because most programs should only
close their output when they exit.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-02 22:27:32 +02:00
Daniel Hahler c7d375790d awful.widget.common.list_update: expose textbox to label callback
This allows the "label" callback to adjust the textbox itself.
`tasklist_label` is changed to make use of it and supports new style
arguments: `font_focus`, `font_urgent` and `font_minimized`.

Closes https://github.com/awesomeWM/awesome/pull/313.
2015-09-02 22:25:24 +02:00
Uli Schlachter 769d6acb64 Merge branch 'add-resize-option' of https://github.com/actionless/awesome 2015-08-23 17:05:30 +02:00
Uli Schlachter 56c22cde77 Merge branch 'widget_context' 2015-08-23 15:33:43 +02:00
Uli Schlachter 190beb3e8e Merge branch 'tooltips-replace-on-geometry-changes' of https://github.com/blueyed/awesome 2015-08-23 15:27:10 +02:00
Tim Roes 462055cb36 Add finish callback to awful.mouse.client.move 2015-08-22 14:50:42 +02:00
Daniel Hahler 05da320c28 tooltips: re-place them on width/height changes
If the dimensions of a tooltip change, e.g. after the text has been
changed, they are now placed again.
2015-08-14 15:41:43 +02:00
Daniel Hahler 66c4ff7f2c doc: awful.placement.no_offscreen 2015-08-14 14:28:17 +02:00
Daniel Hahler b600b143b6 tooltip: re-add `no_offscreen` back to `place`
The tooltip might be partly outside of the screen, and especially the
workarea, e.g. for tooltips on the tasklist.

Calling `awful.placement.no_offscreen` makes sure that it is fully
inside, and will even restrict it to the workarea, not only to the screen.

Closes https://github.com/awesomeWM/awesome/pull/409.
2015-08-14 14:28:06 +02:00
Daniel Hahler f8ad2cd152 Merge pull request #320 from blueyed/widget-handle-non-int-geom
Drawin: handle non-integer margins / geometry

Closes https://github.com/awesomeWM/awesome/pull/320.
2015-08-12 16:38:33 +02:00
Daniel Hahler 57ec268b8e tasklist: handle transient_for with skip_taskbar clients
Ref: https://github.com/awesomeWM/awesome/issues/182
2015-08-12 14:31:16 +02:00
Daniel Hahler 1aa1c8052d Add client.get_transient_for_matching and .is_transient_for 2015-08-12 14:31:16 +02:00
Daniel Hahler fe235b7fb7 awful.wibox: round x/y/width/height wibox arguments
Ref: https://github.com/awesomeWM/awesome/pull/320#issuecomment-130212116
2015-08-12 14:14:14 +02:00
Daniel Hahler 977bd9a60e Add awful.util.round 2015-08-12 14:09:45 +02:00
Daniel Hahler 251673f8b2 tooltip: use new next_to_mouse placement
This should take care of not placing the tooltip outside of the screen
already, so the call to `awful.placement.no_offscreen` can be skipped.
2015-08-12 13:22:59 +02:00
Daniel Hahler 9803af1b1f Add awful.placement.next_to_mouse 2015-08-12 13:22:59 +02:00
Uli Schlachter 1ebc34b5e9 Widgets: Also add a context argument to :fit()
Together with the context argument to :draw(), this even allows widgets to have
DPI-dependant size.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 11:19:48 +02:00
Uli Schlachter 88b98789a0 Rename the first argument to :draw to "context"
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 11:19:28 +02:00
Uli Schlachter 31b69dbe1a drawable: Use a context table as first argument to :draw()
This table contains the drawable, wibox and titlebar that we are drawing on, but
also includes the screen and the DPI of that screen. This allows widgets to
depend on the DPI in their rendering.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 11:17:48 +02:00
actionless b47eabf4f0 feat(lib: awful: layout: suit: tile): add 'resize_jump_to_corner' 2015-08-12 00:12:15 +02:00