Commit Graph

2181 Commits

Author SHA1 Message Date
Uli Schlachter b89918d0f1 Merge branch 'remember-mouse-pos-per-screen' of https://github.com/Bew78LesellB/awesome 2015-10-10 19:51:00 +02:00
Uli Schlachter e15df8cba9 Merge branch 'client-movetoscreen-raise-true' of https://github.com/blueyed/awesome 2015-10-10 19:50:18 +02:00
lesell_b 4003331b41 fix missing scope on the mouse position table 2015-10-09 21:27:17 +02:00
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
Daniel Hahler dcdd60382f Raise client in awful.client.movetoscreen
The intention of [#98] / fbc72624 was to actually raise the client,
but that was never the case apparently, and got totally lost in
[#441] / 57755b3.

[#98]: https://github.com/awesomeWM/awesome/pull/98
[#441]: https://github.com/awesomeWM/awesome/pull/441
2015-10-08 13:59:57 +02:00
lesell_b f2b6aa105c Update saved mouse position on screen focus change
Signed-off-by: lesell_b <lesell_b@epitech.eu>
2015-10-08 04:40:59 +02:00
lesell_b 23b2fae6a9 Remember mouse position per screen
The mouse position is saved and restored when focusing another screen

If the target screen has no saved mouse position, the relative position
of the current screen is used

Signed-off-by: lesell_b <lesell_b@epitech.eu>
2015-10-08 03:52:03 +02:00
actionless 0e3009936c feat(lib: awful: key): save current hotkeys 2015-09-30 13:17:12 +02:00
Emmanuel Lepage Vallee 4095eb91a8 Move util.spawn to a new module, add ability to spawn with properties
* This commit add a new module to avoid a (4 level) loop dependency
* It is now possible to call awful.spawn() with a table of properties
* awful.rules is used to execute the rules.

* Everything is public to allow alternative workflow modules such as
    Tyrannical to use their own callback implementation.
2015-09-29 18:05:56 -04:00
Uli Schlachter a3e690d191 imagebox: Redraw in :set_image()
If someone modifies a cairo surface and then sets the resulting object as the
image of an imagebox, the imagebox needs to redraw. Thus, since surfaces are
modifiable, we cannot assume that nothing changed when the same image is set
multiple times on an imagebox.

However, the dimensions of a surface cannot be changed and thus this does not
need to emit widget::layout_changed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-29 00:28:26 +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 bd47edb4ef leak test: Make the layoutbox test pass
This commit does two things: It gets rid of the reference to the layoutbox that
the default config created and it changes the widget dependency cache to not
keep widgets alive unnecessarily.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-27 14:42:39 +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
Kazunobu Kuriyama 9ae945c931 Enhance menubar icon path lookup
The way of icon path lookup for `menubar` is enhanced so that it is
based on a theme-oriented way as described in the specification:

  Icon Theme Specification, Ver. 0.12
  http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html

To accomplish this:

 * Add the two new files `icon_theme.lua` and `index_theme.lua`.

   The former implements an icon lookup algorithm suggested in the URL
   above.  The latter implements a helper object to parse the cache file
   `index.theme` of which data is used by the former.

 * Modify `menu_gen.lua` to use the new algorithm.

   - The implementation of `lookup_category_icons` is changed
     accordingly.
   - The values of the field `all_categories.icon_name` are changed file
     names to icon names, i.e., file extensions which are used to
     indicate image file formats are removed.

 * Add the new file `icon_theme_spec.lua` for a unit test for checking
   if `icon_theme.lua` together with `index_theme.lua` works as
   expected.
2015-09-26 11:45:38 +09: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 4e22cf02e6 Merge pull request #384 from blueyed/more-robust-errors
More robust errors: make sure errors are strings

Closes https://github.com/awesomeWM/awesome/pull/384.
2015-09-23 20:59:35 +02:00
Uli Schlachter dfcbf20d81 Add and use wibox.hierarchy:update()
This function updates a hierarchy if the layout of some widgets changed. It does
nothing on the parts that did not change. This should be more efficient than
recomputing the whole hierarchy whenever something changes.

Once again, this has some positive results on the "benchmark test":

Before:
        create wibox: 0.083016   sec/iter ( 13 iters, 1.161 sec for benchmark)
    update textclock: 0.00391091 sec/iter (271 iters, 3.219 sec for benchmark)
  relayout textclock: 0.00273234 sec/iter (397 iters, 1.087 sec for benchmark)
    redraw textclock: 0.0010191  sec/iter (989 iters, 1.745 sec for benchmark)

After:
        create wibox: 0.083146   sec/iter ( 13 iters, 1.163 sec for benchmark)
    update textclock: 0.00170519 sec/iter (647 iters, 2.201 sec for benchmark)
  relayout textclock: 0.000581637 sec/iter (1880 iters, 1.094 sec for benchmark)
    redraw textclock: 0.0010167  sec/iter (997 iters, 1.773 sec for benchmark)

So again no difference for creating wiboxes (100.16% compared to before). This
time we also have no real difference for creating wiboxes (99.76%). Update (44%)
and relayout (21%) are improved a lot.

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

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-23 20:57:41 +02:00
Daniel Hahler f7f8420d24 naughty.notify: improve doc for args.run
Closes https://github.com/awesomeWM/awesome/pull/469.
2015-09-23 20:56:17 +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
actionless f2e554de91 fix(lib: naughty: core): make it work with textbox per-screen dpi
Closes https://github.com/awesomeWM/awesome/pull/464.
2015-09-22 08:56:25 +02:00
Daniel Hahler 28ffdb050e Merge pull request #454 from psychon/remove_gears.debug.assert
Remove gears.debug.assert

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

Conflicts:
	lib/gears/matrix.lua
2015-09-21 21:16:36 +02:00
Uli Schlachter 8d6030819b textbox: Honor per-screen DPI
This makes the textbox' :draw() and :fit() callbacks use the DPI that is
specified in the given drawing context. With this, the textbox now scales
correctly if different screens have different DPI values.

Idea originally from Daniel.

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

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-21 21:13:21 +02:00
Daniel Hahler b0d7e6bb6c Merge pull request #458 from psychon/explicit_widget_deps
Explicitly track dependencies between widgets

Closes https://github.com/awesomeWM/awesome/pull/458.
2015-09-21 21:12:39 +02:00
Daniel Hahler 21dbe262fb Merge pull request #462 from psychon/gears.matrix2
Implement full matrix operations in gears.matrix

Closes https://github.com/awesomeWM/awesome/pull/462.
2015-09-21 21:12:10 +02:00
Uli Schlachter b134318f19 Use gears.matrix instead of cairo.Matrix everywhere
This has some positive results on the "benchmark test". Each single number is
the best one out of three runs.

Before:
        create wibox: 0.0826502  sec/iter ( 13 iters, 1.157 sec for benchmark)
    update textclock: 0.0186952  sec/iter ( 57 iters, 2.473 sec for benchmark)
  relayout textclock: 0.0158112  sec/iter ( 64 iters, 1.028 sec for benchmark)
    redraw textclock: 0.0015197  sec/iter (662 iters, 1.861 sec for benchmark)

After:
        create wibox: 0.0825672  sec/iter ( 13 iters, 1.154 sec for benchmark)
    update textclock: 0.00378412 sec/iter (277 iters, 4.216 sec for benchmark)
  relayout textclock: 0.00259056 sec/iter (420 iters, 1.09 sec for benchmark)
    redraw textclock: 0.00105128 sec/iter (958 iters, 1.79 sec for benchmark)

We see no significant change in the creation of wiboxes (99.9% compared to
before). Update (20% of the previous run time), relayout (16%) and redraw (69%)
are all sped up by this change.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-19 13:38:05 +02:00
Uli Schlachter 34927b187d gears.matrix: Implement matrices in Lua
Instead of going through LGI to call cairo, this now implements the various
matrix operations directly in Lua. The plan is to avoid the overhead that we hit
due to LGI.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-19 13:32:12 +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
Uli Schlachter 41a8fabf4c Explicitly track dependencies between widgets
Before this, dependencies between widgets where implicitly discovered by
recursive calls to base.fit_widget() and base.layout_widget(). However, it is
too easy to get this wrong (just call one of these functions from outside of a
widget's :fit() / :layout() function) and the resulting mess would be hard to
debug.

Thus, this commit changes the API so that callers have to identify themselves
and we can explicitly record the dependency between the widgets involved.

This also fixes a bug where no dependencies were tracked for widgets after
:set_visible(false). Whoops...

Sorry for breaking the API for adding this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-17 18:17:05 +02:00
Uli Schlachter 14be909206 Remove gears.debug.assert
Lua provides an assert() function already, so let's just use that.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-16 15:01:26 +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
Uli Schlachter 2330040eb5 wibox.drawable: Fix complete repaints
When a complete repaint is scheduled, also do a relayout, because this is also
the case that we go through when the underlying cairo surface is resized. For
example, resizing a client with a titlebar would trigger this.

Also, going through this code path is necessary since this is the only place
where the dirty area is updated so that it includes "everything". Before this
change, nothing was actually redrawn, because the dirty area was empty.

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

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-15 12:49:20 +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
Yauhen Kirylau 475358050a fix(lib: wibox: layout: constraint): s/base_widget/base/
Closes https://github.com/awesomeWM/awesome/pull/446.
2015-09-12 15:23:16 +02: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
Uli Schlachter 5e577a10ab Fix wibox.hierarchy:draw()
This accidentally called the draw callbacks with a nil argument instead of the
context. This was introduced in some badly done rebase, sorry! :-(

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-11 17:14:03 +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
actionless 7ae58b3208 doc(lib: gears: surface): more verbose docstring
Closes https://github.com/awesomeWM/awesome/pull/436.
2015-09-07 20:29:57 +02:00
Uli Schlachter ee001ce2f0 imagebox: Don't emit signals if same image is set again
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-06 18:57:47 +02:00
Uli Schlachter 6b6b448b56 wibox.hierarchy: Remove _parent member
The parent was needed for :get_matrix_to_device() which recursively walked
parents and multiplied together their transformation matrices. This is now
replaced by calculating all these matrices while constructing the hierarchy.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-06 18:57:41 +02:00
Uli Schlachter dc73a4586a wibox.hierarchy: Stop recording _root
There once was a function :get_root() on hierarchies, but that wasn't needed any
more and thus was removed. This commit also removes the internal code that was
used to record the root element of the hierarchy.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-06 18:57:30 +02:00
Uli Schlachter c62d323d09 wibox.widget.base: Add caches for :layout and :fit
These caches, well, cache the result of the :layout and :fit callbacks on
widgets.

Clearing caches is done by recording dependencies between a widget. When a call
to base.fit_widget() or base.layout_widget() recursively causes another call to
such a function, this means that the earlier widget depends on the later widget.
This dependency is recorded and when the later widget emits
widget::layout_changed, the caches of all the widgets involved are cleared.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-06 18:57:21 +02:00
Uli Schlachter 45323f2801 Remove wibox.hierarchy:get_parent()
It's unused.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-06 18:56:58 +02:00
Uli Schlachter 958603410c flex layout: Test signal emission
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:51:36 +02:00
Uli Schlachter dcd4db69e6 fixed layout: Test signal emission
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:51:36 +02:00
Uli Schlachter 0e7ae1cb25 align layout: Test signal emission
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:51:36 +02:00
Uli Schlachter 7acb30de71 Documentation overhaul for wibox.widget.base
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:51:36 +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
Uli Schlachter 0aa4304bda wibox.drawable: Convert to new widget API
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:51:36 +02:00
Uli Schlachter 3338718b93 Merge wibox.layout.base and wibox.widget.base
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:28:53 +02:00
Uli Schlachter 9b8cbf7539 Convert the textbox to the new widget system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:28:53 +02:00
Uli Schlachter 99ac190090 Convert the systray widget to the new widget system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:28:53 +02:00
Uli Schlachter 121a5050b1 Convert the imagebox to the new layout system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:28:53 +02:00
Uli Schlachter 091ca697e6 Convert the background layout to the new widget system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:28:53 +02:00
Uli Schlachter b83eaf5915 Conver the rotate layout to the new widget system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:28:53 +02:00
Uli Schlachter 85ab3f045b Convert the mirror layout to the new widget system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:28:53 +02:00
Uli Schlachter f2b1071875 Convert the margin layout to the new widget system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:28:53 +02:00
Uli Schlachter 746cc23402 Convert the constraint layout to the new widget system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:28:52 +02:00
Uli Schlachter 496fbde9b4 Convert the flex layout to the new widget system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:28:52 +02:00
Uli Schlachter 199b553895 Convert the fixed layout to the new widget system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:28:52 +02:00
Uli Schlachter e67e2813e9 Convert the align layout to the new widget system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:28:52 +02:00
Uli Schlachter 02f67b61b4 Add a widget hierarchy implementation
A widget hierarchy describes the position of widgets. The hierarchy is a
recursive tree of widget hierarchy instances. This functionality depends on a
:layout function that is not yet implemented on widgets, but will be added
later.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:28:52 +02:00
Uli Schlachter 4785b63755 Prepare wibox.widget.base for new widget system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:06:29 +02:00
actionless e023fd0640 fix(lib: gears: color): use surface for recolor 2015-09-04 21:09:46 +02:00
actionless 2f340f05ff feat(themes: xresources): recolor layout icons 2015-09-04 21:08:18 +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
Daniel Hahler f957d1f96b Merge pull request #408 from psychon/strict-fit
Strict fit

Closes https://github.com/awesomeWM/awesome/pull/408.
2015-09-02 22:12:19 +02:00
Daniel Hahler a0f8948c71 menubar: fix height to be rounded
Fixes https://github.com/awesomeWM/awesome/issues/414.
Closes https://github.com/awesomeWM/awesome/pull/432.
2015-08-31 20:47:22 +02:00
Uli Schlachter bcc1751fca fit_widget(): Sanitize the result of :fit()
After this change, fit_widget() enforces that a widget cannot ask for more space
than was offered to it. This also fixes a rounding issue in the flex layout
where its fit function would return too small numbers.

Thanks to this, lots of "XXX" comments in spec/ disappear.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-23 17:08:44 +02:00
Uli Schlachter 3fbd16d9a3 wibox.layout.align: Correctly size second widget
In expand nodes "none" and "outside", the variable size_remains describes how
much space is available for the first/third widget. Everything else is used by
the second widget. Thus, fitting the second widget to anything involving
size_remains is wrong. Instead, this commit uses the correct value.

This also fixes a messed up argument order for horizontal align layouts.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-23 17:07:45 +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 564fae8934 Merge branch 'add_gears_matrix' 2015-08-23 15:36:55 +02:00
Uli Schlachter 56c22cde77 Merge branch 'widget_context' 2015-08-23 15:33:43 +02:00
Uli Schlachter cb34144bf8 Merge branch 'master' of https://github.com/kindlycat/awesome 2015-08-23 15:29:22 +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 b33cffd851 doc: textbox:set_markup: link to Pango markup documentation 2015-08-13 16:13:22 +02:00
Grigory Mischenko d2407c3de1 Widget opacity: draw with alpha only if transparent 2015-08-13 12:26:43 +03:00
kindlycat 03663fe778 Add "opacity" property for widgets 2015-08-12 22:31:06 +00: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 11473aa490 Use awful.util.round in beautiful.xresources.apply_dpi 2015-08-12 14:18:57 +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 f5ed8848e7 Use awful.util.round in wibox.layout.flex 2015-08-12 14:10:10 +02:00
Daniel Hahler 977bd9a60e Add awful.util.round 2015-08-12 14:09:45 +02:00
Daniel Hahler 9cbab8fa08 Merge pull request #388 from blueyed/placement-next-to-mouse
Add placement.next_to_mouse, use it for tooltips.

Closes https://github.com/awesomeWM/awesome/pull/388.
2015-08-12 13:23:31 +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
Uli Schlachter e5a9eef157 Widget drawing: Add a traceback on errors
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 11:17:48 +02:00
Uli Schlachter d122b825ee gears.timer: Fix the traceback on errors
With the second argument being 2, the traceback will not include the error
handling function, but instead end at the actual place of the error.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 11:17:48 +02:00
Uli Schlachter 3685077291 rect_to_device_geometry: Use gears.matrix.transform_rectangle
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 10:38:22 +02:00
Uli Schlachter 19b9bfc46e Move wibox.layout.rect_to_device_geometry to wibox.widget
Having two modules named "base" is confusing and "wibox.layout" doesn't contain
much useful stuff. This is a first step for removing wibox.layout by moving a
function which should only ever be used internally in awesome.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 10:38:22 +02:00
Uli Schlachter 16a1ef0f48 Add gears.matrix for working with cairo matrices
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 10:38:22 +02:00
Uli Schlachter 74276b3a11 gears.timer: Add a note about GC'ing timers
Ref: https://github.com/awesomeWM/awesome/issues/216

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:54:58 +02:00
Uli Schlachter 0367af2be9 gears.timer: Add simpler ways to start timers
This adds gears.timer.start(timeout, callback) that creates a timer object and
connects a callback to it, all in one go.

Additionally, this adds gears.timer.weak_start(timeout, callback). The weak
version still allows the callback function to be garbage collected and will then
stop the timer.

This was tested with the following code:

  require("gears.timer").start(0.3, function()
    print("ping")
    if collectgarbage("step", 500) then
      print("collection done")
      error("err")
    end
    return true end)
  require("gears.timer").weak_start(0.1, function()
    io.stdout:write(".")
    return true
  end)

After a full collection cycle, both timers are stopped. The first one is stopped
because of the error() that it generated. The second one is stopped because the
callback function was garbage collected.

Ref: https://github.com/awesomeWM/awesome/issues/216

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:54:55 +02:00
Uli Schlachter a166f86864 Merge branch 'keyboardlayout_no_layout_entry' of https://github.com/psychon/awesome 2015-08-12 09:40:12 +02:00
actionless b47eabf4f0 feat(lib: awful: layout: suit: tile): add 'resize_jump_to_corner' 2015-08-12 00:12:15 +02:00
Daniel Hahler e47773933c Bump required lgi version to 0.7.1
Ref: https://github.com/pavouk/lgi/issues/41
Ref: https://github.com/awesomeWM/awesome/pull/392
2015-08-11 19:08:35 +02:00
Uli Schlachter 008cae50b2 awful.widget.keyboardlayout: Rename private members
I'm working on something that adds :layout functions to widgets. This clashes
with the keyboardlayout widget's use of an entry with this name. This change
adds an underscore as a prefix to the private data members of the
keyboardlayout.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-11 12:44:48 +02:00
Daniel Hahler 68b0fa243f Add "visible" property for widgets
Widgets with `visible = false` will not be drawn.

Closes https://github.com/awesomeWM/awesome/pull/326.
2015-08-10 23:09:07 +02:00
actionless d5818d0e1a feat(lib: awful: layout: suit: floating): add 'resize_jump_to_corner' 2015-08-07 18:50:08 +02:00
Daniel Hahler b028a0ba1d xresources.apply_dpi: use "round" instead of "ceil"
Given an outcome of e.g. 1.01 its more sane to use 1 than 2, especially
for `border_width`.

This uses the method from `wibox.layout.flex`.

Closes https://github.com/awesomeWM/awesome/pull/389.
2015-08-04 20:48:17 +02:00
Daniel Hahler 9883d3484d titlebar: add tooltips for icon buttons
This uses the button name in the tooltip's text.
2015-08-02 15:36:54 +02:00
Daniel Hahler 14e63fbcd7 awful.tooltip: do not hide when entering its wibox
Because of `placement.under_mouse` (and without
`placement.no_offscreen` fixing it), this will cause the tooltip to hide
immediately again.

There is no need for hooking into this signal, but this adds a click
handler to close the tooltip when clicking into it.
2015-08-02 15:36:54 +02:00
Daniel Hahler a8d224ef5c doc: fix for set_markup 2015-08-02 15:36:54 +02:00
Daniel Hahler 6880835c26 tooltip: delay_show: stop timer, handle (non-)stopped timers
This splits the logic for `delay_show` out of `show`/`hide`, and handles
an already stopped timer.  The timer gets also stopped after the tooltip
has been displayed.

Ref: https://github.com/awesomeWM/awesome/issues/371.
2015-08-02 15:36:54 +02:00
Daniel Hahler 9bcd87c727 awful.tooltip: skip set_geometry if not visible
`set_geometry` will be called in `show`, and is not necessary when the
tooltip is not visible.
2015-08-02 15:36:54 +02:00
Daniel Hahler 5b60bc212a textbox.set_markup: handle `parsed.message` from Pango.parse_markup
Ref: https://github.com/pavouk/lgi/issues/115
Fixes: https://github.com/awesomeWM/awesome/issues/301
2015-08-01 18:25:10 +02:00
Daniel Hahler 0ea2bbb126 awful.menu: use beautiful.xresources.apply_dpi for margins 2015-08-01 17:47:51 +02:00
Daniel Hahler 5c78cf07fc naughty: use beautiful.xresources.apply_dpi for margin and border 2015-08-01 17:47:43 +02:00
Daniel Hahler 4a3589aad4 widget.common.list_update: improve margins (dpi / imagebox)
Use `beautiful.xresources.apply_dpi` for `common.list_update`'s textbox
margins, and add a left margin for the imagebox, too.

The latter is useful/nicer with the default behavior of an inverted
style for the focused tasklist entry.
2015-08-01 17:39:48 +02:00
Daniel Hahler 09dce08fd4 gears.debug: add support for limited depth
This is useful with big tables and might even be necessary to prevent
infinite recursion.

To prevent the latter, the default is 10.

This adds an indicator when `depth` is reached for tables.

    awesome# return require("gears").debug.dump_return(t4, "", 2)
       string " : table: 0x1580130
      1 : table: 0x16951d0
        1 : wibox.widget.base (table) […]
        2 : wibox.widget.base (table) […]
        3 : 4 (number)
        4 : 5 (number)
        5 : foo (string)
      2 : table: 0x16ac790
        1 : table: 0x16951d0 (table) […]
      3 : table: 0x16cc500
        1 : table: 0x16951d0 (table) […]
        2 : table: 0x16ac790 (table) […]"

    awesome# return require("gears").debug.dump_return(t4, "", 1)
       string " : table: 0x1580130
      1 : table: 0x16951d0 (table) […]
      2 : table: 0x16ac790 (table) […]
      3 : table: 0x16cc500 (table) […]"

Closes https://github.com/awesomeWM/awesome/pull/372.
2015-08-01 11:24:35 +02:00
Daniel Hahler 896ab0a286 Merge pull request #376 from blueyed/more-tostring
More tostring metamethods for drawable and wibox
2015-08-01 11:22:04 +02:00
Daniel Hahler d3b682f2b6 wibox: add __tostring metamethod 2015-08-01 11:21:50 +02:00
Daniel Hahler 430e8664be wibox.drawable: add __tostring meta method 2015-08-01 11:21:50 +02:00
Daniel Hahler fa6b7c390f make_widget: keep original "tostring" value in parenthesis
This provides the usual table ID, which can be useful during debugging.
2015-08-01 11:21:50 +02:00
Daniel Hahler 9494f3f0c3 Merge pull request #377 from blueyed/naughty-focused-screen
Naughty: default to focused screen
2015-08-01 11:19:11 +02:00
Daniel Hahler 475b469f96 doc: tooltip: add type/optional information
Closes https://github.com/awesomeWM/awesome/pull/379.
2015-08-01 11:14:06 +02:00
actionless 95743683fe style(lib: awful: tag): fix docs 2015-07-30 09:22:26 +02:00
Abdo Roig-Maranges 3942672d31 Fix missing parenthesis to a call of screen.focused
Closes https://github.com/awesomeWM/awesome/pull/370.
2015-07-29 18:47:34 +02:00
Daniel Hahler 861cfc5915 wibox.widget.textbox: skip setting unchanged layout properties
In case the text, markup or other layout properties have not changed, there's
no need to update the widget.

Based on 5a2a5d03d3/lib/wibox/widget/textbox.lua.
Closes https://github.com/awesomeWM/awesome/pull/335.
2015-07-29 01:20:23 +02:00
Uli Schlachter 0713e2e50d Add a missing "_" in "__newindex"
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-28 21:29:05 +02:00
Daniel Hahler b08d3caba8 awful.widget.layoutbox: add tooltip with the layout's name
Closes https://github.com/awesomeWM/awesome/pull/322.
2015-07-28 19:31:26 +02:00
Daniel Hahler 355e4696ba Preserve old mousegrabber behavior (additionally)
18f6ab1 changed the behavior when resizing floating clients using the
mouse (via modkey + RMB).

Previously, you could initiate the mousegrabber using e.g. "modkey +
RMB", release the key and button, and resize the window using the left
mouse button.

This restores this behavior by canceling the mousegrabbers only if the
cursor was moved, without _any_ mouse button being pressed.

Fixes https://github.com/awesomeWM/awesome/issues/309.
Closes https://github.com/awesomeWM/awesome/pull/310.
2015-07-28 13:09:50 +02:00
Daniel Hahler 904b7a88ee doc: overhaul naughty documentation 2015-07-27 15:54:47 +02:00
Daniel Hahler f7e7d05047 doc: naughty: config.mapping moved to dbus.config.mapping 2015-07-27 15:32:11 +02:00
Daniel Hahler efe5358a0b naughty.notify: default to screen.focused() 2015-07-27 14:35:46 +02:00
Daniel Hahler fc950f6921 Fixes to awful.client's lazy-loading of awful.screen
At least awful.client.getmaster was broken:

> lib/awful/client.lua:450: attempt to index global 'awful' (a nil value)

This uses a metatable to simplify handling the cyclic dependency to
`awful.screen`.

Follow-up to cbe684e (https://github.com/awesomeWM/awesome/pull/94).
Closes https://github.com/awesomeWM/awesome/pull/334.
2015-07-27 13:59:47 +02:00
Daniel Hahler c602eb4ff7 Merge pull request #352 from psychon/gears_cache
Add gears.cache: a generic cache which may loose values at any time
2015-07-27 13:58:35 +02:00
Daniel Hahler 68ad2529a4 wibox.widget.base: add __tostring method to widgets
Fixes https://github.com/awesomeWM/awesome/issues/337.
Closes https://github.com/awesomeWM/awesome/pull/341.
2015-07-26 18:17:01 +02:00
Daniel Hahler 6d323e7c04 doc: distinguish between client.object and client.class
Instead of `client.client`, the client object is now referred to as
`client.object` and the client class as `client.class`.

This moves the documentation of `client.focus` to the class.

Closes https://github.com/awesomeWM/awesome/pull/349.
2015-07-26 00:45:38 +02:00
Daniel Hahler 410a6e5bb2 Merge pull request #155 from silverhammermba/pango_color
Replace color_strip_alpha with check_pango_color
2015-07-25 23:26:22 +02:00
Daniel Hahler 0af7ce375a awful.client: add support for stacking order
This adds a `stacked` boolean argument to `awful.client.visible`, and
(relevant) callers of it.

This can be used with e.g. `awful.client.swap.bydirection` to swap clients
based on their stacking order.

Fixes https://github.com/awesomeWM/awesome/issues/178.
2015-07-25 18:55:36 +02:00
Daniel Hahler 292b95da01 awful.util.deprecate: add source function name to warning
Closes https://github.com/awesomeWM/awesome/pull/342.
2015-07-25 15:39:57 +02:00
Daniel Hahler f12f9b3b97 spawn: improve doc, and add `sn` for `awful.util.spawn_with_shell`
Closes https://github.com/awesomeWM/awesome/pull/347.
2015-07-25 15:16:23 +02:00
Uli Schlachter a239b2cac7 Use gears.cache to replace some other caches
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-25 15:08:00 +02:00
Uli Schlachter 42c913332f Add a generic cache system as gears.cache
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-25 15:07:47 +02:00
Daniel Hahler 9835f73a01 doc: fix invalid @see references to URLs 2015-07-24 01:56:36 +02:00
Daniel Hahler b28cda2ac6 beautiful.xresources.apply_dpi: use `math.ceil`
Closes https://github.com/awesomeWM/awesome/pull/330.
2015-07-24 01:52:51 +02:00
Daniel Hahler 1f3ad814c9 beautiful.xresources: allow to set/get DPI per screen
This adds an optional screen argument to get_dpi/apply_dpi and set_dpi
to store DPI values per screen.

This can be used in your config to manage different DPI values for an
internal and external display:

    beautiful.xresources.set_dpi(125, 1)
    beautiful.xresources.set_dpi(94, 2)

This is meant to be the foundation for more evolved DPI handling in
awesome.

Closes https://github.com/awesomeWM/awesome/pull/336.
2015-07-24 01:48:03 +02:00
Daniel Hahler 62f5e59497 naughty: skip permanent notifications when there is no more room
This skips permanent notifications (with timeout=0) in `get_offset` when
there is not enough room for a new notification.  It will still fallback
to removing the first/oldest one.

Closes https://github.com/awesomeWM/awesome/pull/306.
2015-07-22 14:02:25 +02:00
Daniel Hahler 173545bc72 Add beautiful.get_merged_font; fix doc / load_font
This is meant to get a new font (copy) with adjusted attributes, e.g.

    font_focus = beautiful.get_font_copy(theme.font, "bold")

Closes https://github.com/awesomeWM/awesome/pull/308.
2015-07-22 13:59:05 +02:00
Daniel Hahler ddb1f64acd beautiful.init: use xpcall / debug.backtrace 2015-07-22 13:52:47 +02:00
Daniel Hahler f060fc055f awful.widget.tasklist: reset queued_update before tasklist_update
This will reset it properly in case of any error in the callback itself.
2015-07-22 13:52:47 +02:00
Daniel Hahler dc9295d981 gears.timer: use xpcall with timeout and delayed calls
This provides a traceback in case of errors.

Ref: https://github.com/awesomeWM/awesome/issues/301
2015-07-22 13:52:47 +02:00
Daniel Hahler aca856b5d2 keygrabber.grabber: rename function name
This makes it clearer / more explicit in the traceback in case of
errors.
2015-07-22 13:52:47 +02:00
Daniel Hahler cbe684efd1 Add awful.screen.focused [FS#1029]
This allows to configure / override what gets considered to be the
"focused screen".

Ref: https://awesome.naquadah.org/bugs/index.php?do=details&task_id=1029

Closes https://github.com/awesomeWM/awesome/pull/94.
2015-07-21 12:51:45 +02:00
actionless 34290433c2 feat(lib: awful: layout: suit: corner): add support for 'master_fill_policy' 2015-07-20 18:32:19 +02:00
actionless fb4a331014 feat(lib: awful: layout: suit: tile): add support for 'master_fill_policy' 2015-07-20 18:32:19 +02:00
actionless 0028349226 feat(lib: awful: tag, layout): add 'master_fill_policy' property to tag 2015-07-20 18:32:19 +02:00
Daniel Hahler c6ede6e96e tasklist: display symbols with "above" and "below" clients
When windows are set as "above", they will basically behave as "ontop"
(under normal circumstances) and therefore an indicator is useful to get
displayed in that case, too.

Closes https://github.com/awesomeWM/awesome/pull/325.
2015-07-18 01:03:01 +02:00
Daniel Hahler 3c1871b91f awful.tooltip: add margin around text
Closes https://github.com/awesomeWM/awesome/pull/321.
2015-07-16 21:24:46 +02:00
Emmanuel Lepage Vallee 18e9bfbcfa client: Do not assume the wfact exist
Since the call can now be delayed, "windowfact" may not exist yet.

Regression from 74106462ac
2015-07-14 01:39:03 -04:00
Daniel Hahler d5cf6e0272 Add client.first_tag, as a shortcut for `c:tags()[1]`
This is meant to be a faster alternative in case only the first tag is
relevant/used.

Closes https://github.com/awesomeWM/awesome/pull/294.
2015-07-14 01:20:39 +02:00
Daniel Hahler 1050237d04 minor: fix/improve doc comments 2015-07-12 17:42:53 +02:00
Max d22a65a103 Replace uses of color_strip_alpha with ensure_pango_color, refactor
This simplifies the logic a bit since all of the fg/bg colors are
always set when it gets to checking the client state.
2015-07-10 18:11:45 -04:00
Max 2ba9c8667f Replace color_strip_alpha with ensure_pango_color
color_strip_alpha was used to insert colors into Pango markup, but it
did not correctly check for valid Pango colors. ensure_pango_color
checks if the color is valid in Pango, and returns a placeholder if it
is not.
2015-07-10 18:09:45 -04:00
Daniel Hahler 4a845ced0f awful.widget.graph: setters: emit widget::updated only on changes
Ref: #284
2015-07-10 15:32:22 +02:00
Daniel Hahler 3be423fcb3 awful.widget.graph: expose properties via getters
This allows to see if a widget is stacked for example.

It uses getters instead of exposing the properties directly, which
should be made readonly then probably (which has drawbacks according to [1]).

1: http://lua-users.org/wiki/ReadOnlyTables

Closes https://github.com/awesomeWM/awesome/pull/284.
2015-07-10 15:32:07 +02:00
Daniel Hahler ae6a1efe65 Fix ewmh.activate to use the hints argument
This was missed in cb7f4b06, where the `raise` argument was changed to
`hints`.
2015-07-10 15:13:16 +02:00
Daniel Hahler 9eb4661cde Fix raising clients with focus=true via awful.rules
In ed09d8e this was changed accidentally, while only `request::focus`
should have been changed:

    -        c:emit_signal('request::activate',"rules")
    +        c:emit_signal('request::activate', "rules", false)
2015-07-10 15:13:16 +02:00
Daniel Hahler bd885f59f5 awful.client.property.set: emit property:: signals only on change
Emit "propery::" signals and call `c:set_xproperty` only if the
properties new value has changed.
2015-07-09 13:04:29 +02:00
Daniel Hahler ae7c7ff382 awful.tag: emit property:: signals only on change
This can have a significant performance impact in case you listen to the
property::hide signal to auto-hide tags for example.
2015-07-09 13:04:29 +02:00
bjp 4f865e66ed Add more keyboard shortcuts to the prompt
This adds the following readline/emacs style shortcuts to the prompt:
Ctrl+p, Ctrl+n, Alt+b, Alt+f, Alt+d, Alt+BackSpace.

Closes https://github.com/awesomeWM/awesome/pull/282.
2015-07-09 12:03:49 +02:00
Daniel Hahler 5630ad1bb2 taglist: call taglist_update only once per main loop
Currently `taglist_update` gets triggered often, because it listens to
a lot of signals.
This patch makes it only call the last one through `timer.delayed_call`.
2015-07-09 11:46:46 +02:00
Daniel Hahler 1924e044f7 tasklist: call tasklist_update only once per main loop
Currently `tasklist_update` gets triggered often, because it listens to
a lot of signals.
This patch makes it only call the last one through `timer.delayed_call`.
2015-07-09 11:46:45 +02:00
Daniel Hahler 367ad2d9a6 awful.tag.delete: single call to #c:tags()
This is a minor performance optimisation I came across.
2015-07-07 18:42:24 +02:00
Daniel Hahler d361eeab34 Make use of the new `oldscreen` argument with property::screen handlers
Closes #285
2015-07-05 17:42:57 +02:00
actionless c961622fc0 fix(lib: awful: layout): equal useless gaps 2015-07-03 02:34:39 +02:00
actionless 82549c04cd feat(lib: awful: tag): get useless_gap from beautiful if no any 2015-07-02 23:24:04 +02:00
actionless 01ac50c5ed feat(lib: awful: layout): set useless gap 2015-07-02 22:49:00 +02:00
Emmanuel Lepage Vallee a7f2600a38 layout: attached_connect_signal is deprecated 2015-07-02 22:11:46 +02:00
Emmanuel Lepage Vallee 056dee0426 layout: Remove dead code 2015-07-02 22:11:39 +02:00
Emmanuel Lepage Vallee 1aacf1efc4 Add useless gap utility functions 2015-07-02 22:11:01 +02:00
Daniel Hahler cb7f4b06eb Use `hints` table argument with `request::activate` signal 2015-06-25 06:47:39 +02:00
Daniel Hahler 2e2d60a1f9 client.focus.byidx: handle raising in the function itself 2015-06-25 06:47:39 +02:00
Daniel Hahler ed09d8ed4f Use request::activate with raise=false instead
Ref: https://github.com/awesomeWM/awesome/pull/224#issuecomment-101790416
2015-06-25 06:47:39 +02:00
Daniel Hahler 6dc355cf71 autofocus: use request::focus instead of request::activate
In #152 I've changed the autofocus handler to emit the request::activate
signal, instead of setting client.focus only.

This is wrong IMHO, and can be annoying:

If you have two floating clients above a tiled / maximized one, and
close one of the floating ones, with the tiled one being the one
selected by autofocus, it will be raised above the other floating
client.

This is changed now to use the new `request::focus` signal instead.

This basically reverts 20cdb5d (#152), but allows for customizing this
behavior, by overriding the default `request::focus` handler
(`ewmh.focus`).

It would be nice if there was a helper to check if a window's content
isn't visible at all (i.e. covered by other windows), and that could be
used then by the (new) default handler for request::focus - raising the
client only, if it's completely covered by another window.

Fixes https://github.com/awesomeWM/awesome/issues/217
2015-06-25 06:47:39 +02:00
Daniel Hahler 401f21f8e2 Add request::focus signal, with ewmh.focus being the default handler
This still does `client.focus = c` by default, but allows to customize
it.

This was initially suggested in #194, but by using `request::activate`
instead, which would not be the same.  Therefore a new signal is being
used instead.

Helped-by: Samir Benmendil <samir.benmendil@gmail.com>
2015-06-25 06:47:39 +02:00
actionless cec04b2684 Add DPI support and 'xresources' theme
This makes awesome respect DPI settings, and adds a new theme based on
xrdb and xsettingsd color settings ("xresources").

Closes https://github.com/awesomeWM/awesome/pull/229
2015-06-25 06:40:38 +02:00
Uli Schlachter d990e7918f Use :weak_connect_signal() for connecting to widget::updated
This way "that other widget" doesn't prevent the current widget from being
garbage collected.

Please note that this in all of these cases the widget under consideration does
have a strong reference to the callback function. This means that the callback
cannot be garbage collected until "this widget" itself is collected. Thanks to
this, this change is safe.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-06-25 06:37:05 +02:00
Uli Schlachter 089ed0e8dd gears.object: Add :weak_connect_signal()
Connecting to a signal weakly has the same effect as connecting to it strongly,
but it allows the garbage collector to disconnect the signal in case nothing
else references this function.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-06-25 06:37:04 +02:00
actionless 89beaf12e5 fix: rename the rest of *.lua.in files 2015-06-22 11:28:36 +02:00
Julian Wollrath ba62665fd6 Remove some trailing whitespaces. 2015-06-19 23:13:31 +02:00
Julian Wollrath 6cc7be512c Remove the *.in from all files.
Signed-off-b: Julian Wollrath <jwollrath@web.de>
2015-06-19 22:33:32 +02:00
Emmanuel Lepage Vallée 4bea4554fb Merge pull request #265 from blueyed/doc-improve-key
doc: improve doc for key.key and awful.key
2015-06-19 16:09:26 -04:00
Daniel Hahler e25bc558c4 doc: fix typos with root.c and beautiful 2015-06-19 21:04:17 +02:00
Daniel Hahler c2ee98b69c doc: improve doc for key.key and awful.key 2015-06-19 20:59:14 +02:00
jaysonwillson 3fe663fc60 Fix interactive notifications: use uint32 instead of int32
Fixes https://github.com/awesomeWM/awesome/issues/259.
Closes https://github.com/awesomeWM/awesome/pull/261.
2015-06-15 02:23:57 +02:00
Uli Schlachter 5cf13dba6b awful.layout.inc: Hide API breakage
In commit 3cbdc2a79f, the argument order for awful.layout.inc was changed
from (layouts, i, s) to (i, s, layouts), so that layouts can become an optional
parameter. However, this change (obviously) breaks user configs.

To hide this breakage, we assume the old argument order if the number i is a
table. This cannot break anything, since the operator "+" will error out on
tables anyway. :-)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-06-12 19:07:31 +02:00
Uli Schlachter 31fcc11272 textclock: Load GLib.DateTime only once
I doubt that this makes much of a difference since lgi surely caches things, but
this still seems nicer to me.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-06-12 10:57:42 +02:00
Uli Schlachter fe0a96d7f1 keyboardlayout: Don't mess with undefined variables
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-06-12 10:57:22 +02:00
Uli Schlachter 75f2f6bf86 corner layout: Don't set geometries directly
Since commit 52ec0ebd93, layouts should return the geometries to their caller
instead of setting them directly. The caller will also fix up the geometries for
border width.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-06-12 10:54:59 +02:00
Uli Schlachter a64cd26f62 corner layout: Properly "local"ize variables
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-06-12 10:52:44 +02:00
Ganesh Ajjanagadde f2e74994f2 awful.textclock: fix timezone handling
This fixes issue #249.
2015-06-12 02:28:06 +02:00
Salorium c30fe5b166 wibox.widget.systray: fix error while drawing widget
> bad argument #2 to 'systray' (number has no integer representation)

Closes https://github.com/awesomeWM/awesome/pull/247
2015-06-12 02:24:44 +02:00
Alexis BRENON c2842fe8f3 Add a new tag layout: corner
Closes https://github.com/awesomeWM/awesome/pull/251
2015-06-12 02:18:07 +02:00
Daniel Hahler 3d8db91602 doc: fix ldoc for client.focus.history.get 2015-06-10 21:39:50 +02:00
Daniel Hahler 496fce0f90 autofocus: use focus.filter, via new arg to focus.history.get
This adds an optional `filter` arg to awful.client.focus.history.get,
and uses `awful.client.focus.filter` from the autofocus module.

This improves the behaviour when manually setting clients as
non-focusable (#237), and is considered to be the desired behaviour in
general.

Closes https://github.com/awesomeWM/awesome/pull/242.
2015-05-25 23:05:07 +02:00
Alex Kir 82e62a0fad Added function to check state of notifications
Sometimes is a good idea to check if notifications are suspended,
for example, for changing the icon. This function just returns the value
of suspended.

Closes https://github.com/awesomeWM/awesome/pull/222.
2015-05-21 20:19:41 +02:00
Daniel Hahler bafa12ca24 Merge pull request #221 from anatol/master
Use table.unpack() with Lua5.2 instead of deprecated unpack()
2015-05-19 16:00:29 +02:00
Daniel Hahler 3618d95b11 minor: doc fix for awful.widget.keyboardlayout 2015-05-13 12:52:22 +02:00
Anatol Pomozov 3b146b834c Use table.unpack() with Lua5.2 instead of deprecated unpack() 2015-05-12 10:23:27 -07:00
bew78 - lesell_b 4845a73df2 Update finder.lua.in 2015-04-24 22:47:06 +02:00
Daniel Hahler 344965a328 Merge pull request #206 from dodo/menu-fixes
Fixes for awful.menu
2015-04-19 19:02:32 +02:00
Daniel Hahler 98c4ae8573 Fix ldoc target for awful.widget.keyboardlayout
Define @classmod wibox.widget.keyboardlayout, otherwise ldoc fails to
find the base class:

> module(...) name deduction failed: base .../src/build/docs/capi/ .../src/build/lib/awful/widget/keyboardlayout.lua

Fixes https://github.com/awesomeWM/awesome/pull/149#issuecomment-94014438
2015-04-19 00:31:11 +02:00
▟ ▖▟ ▖ fc39db377f awful.menu: resize menu when item count changes
When the number of items of a menu change by menu:add or menu:delete
and the menu is shown, its wibox has to resize.
2015-04-18 08:57:15 +02:00
▟ ▖▟ ▖ 40b4387e6d awful.menu: update t new layout api
Apparently the style to get the direction of a wibox.layout.* changed
from calling get_dir to just accessing the attribute dir.
2015-04-18 08:53:57 +02:00
Emmanuel Lepage Vallée 2f24ec69e1 Merge pull request #149 from lexa/master
xkb: implementation of keyboard layout switcher
2015-04-17 11:23:16 -04:00
Daniel Hahler 40e76cf92b Merge pull request #175 from blueyed/ewmh-fullmax-fix-offscreen
ewmh: screen_change: fix off-screen geometries
2015-04-17 17:20:29 +02:00
Daniel Hahler 594825c929 Fix awful.completion for zsh
This fixes 704cf21.
2015-03-31 00:11:22 +02:00
Aleksey Fedotov d9b1d5490c xkb: Added widget to display current keyboard layout
Widget shows current keyboard layout short name (usually two letters,
for example 'us', 'de'). Indicator will be hidden if only one layout
configured.  Layout can be switched either by clicking on widget or by
function keyboardlayout.next_layout()
2015-03-29 22:36:02 +03:00
Daniel Hahler e1fa04a15d ewmh: screen_change: fix off-screen geometries
When moving a fullscreen/maximized client to a smaller screen or with
different Y offset etc, its offset was not handled properly.

This moves it first into the new area, and then makes sure that its not
off-screen.  The latter should not happen, because the width/height is
adjusted before.
2015-03-21 05:54:01 +01:00
Daniel Hahler 07486f7ead tag.lua: add "property::icon_only" signal
Thanks @NormalRa for the patch.

Fixes #138.
2015-03-17 16:24:47 +01:00
taptap 5b81a0db60 Add reset_timer and replace_text functions
Enables users to replace text and reset expiration timeouts of existing
notifications, which is necessary for OSD creation by means of naughty.

Signed-off-by: taptap <alexey.e.egorov@gmail.com>
2015-02-28 23:54:02 +01:00
Julian Wollrath ca89f0f311 Use LDoc commands to mark parameters as optional in the docs.
Signed-off-by: Julian Wollrath <jwollrath@web.de>
2015-02-28 23:14:15 +01:00
Daniel Hahler ffa535ca29 doc: fix markup with wibox.widget.textbox:set_markup 2015-02-28 23:14:14 +01:00
Daniel Hahler 1b6564f209 docs: fix HTML / table param with awful/widget/tasklist.lua 2015-02-28 23:14:14 +01:00
Daniel Hahler 65ad83ac30 docs: ignore awful/widget/init.lua, not common 2015-02-28 23:14:14 +01:00
Daniel Hahler 2930c0ab4a doc: fix for awful.util.geticonpath 2015-02-28 23:14:14 +01:00
Julian Wollrath 3a34b49179 Fix LDoc warning. 2015-02-28 23:14:13 +01:00
Daniel Hahler faa1c74f03 doc: refer to gears.color.create_pattern from set_color 2015-02-28 23:14:13 +01:00
Julian Wollrath 4d7bd19014 Make everything wibox related a class in the docs.
Signed-off-by: Julian Wollrath <jwollrath@web.de>
2015-02-28 23:14:13 +01:00
Julian Wollrath f8a3209707 Fix ldoc warning.
Signed-off-by: Julian Wollrath <jwollrath@web.de>
2015-02-28 23:14:13 +01:00
Julian Wollrath 6de9d1e1d5 Make description of awful.mouse.finder readable.
Signed-off-by: Julian Wollrath <jwollrath@web.de>
2015-02-28 23:14:13 +01:00
Julian Wollrath b16944a654 Fix generation of the docs.
Signed-off-by: Julian Wollrath <jwollrath@web.de>
2015-02-28 23:14:13 +01:00
Julian Wollrath 939dab8ba9 Some more doc fixes all over the place.
Signed-off-by: Julian Wollrath <jwollrath@web.de>
2015-02-28 23:14:13 +01:00
Julian Wollrath 668055479e Convert usage of HTML to markdown.
Signed-off-by: Julian Wollrath <jwollrath@web.de>
2015-02-28 23:14:13 +01:00
Julian Wollrath 38e2a47157 Fixup newly introduced whitespace issues.
Signed-off-by: Julian Wollrath <jwollrath@web.de>
2015-02-28 23:14:12 +01:00
Ignas Anikevicius (gns_ank) b96b3ef31c Docs: Move all docs to a `docs` folder.
This moves all of the documentation into a separate folder, which keeps
everything in one place and avoids unnecessary clutter.

This will pay off when proper guides are written for various aspects of
using awesome or contributing to it.

This also updates the building system, so that the docs are properly
generated with new directories.

Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
2015-02-28 23:14:12 +01:00
Ignas Anikevicius (gns_ank) 6ab86b5d03 Docs: Add local functions to beautiful and naughty
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
2015-02-28 23:14:12 +01:00
Ignas Anikevicius (gns_ank) 4b94f05799 Docs: Naughty - mostly done
Reorganise the config table, so that we have a single table and the
fields are nested.

Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
2015-02-28 23:14:12 +01:00
Ignas Anikevicius (gns_ank) 734cc2f59c Docs Finish beautiful
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
2015-02-28 23:14:12 +01:00
Ignas Anikevicius (gns_ank) 654b110322 Docs: Fix the header for beautiful
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
2015-02-28 23:14:12 +01:00
Ignas Anikevicius (gns_ank) ed0bf91122 Docs: Work on naughty
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
2015-02-28 23:14:12 +01:00
Ignas Anikevicius (gns_ank) 7f8a0787b8 Docs: General work on the awful module.
This is basically an initial stab for some modules and some
experimenting with the `@classmod` directive.

For most of the docs only basic transforming was done.

At the moment the tooltip module looks the best.

Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
2015-02-28 23:14:12 +01:00
Ignas Anikevicius (gns_ank) e4fa6effe2 Docs: Fix headers for the wibox module
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
2015-02-28 23:14:11 +01:00
Ignas Anikevicius (gns_ank) 00f558ff92 Docs: General work on gears module.
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
2015-02-28 23:14:11 +01:00
Ignas Anikevicius (gns_ank) de10f5e4f0 Docs: awful.layouts fixup
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
2015-02-28 23:14:11 +01:00
Ignas Anikevicius (gns_ank) 9f8e2b1336 Docs: Begin work on awful.client
This fixes usage and some and client parameter types.
2015-02-28 23:14:11 +01:00
Ignas Anikevicius (gns_ank) a0051c7dc4 Docs: Start menubar refactoring
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
2015-02-28 23:14:11 +01:00
Ignas Anikevicius (gns_ank) 20eeb66541 Docs: Start gears.color refactoring
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
2015-02-28 23:14:11 +01:00
Ignas Anikevicius (gns_ank) f726dcee61 Fix LDoc errors on generating the documentation.
This also at the same time ports the documentation to the new `Markdown`
format.
2015-02-28 23:14:11 +01:00
Ignas Anikevicius (gns_ank) 12185a5aae Docs: Port awful.rules into the new doc format.
This converts the old documentation style into the new one to use
markdown instead of HTML in bigger doc blocks. Also, we can use block
comments, which means that writting documentation (and indenting code
blocks) easier.

Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
2015-02-28 23:14:11 +01:00
Emmanuel Lepage Vallée 2f0a7f9de4 Merge pull request #150 from Elv13/fix_arrange_error
layout: Fix delayed arrange regression
2015-02-24 20:52:19 +00:00
Daniel Hahler 025b2841da autofocus: emit `request::activate` signal
After a client gets unmanaged, the newly focused client might not be
visible / raised above other windows.

Using the `request::activate` signal makes the autofocus handler more
flexible, and will raise the focused client by default.
2015-02-24 15:33:49 +01:00
Daniel Hahler 015e3e985b Merge pull request #144 from actionless/menubar-paginated-scroll
feat(lib: menubar): add paginated scrolling
2015-02-24 12:21:23 +01:00
actionless 2a9b1d00e1 feat(lib: menubar): add paginated scrolling
also fixes some local/global issues and adds saving current geometry to the instance table
2015-02-23 20:34:26 +01:00
Emmanuel Lepage Vallee c88c51f74d layout: Fix delayed arrange regression 2015-02-22 22:32:16 +00:00
Kenton 517d6049c8 added middle anchors for naughty notifications
top_middle and bottom_middle can be used as position arguments for new naughty.notifications
2015-02-21 17:37:30 -05:00
Daniel Hahler d1984a7a1f Merge pull request #95 from blueyed/signal-client-property-screen-old
Send old_screen with "property::screen" client signal
2015-02-20 23:25:38 +01:00
Daniel Hahler 6bffd1938a Merge pull request #132 from awesomeWM/doc-fixes
A new set of doc fixes / improvements
2015-02-19 22:39:28 +01:00
Daniel Hahler 696f93f4d5 Merge pull request #123 from blueyed/tooltip-add-delay_show
awful.tooltip: add "delay_show" arg
2015-02-19 22:38:38 +01:00
Emmanuel Lepage Vallée aa0b9becf7 Merge pull request #101 from silverhammermba/drylayouts
DRY off layout code
2015-02-19 19:33:36 +00:00
Daniel Hahler 5d0fc566e9 awful.tooltip: add "delay_show" arg
This will wrap the show and hide methods using gears.timeout.
2015-02-19 18:16:00 +01:00
Daniel Hahler 9702fc63c6 Merge pull request #125 from blueyed/fix-placement-no-offscreen-xy-at-0
awful.placement.no_offscreen: no negative x/y
2015-02-18 23:34:29 +01:00
Daniel Hahler 8b6acb830f minor: code style fixes 2015-02-17 18:55:26 +01:00
Daniel Hahler f05ebc5d98 awful.tag: fix call to update_urgent from client_untagged
Ref: #130
2015-02-17 18:38:43 +01:00
Daniel Hahler 289bc26a3c doc: config.ld: setup @client alias, and use it
It also adds the "@tab" alias, which did not work for me, but should be
the default?!
2015-02-15 22:33:23 +01:00
Daniel Hahler 47ffb1610c doc: improve meta info / structure for gears.timer 2015-02-15 22:30:05 +01:00
Daniel Hahler 302e698ba8 minor 2015-02-15 22:30:05 +01:00
Daniel Hahler 29d1b473f8 Fix doc for textbox:set_markup 2015-02-15 22:30:05 +01:00
Max 52ec0ebd93 Don't create borders/set client geometry in layouts
Instead, layouts simply store client geometries in a table.
awful.layout.arrange corrects these for border widths and applies them.
2015-02-15 11:25:11 -05:00
Daniel Hahler 246de56aad Use delayed calls for autofocus signal handlers
This avoids awful.autofocus to kick in, focusing some other client in
between (where a focused signal would get emitted for, although the
intermediate client was never meant to have focus).

This is the traceback:

    stack traceback:
      /home/user/.config/awesome/cyclefocus/init.lua:199: in function 'add'
      /home/user/.config/awesome/cyclefocus/init.lua:309: in function </home/user/.config/awesome/cyclefocus/init.lua:304>
      [C]: ?
      /usr/local/share/awesome/lib/awful/autofocus.lua:22: in function 'check_focus'
      /usr/local/share/awesome/lib/awful/autofocus.lua:31: in function </usr/local/share/awesome/lib/awful/autofocus.lua:28>
      [C]: ?
      /usr/local/share/awesome/lib/awful/tag.lua:517: in function 'viewonly'
      /usr/local/share/awesome/lib/awful/client.lua:69: in function 'jumpto'
      /home/user/.config/awesome/rc.lua:1188: in function 'client_run_or_raise'
      /home/user/.config/awesome/rc.lua:1217: in function 'run_or_raise'
      /home/user/.config/awesome/rc.lua:1243: in function 'press'
      /usr/local/share/awesome/lib/awful/key.lua:42: in function </usr/local/share/awesome/lib/awful/key.lua:42>

Ref: https://github.com/awesomeWM/awesome/pull/19

This supersedes https://github.com/awesomeWM/awesome/pull/107.
2015-02-15 14:23:10 +01:00
Daniel Hahler 5140ef1764 Send old_screen with "property::screen" client signal
This should improve layout re-arranging with 2+ screens.
2015-02-15 13:26:46 +01:00
Daniel Hahler a791e695bb Merge pull request #121 from awesomeWM/doc-fix-tooltip
doc: fix/improve markup for awful.tooltip
2015-02-15 13:12:57 +01:00
Daniel Hahler 17776051ec layout.arrange: delay a call per screen
This is a followup / fix for 7410646, which did not handle multiple
arrange calls to different screens per main lopp.
2015-02-15 12:09:16 +01:00
Daniel Hahler 0d17ac0d0c doc: fix/improve markup for awful.tooltip 2015-02-15 12:02:58 +01:00
Daniel Hahler 62346a75a9 awful.util.deprecate: do not use glib.String() for the hash
This works around a crash and is not really required.

Fixes https://github.com/awesomeWM/awesome/issues/127.
2015-02-15 10:52:35 +01:00
Daniel Hahler f2aa8d39ed Merge branch 'ewmh_urgent_v1'
- Fix / revert changing of file modes for: lib/awful/tag.lua.in,
   lib/awful/widget/taglist.lua.in, objects/client.c and property.h.
 - Fix typo / punctuation in doc.
 - Use `capi.client.connect_signal` instead of `add_signal`
   (Ref: https://github.com/Elv13/awesome-1/commit/b292b09#commitcomment-9750466).

Pull request: https://github.com/awesomeWM/awesome/pull/33
2015-02-14 23:36:26 +01:00
Daniel Hahler 9f8dff8a14 awful.placement.no_offscreen: no negative x/y
If a client's width/height is larger than the screen's geometry, align
it at the screen's x/y offset.

Test case with gvim, from a maximized terminal on a floating tag:

    % gvim -u NONE -N --cmd "set lines=$((LINES + 5))"

Without this patch the top of the window is off-screen, but the bottom
should be.  Fixing it using a number of lines that fit the screen should
display the window completely.
2015-02-14 22:04:36 +01:00
Daniel Hahler e30935c934 Merge pull request #91 from Ram-Z/icon_only
widget/taglist: don't add margin when icon_only = true
2015-02-14 20:58:46 +01:00
Daniel Hahler 6183d8587a Merge pull request #118 from blueyed/fix-proper-activate-via-rules
Properly fix activating an "invisible" client via rules
2015-02-14 20:55:04 +01:00
Samir Benmendil f453863794 Don't add margin when icon_only = true
Avoid adding an unnecessary margin to the taglist if it has the
`icon_only` property.

Fixes FS#1199 - widgets add an unnecessary margin if icon_only= true
https://awesome.naquadah.org/bugs/index.php?do=details&task_id=1199
2015-02-14 17:03:09 +00:00
Daniel Hahler 8fa1309279 Merge pull request #105 from blueyed/awful-util-deprecate-once-per-traceback
awful.util.deprecate: display deprecations only once
2015-02-14 15:38:36 +01:00
Daniel Hahler 0a76e41cb8 Use lgi.GLib.String():append(tb):hash() 2015-02-14 15:37:09 +01:00
Daniel Hahler 74106462ac Do layout.arrange only once per main loop
This uses timer.delayed_call to arrange the layouts only once per main
loop.
2015-02-14 15:10:31 +01:00
Daniel Hahler ffa0001d34 Merge pull request #96 from blueyed/emit-tag-history-update-from-restore
Emit tag::history::update signal from tag.history.restore
2015-02-14 14:55:28 +01:00
Daniel Hahler b77e23c047 Merge branch 'partly-revert-pr-87' into fix-proper-activate-via-rules
This reverts PR #87, except for f562b4a ("luaA_object_emit_signal: check
for valid object").
2015-02-14 14:37:25 +01:00
Daniel Hahler 76ede0ef45 Revert "awful.rules.execute: use delayed_call for emitting request::activate"
The 'request::activate' signal should be sent and handled immediately,
and not delayed.  It was too much of a hack to work around the client
not being visible.

Instead, the "is visible" constraint on `capi.client.focus` will be
removed.

This reverts commit 6963ede3dc.
2015-02-14 14:30:04 +01:00
Daniel Hahler 055ad392ee Revert "Revert "Partly revert commit 90fde1393f""
This reverts commit 1c6463822e.
2015-02-14 14:29:16 +01:00
Uli Schlachter b4d677797a awful.util.unittest: Move into spec/
This gets rid of awful.util.unittest and instead creates an automatic test for
it under spec/awful/util_spec.lua. In the process, it also fixes the test to
actually test the right thing and I took the liberty to add some more tests.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-02-14 13:38:01 +01:00
Daniel Hahler c74b11fee8 Merge pull request #87 from blueyed/fix-client-visible-during-activate
awful.rules.execute: use delayed_call for emitting request::activate
2015-02-13 02:02:15 +01:00
Emmanuel Lepage Vallée 5fde04c4cf Merge pull request #104 from blueyed/util.file_readable-check-for-not-dir
awful.util.file_readable: return false for dirs
2015-02-11 23:48:49 +00:00
Emmanuel Lepage Vallee 1306a543c2 Use tag urgent::property instead of looping every clients in awful.widgets.taglist 2015-02-10 19:28:09 +00:00
Emmanuel Lepage Vallee b292b09328 Add 'urgent' property to tags 2015-02-10 19:28:04 +00:00
Emmanuel Lepage Vallee d688ebe6cd Add new request::urgent signal
This fix two things:

(1) Clients asking to be urgent while focussed, this have been reported
a few time for urxvt and I usually link a patch that fix this. This may
not be considered a bug by some, but I think it is.

(2) Add the ability to stop noisy clients from setting the urgent state
themselves.
2015-02-10 19:27:46 +00:00
Daniel Hahler 627f8ea20f Remove 'enc=utf-8' from Vim modelines
This is not allowed, and results in:

> E520: Not allowed in a modeline: enc=utf-8
2015-02-10 20:18:46 +01:00
Daniel Hahler 1c6463822e Revert "Partly revert commit 90fde1393f"
This reverts commit 254e50d88c.
2015-02-10 09:35:53 +01:00
Daniel Hahler 6963ede3dc awful.rules.execute: use delayed_call for emitting request::activate
This is a followup to commit 90fde13, which caused the client not to be
visible during the request::activate callback.

This requires an initial call to `awesome_refresh` before the main loop
to get `awesome.startup` right.

Ref: https://github.com/awesomeWM/awesome/commit/90fde139#commitcomment-9308225
2015-02-10 09:35:53 +01:00
Daniel Hahler 3ab3bb900a Merge pull request #93 from blueyed/enforce-client-geometry
awful.ewmh: Enforce client geometry (FS#764, FS#1216)
2015-02-10 09:33:33 +01:00
Emmanuel Lepage Vallée 3d3c216705 Merge pull request #106 from blueyed/traceback-with-imagebox-set_image-error
Print debug.traceback() with imagebox:set_image, when reading image failed
2015-02-09 19:50:18 +00:00
Daniel Hahler 60e04d3ae3 menubar: get_icon_lookup_path: only look in apps/ with icon_themes
Ref: https://github.com/awesomeWM/awesome/pull/100#issuecomment-73559676
2015-02-09 20:45:32 +01:00
Daniel Hahler dc41e62f9a menubar: icon_formats: svg is supported 2015-02-09 20:45:32 +01:00
Daniel Hahler d25e15001f Move building of icon lookup path into get_icon_lookup_path 2015-02-09 20:45:32 +01:00
salorium c315687dad menubar: improve path icon behavior
This adds $XDG_DATA_DIRS and HOME/.icons for icon lookups.
2015-02-09 20:45:32 +01:00
Daniel Hahler 8df51d0b8c awful.util.deprecate: display deprecations only once
This remembers displayed tracebacks and skips them if they were
displayed already.
2015-02-09 20:26:57 +01:00
Daniel Hahler a6718a4a0d Print debug.traceback() with imagebox:set_image, when reading image failed
This made it easier to figure out where a file causing an error was
coming from, but I could imagine that this could become too noisy, and
that there is/should probably be a more streamlined way to enable more
verbose logging / error output.
2015-02-09 20:20:21 +01:00
Daniel Hahler a0e7f88b00 awful.util.file_readable: return false for dirs
This is currently only used for icon lookups / where files are expected.
2015-02-09 20:17:40 +01:00
Daniel Hahler 3a160c9363 awful.client.property.get: fix loading multiple persistent properties
When loading persistent properties for a client, the loop value wasn't used,
but the original/requested property.  This would only get triggered when
using more than one persistent client property (the default is one,
"floating").
2015-02-08 02:46:40 +01:00
Daniel Hahler 516dd91027 Re-apply naughty: Fix builds without dbus (d5088c5)
This got lost in 355f106 (naughty: Split up into core and dbus).
2015-02-06 23:08:07 +01:00
Roy Crihfield 02bfd06038 menubar: quote special chars
- Simplified & renamed nocase function
 - Add pattern-quoting functions to awful.util:
   - awful.util.query_to_pattern
   - awful.util.quote_pattern
 - awful.util: Add basic unit tests for menubar query

Fixes https://github.com/awesomeWM/awesome/issues/84.
2015-02-06 18:27:38 +01:00
Daniel Hahler 4557b59a3e awful.ewmh: Enforce client geometry (FS#764, FS#1216)
This reverts "Revert "awful.ewmh: Enforce client geometry
(FS#764,FS#1216)"", but adds a fix to ignore property::geometry signals
coming from geometry_change itself.

FS#764: https://awesome.naquadah.org/bugs/index.php?do=details&task_id=764
FS#1216: https://awesome.naquadah.org/bugs/index.php?do=details&task_id=1216

This reverts commit 8cf48d1fe8.
2015-02-02 10:22:07 +01:00
Daniel Hahler 704cf21b68 completion: quote strings passed to the shell
The strings passed to the shell completion machinery need to be quoted.
2015-01-24 11:15:17 +01:00
Uli Schlachter 0469cb4481 Merge branch 'pr=desktop-name' of git://github.com/roysc/awesome 2015-01-23 21:02:03 +01:00
Uli Schlachter 70bcdef1fd Merge branch 'master' of git://github.com/AlexisBRENON/awesome 2015-01-23 21:01:17 +01:00
Uli Schlachter 254e50d88c Partly revert commit 90fde1393f
That commit made awful.tag use timer.delayed_call() to call withcurrent() during
the manage signal. The idea was "if nothing else assigns any tags until the end,
apply some default ones".

However, the C core refuses to set the input focus to an unviewable client and
thus this means that setting the input focus during manage failed. So, instead
of using the delayed_call(), just call withcurrent() directly, like we did
before.

However, some part of that commit is still left: Awful.rules no longer
disconnects the withcurrent() callback from the "manage" signal. This was
originally added in commit 5e7ddd1efa, because it clients flickered otherwise if
they were moved to some unselected tag during "manage". This happened because
the C code unbanned the client when it got assigned the input focus and only
later did some other code move it to some unselected tag.

However, this flickering will no longer occur, because commit 3dbf89c990 added
lazy focus setting. Thanks to this, setting the focus no longer unbans a client
as a side-effect. Thus, if you focus a client and then remove it from all
selected tags, nothing will be visible on-screen.

To make a long story short: This commit reverts the part of commit 90fde1393f
which caused side effects. The part that wasn't necessary any more is left in.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-23 20:51:35 +01:00
Roy Crihfield d268dba075 menubar: handle nil Name in .desktop files 2015-01-21 17:56:12 -05:00
Daniel Hahler 532c113e1f minor: doc fixes for keygrabber.lua 2015-01-21 08:33:03 +01:00
Alexis BRENON 0c06d37899 [beautiful] Beautiful initialization handle path or table
Allow beautiful to be initialized either with a path to the theme file or directly with a table
2015-01-20 15:37:35 +01:00
Uli Schlachter 90fde1393f awful.tag: Use delayed_call to call withcurrent on manage
This way this function runs after everything else did its job. The client will
only get assigned a tag after everything else had a chance to do so.

Thanks to this, awful.rules no longer has to disconnect the call to withcurrent.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-11 11:19:04 +01:00
Uli Schlachter 7bc4ab0bf7 gears.object: Assert that arguments have the correct type
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-11 11:19:04 +01:00
Uli Schlachter 6fc15f4afd Add and use gears.timer.delayed_call
This function calls a callback at the end of the current main loop iteration.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-11 11:19:04 +01:00
Uli Schlachter 26ffd2c6f2 naughty.dbus: Fix the CloseNotification method
It was broken when naughty was split up.

Thanks to trollixx for reporting this on IRC.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-10 21:06:30 +01:00
Uli Schlachter 2e286a45d8 awful.mouse.finder: Remove rounded_corners call
Let's just quote a mail I received from Rastislav Barlik:

I tried to make use of awful.mouse.finder but I found out that it's not working
as supporting functions rounded_corners were removed with commit
03e0ee53d2.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-10 20:28:26 +01:00
Uli Schlachter 6afb5f28a2 naughty.dbus: Make this actually work
Apparently I still had an old naughty.lua laying around in build/lib and thus
this new code wasn't actually tested. It's a miracle that it works so well
besides this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-10 20:27:26 +01:00
Uli Schlachter 223a8c8742 naughty.dbus: Factor out a helper function
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-10 18:57:38 +01:00
Uli Schlachter 355f10609c naughty: Split up into core and dbus
No changes in functionality intended.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-10 18:44:30 +01:00
Uli Schlachter 239bc02d83 naughty: Make the actions API more useful to lua code
Previously it was just tailored for the dbus interface's needs.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-10 17:51:12 +01:00
Uli Schlachter 509bbe7230 naughty: Add a destroy callback argument to naughty.notify
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-10 17:32:27 +01:00
Uli Schlachter d5088c5f6f naughty: Fix builds without dbus
The new notification action code tried to emit dbus signals even if awesome was
build without notification support. Fix this by adding the necessary "if".

(This also removes an unused return value which wasn't marked as "local" and
thus triggered my "complain if something messes with the global env"-script)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-10 16:56:03 +01:00
Uli Schlachter a36ddb68e1 gears.timer: Don't assert() that no error occured
The whole point of this pcall() is that we do not have unprotected Lua errors,
because those kill awesome. So instead of assert()ing, let's just print a
message.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-10 16:53:59 +01:00
Uli Schlachter 0f02ed0e15 Merge branch 'patch-1' of git://github.com/findkiko/awesome 2015-01-10 12:56:46 +01:00
Uli Schlachter ed3f93ceb9 Merge branch 'simplify-calc_timeout' of git://github.com/blueyed/awesome 2015-01-10 01:22:47 +01:00
Uli Schlachter 462518f926 Merge branch 'master' of git://github.com/barlik/awesome 2015-01-10 01:22:23 +01:00
Daniel Hahler 8261e02a0b Simplify `calc_timeout` with textclock
Ref: 8dc6fa8666 (commitcomment-8867170)
2015-01-06 16:41:56 +01:00
Rastislav Barlik ac5f8c69a7 Displaying only selected tags in taglist
Add taglist.filter.selected() for displaying only currently selected tags
2015-01-06 12:49:19 +01:00
Da Risk 28a6468f37 naughty: make sendNotificationClosed() and sendActionInvoked() local 2015-01-02 21:02:12 +01:00
Da Risk e664a74710 Add support for notification actions
The desktop notification specification says that a notification can have
different actions. These actions allow the user to interact with the client
application and should be displayed by the notification server.
* Add function to emit a DBus signal
* Notifications : emit NotificationClosed signal when closing notification
* Notifications: use constant for notification closed reasons
* notifications: Implement notifications actions

This is just a basic implementation to display the actions send with the
notifications. The actions should be displayed differently
* Notifications: add support for default action
2014-12-31 14:28:46 +01:00
Uli Schlachter b9ea9255e9 timer: Add a backwards-compatibility hack to awful
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-12-07 09:44:58 +01:00
Uli Schlachter 8dc6fa8666 textclock: Round timeout so that displayed time is more accurate
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-12-06 17:15:24 +01:00
Uli Schlachter 94e61ec94b timer: Move from C to lua as gears.timer
No API-change (besides the obvious no-longer-a-global-object) intended.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-12-06 16:44:04 +01:00
findkiko 6f5ec2abe7 Vim style menu navigation in addition to arrow keys
Is there a reason it shouldn't be on by default? I'm not familiar enough with the code-base to tell if it will clash with anything.
2014-11-30 15:27:28 -08:00
actionless 7c4010eea3 fix(lib: wibox: layout): fixed ldoc for set_spacing method 2014-11-08 01:08:26 +01:00
Uli Schlachter 6f992f13b0 Merge branch 'layout_spacing' of git://github.com/Elv13/awesome-1 2014-11-07 22:12:42 +01:00
Uli Schlachter 44fb6e4de2 Merge branch 'ewmh-activate-on-startup' of git://github.com/blueyed/awesome 2014-11-07 21:48:40 +01:00
Uli Schlachter 14e7274cc7 Merge branch 'request_context_v2' of git://github.com/Elv13/awesome-1 2014-11-07 21:46:59 +01:00
Uli Schlachter 904b679bc6 Merge branch 'tag_index_v1' of git://github.com/Elv13/awesome-1 2014-11-07 21:46:09 +01:00
Daniel Hahler d2168a9889 ewmh.activate: focus and especially raise clients during startup
This fixes the focused client (possibly) not being raised after
restarting awesome.
2014-11-06 21:26:32 +01:00
Emmanuel Lepage Vallee 45ad4459f2 tag: Improve tag property::index support (FS#1229)
* Move the "index" setting burden to individual functions
  instead of gettags().

* Add some properties earlier so the signal hooks will be called
  with valid data.
2014-11-01 18:46:06 -04:00
Emmanuel Lepage Vallee 37684abe33 Add context to request::activate signal 2014-10-25 23:31:23 -04:00
Robert Siska 8d7b0feedd Layouts can define their own resizing handler (FS#1267) 2014-10-23 01:30:19 +02:00
Uli Schlachter 1c72186cbc Merge branch 'fix_tag_remove_v1' of git://github.com/Elv13/awesome-1 2014-10-18 10:02:13 +02:00
Uli Schlachter a764afb81e Merge branch 'layout_unit_testability_V2' of git://github.com/Elv13/awesome-1 2014-10-18 10:01:00 +02:00
Emmanuel Lepage Vallee 848aadf95c wibox.layout: Add fixed and flex layouts widget spacing property 2014-10-18 01:17:50 -04:00
Uli Schlachter dd2f805e09 Merge branch 'tag_swap_V2' of git://github.com/Elv13/awesome-1 2014-10-17 10:37:50 +02:00
Emmanuel Lepage Vallee 3ff24467b9 tag.delete: Do not reset client tag when unnecessary 2014-10-13 21:36:11 -04:00
Emmanuel Lepage Vallee dfaef973c3 Add awful.tag.swap 2014-10-13 15:19:14 -04:00
Emmanuel Lepage Vallee 4120e00649 layouts: Allow layouts to be invoked with fake data
This patch allows 2 things to be done:

* Write unit test to validate layouts using fake clients and tags
* Query the current layout geometry from another tag

The advantages of the former are clear and simple. Those of the later include:

* Creating a screenshot of another layout
* Display the layout wireframe in the tag list (like KDE2-3, Gnome2)
* Having and 'ALT-tab' like visual popup for tags
2014-10-13 15:07:31 -04:00
Emmanuel Lepage Vallee 6d20094c15 awful.tag.update: Fix identical tag set detection
If the "current" table is empty, then identical always true.
There is a lot of case where this can happen. Mostly when using
dynamic tagging.
2014-10-13 15:00:09 -04:00
Uli Schlachter 983d094c76 wibox.layout.base.rect_to_device_geometry: Fix for "weird" rotations
The old code transformed the top-left and bottom-right corner of the rectangle
to device space and calculated a rectangle based on these two points. However,
if you rotate a rectangle by 45°, these two points will be directly above each
other and thus the old code would calculate a width of 0.

Fix this by transforming all four corners of the rectangle into device space and
calculating a rectangle based on this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-10-05 10:47:39 +02:00
Uli Schlachter 57b6433b53 Merge branch 'menubar-skip-comments-in-desktop-files' of git://github.com/blueyed/awesome 2014-09-25 21:11:41 +02:00
Daniel Hahler f2f6eb6821 menubar: skip comments in .desktop files 2014-09-25 02:47:40 +02:00
Uli Schlachter a113fe0f3c awful.widget.button: Override :set_image() to do the right thing
Reported-at: http://article.gmane.org/gmane.comp.window-managers.awesome/10778
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-09-15 13:55:21 +02:00
Uli Schlachter 305f148c4b gears.color: Use proper references in the doc comments
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-09-13 14:20:59 +02:00
Uli Schlachter 5c387f3bd1 gears.color: Add a way to bypass the pattern cache
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-09-13 14:16:54 +02:00
Daniel Hahler 4ee144188e tasklist: add/use a single icon for "maximized"
This provides more space in the tasklist, because it will typically only
use a single icon for maximized clients, instead of three
(maximized_vertical, maximized_horizontal and floating).

Fixes https://awesome.naquadah.org/bugs/index.php?do=details&task_id=1252
2014-09-04 18:38:18 +02:00
Uli Schlachter a64f8b1385 Merge branch 'fix-ldoc-usage' of git://github.com/blueyed/awesome 2014-09-02 14:21:42 +02:00
Daniel Hahler b6d32b136e ldoc: fix usage of @usage, which is <code> automatically 2014-08-28 19:45:46 +02:00
Evžen 93905348cb fix(lib.awful.taglist): multiple tag selection
multiple tag selection wasn't highlighting properly when *_occupied is set in theme table
2014-08-24 13:03:28 +02:00
Uli Schlachter e3c594823a Merge branch 'master' of git://github.com/tusj/awesome 2014-08-24 11:56:03 +02:00
Uli Schlachter 0dc6b7f724 gears.wallpaper: Make code more readable
by introducing some extra variables that server as some documentation.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-24 11:54:12 +02:00
Uli Schlachter 1942986468 Merge branch 'patch-1' of git://github.com/SammysHP/awesome 2014-08-24 11:46:13 +02:00
Uli Schlachter ba50e65b5b Add unit tests
This uses busted (http://olivinelabs.com/busted/) to implement unit testing.
This is wired up to "make check" and/or "make test".

This commit also adds tests for the more complicated parts of the gears and
wibox.layout libraries.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-23 22:09:06 +02:00
Uli Schlachter e4f352f390 wbox: Make :find_widgets() easily accessible
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-20 11:26:09 +02:00
Sindre Føring Devik 1e6f9f22a5 FS#1278 - Menubar should check all standard directories
Added local desktop directory to list of directories parsed by menubar
by using the XDG specification
2014-06-30 15:08:43 +02:00
SammysHP b6cdccda96 gears.wallpaper: Center maximized if no offset set
maximized() used to align the image with (0,0) so that it is shifted to the right or bottom. Most wallpapers are designed from the center, so this behavior is not desired usually. With this commit the wallpaper is centered when no offset is set. To get the old behavior use {x=0, y=0} for the offset parameter.
2014-06-08 20:18:09 +02:00
Uli Schlachter 9a0ba0ff57 Merge branch 'fix-clients-length' of https://github.com/tail/awesome 2014-05-11 17:28:29 +02:00
Uli Schlachter 3dd0c442a0 wibox.widget.systray: Special case the empty systray
Otherwise we could end up with negative size for the systray.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-05-11 17:24:01 +02:00
Dario Russo 07595ca617 systray: added definable icon spacing
Default is 0. Customized by adding theme.systray_icon_spacing
directive in theme.
2014-05-10 00:08:42 -04:00
Jason Yan aedcd90d4d Fix check against clients in taglist. 2014-05-09 00:19:49 -07:00
Uli Schlachter 9fce440078 awful.util.geticonpath: Correctly localize variables
This function was accidentally setting the global variable "icontypes". Fix this
by adding the needed "local" and also localize some more variables for
consistency.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-05-03 11:15:14 +02:00
Uli Schlachter 92dc63fe02 Remove unused argument to awful.client.property.persist
This is a left-over from an old version of the patch which introduced this new
function.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-21 19:30:03 +02:00
Daniel Hahler 6d04528bd8 Add persistent client properties
`client.property.persist` can be used to make properties persistent
across restarts. This works by backing them up via X properties (using
the `awful.client.property.` prefix).

`client.property.persist(c, "floating", "boolean")` is used to make the
floating property persistent by default.

Based on a patch from Uli, source: https://gist.github.com/psychon/10320743

doc, only set current prop in 'persist'

Fix xprop/prop mixup in 'persist'

Only call set for non-nil values
2014-04-20 14:54:21 +02:00
Uli Schlachter e998e3fe20 awful.client.shape: Import client shape handling (FS#1051)
This new awful module reacts to shapes that a client sets on itself and sets the
shape of awesome's frame window to match. This way, xeyes really gets
transparent parts again.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-14 10:04:56 +02:00
Uli Schlachter dcc348d75e Fix some random ldoc warnings
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-13 18:06:49 +02:00
Uli Schlachter e65ecb853b naughty: Support file:// URIs for icon paths
From the Desktop Notification Specification:

'The "app_icon" parameter and "image-path" hint should be either an URI (file://
is the only URI schema supported right now) or [...]'
https://developer.gnome.org/notification-spec/#icons-and-images-formats

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-13 12:22:24 +02:00
Uli Schlachter d76d3e0b6a Merge git://github.com/Teknocrat/awesome 2014-04-12 16:15:11 +02:00
Uli Schlachter 1090719d67 remove awful.widget.taglist.gettag (FS#1256)
It's been broken since ages.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-12 12:18:34 +02:00
Gino! b4b6e6c1fc Fix Icon Finding in awful.util
This should also fix naughty failures to display the correct icons
2014-04-11 17:43:23 -04:00
Uli Schlachter ec8db18289 awful.tag.setscreen: Check if old_screen == new_screen (FS#1249)
Setting a tag's screen to what it already is shouldn't have any bad effects.
However, this code messed up the tag order and selection status.

Fix this by returning early if the tag already has the right screen.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-09 22:06:21 +02:00
Uli Schlachter 27f483a601 awful.tag.move: Fix tag index setting (FS#1249)
Since commit 9c69e857ed, awful.tag.setscreen() unsets a tag's index to make
sure things end up in a sane order on the new screen. Thus, the call to
setscreen() removed the "index" property that tag.move just set.

Fix this by setting the index after the screen.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-09 22:06:10 +02:00
Uli Schlachter 96c49e6c6a gears.surface: Handle the cache more intelligently
It doesn't make sense for surface.load_uncached() to load a file without
inserting into the cache. The next "cached" load will have to load it again.

So move cache insertion into surface.load_uncached() and the only thing that
surface.load() does differently is checking if we have a suitable cache entry
before calling load_uncached().

So load_uncached() does the cache insertion and load() reads from the cache.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-09 21:55:07 +02:00
Uli Schlachter 88643eb0cc naughty: Don't use the cache when loading icons (FS#1253)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-09 21:49:27 +02:00
Emmanuel Lepage Vallee 7349f3b902 Make sure gears.color.create_png_pattern are being repeated 2014-04-08 22:57:05 +02:00
Emmanuel Lepage Vallee 5fdce4d845 Move 'surface_size' to gears.surface and make it public 2014-04-08 22:51:55 +02:00
Tin Benjamin Matuka d441030ba9 Allow reversing the icon order in systray
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-06 10:44:45 +02:00
Uli Schlachter ed6d5e0246 gears.color: Handle nil arguments correctly again
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-03 20:27:45 +02:00
Uli Schlachter 7967d05915 imagebox: Don't try to scale by infinite (FS#1248)
When an imagebox was drawn with width or height zero, it tried to calculate the
needed scale factor for making the image fit. Sadly, this would be a division by
zero aka infinite in this case.

Fix this by just not drawing anything if there is no space available.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-02 22:48:06 +02:00
Uli Schlachter afa50904fb Merge remote-tracking branch 'blueyed/awful-rules-optional-callback' 2014-04-01 16:31:03 +02:00
Uli Schlachter a7902f6260 wibox.drawable: Assert that no cairo error occurred
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-01 16:20:45 +02:00
Daniel Hahler df23964b20 Make callbacks to rules.execute optional 2014-04-01 10:48:18 +02:00
Uli Schlachter 6dfe48690b awful.tooltip: Add (and use) :set_markup() function
Since commit 5b4666432f, we use set_text() instead of set_markup()
on the tooltip's textbox. This means it is no longer possible to use pango
markup in the tooltip which was not intended.

Fix this (properly) by introducing a :set_markup() function on tooltips (and use
it in the timer function to restore the old behavior).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-30 23:35:35 +02:00
Uli Schlachter 90226d0ccf awful.tooltip: Small reorganization
This inlines the set_defaults() function into its only caller and makes us less
stupid with the font property.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-30 23:31:38 +02:00
Uli Schlachter 271f084735 screen: Turn into proper lua object
This makes the screen objects use our existing infrastructure for implementing
classes and objects with lua instead of hand-rolling an own version.

This results in some small API change: Screen objects no longer have an
add_signal() function and instead this function exists on the parent screen
class.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-30 16:37:19 +02:00
Uli Schlachter b9361d54c6 gears.color: Add a pattern cache
This makes gears.color() cache patterns in a weak table and returns that cached
pattern when we get called with the same argument again.

To benchmark this change, the following code was used:

local time = require("socket").gettime

function benchmark(func)
   local begin = time()
   local iter = 0
   while time() - begin < 1 do
      func()
      iter = iter + 1
   end
   return iter
end

for _, arg in pairs({
   "#00aa00",
   "solid:#00aa00",
   "radial:50,50,10:55,55,30:0,#ff0000:0.5,#00ff00:1,#0000ff",
   "linear:1,2:3,4:0,#000000:1,#ffffff",
   "png:/home/psychon/Wallpaper/Bars.png",
   { type = "solid", color = "#00aa00" },
   { type = "radial", from = { 50, 50, 10 }, to = { 55, 55, 30 }, stops = { { 0, "#ff0000" }, { 0.5, "#00ff00" }, { 1, "#0000ff" } } },
   { type = "linear", from = { 1, 2 }, to = { 3, 4 }, stops = { { 0, "#000000" }, { 1, "#ffffff" } } },
   { type = "png", file = "/home/psychon/Wallpaper/Bars.png" },
}) do
   collectgarbage("collect")
   print(benchmark(function() gears.color.create_pattern(arg) end), arg)
end

Before this change (larger numbers are better, this measures how many times we
can create the given pattern per second):

29525   #00aa00
29344   solid:#00aa00
3446    radial:50,50,10:55,55,30:0,#ff0000:0.5,#00ff00:1,#0000ff
4845    linear:1,2:3,4:0,#000000:1,#ffffff
32855   png:/home/psychon/Wallpaper/Bars.png
29883   table: 0x1bb67e0
3868    table: 0x1bb6830
5339    table: 0x1bb6c60
32772   table: 0x1bb6fe0

After this change:

126188  #00aa00
125962  solid:#00aa00
125125  radial:50,50,10:55,55,30:0,#ff0000:0.5,#00ff00:1,#0000ff
125213  linear:1,2:3,4:0,#000000:1,#ffffff
113659  png:/home/psychon/Wallpaper/Bars.png
125586  table: 0x1232680
125249  table: 0x12326d0
125468  table: 0x1232b00
113711  table: 0x1232e80

As you see, this makes some cases about 35 times faster (although I have to
admit that something like this can be expected from such a synthetic benchmark).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-29 22:52:04 +01:00
Uli Schlachter 79ad0d3e6e gears.surface: Cache files from disk
Instead of loading files from disk every time we need them, add a cache to
gears.surface as a weak table that maps strings to cairo surfaces.

If this cache should be avoided, there is a new gears.surface.load_uncached()
function which works just like gears.surface.load() worked before.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-29 22:01:01 +01:00
Uli Schlachter 2dc28b29e9 Merge remote-tracking branch 'blueyed/fix-restore-in-tag.delete' 2014-03-29 18:12:37 +01:00
Uli Schlachter 3cbdc2a79f Use awful.layout.layouts for implementing optional parameters
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-28 13:29:16 +01:00
Emmanuel Lepage Vallee bfc6065ad9 Make 'layouts' global 2014-03-28 13:24:04 +01:00
Daniel Hahler bc4a5f38c9 manage signal handler: use awesome.startup
The `manage` arg is gone.
2014-03-27 13:50:19 +01:00
Emmanuel Lepage Vallee 8bddba170b Fix tag screen switching
The bugs this fix are:

 * Invalid request using nil as screen
 * Stop messing indexes in the old screen
 * Prevent c.screen <-> t.screen mismatch
 * Prevent no tags being selected in the old screen
2014-03-26 23:14:09 +01:00
Uli Schlachter d91d36c69c awful.tag.withcurrent: Try harder at finding a tag (FS#1196)
When a screen doesn't have any tags selected, then just tag the new client with
all of the screen's tags. That way, we don't lose clients.

Also, if we failed at coming up with tags for a client, don't completely untag
it. This means that it can keep its old tags if it had any.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-26 14:29:02 +01:00
Uli Schlachter eed605bf7f Revert "awful.client.movetoscreen: Don't untag clients completely (FS#1196)"
This reverts commit bbe86e4e25. That commit caused
unintuitive, special behavior. Instead, when someone wants us to set a screen,
we really should do so.
2014-03-26 14:28:04 +01:00
Uli Schlachter a73bcd732a Merge remote-tracking branch 'blueyed/magnifier-fix-raising' 2014-03-24 22:22:11 +01:00
Uli Schlachter 6116c90210 Merge remote-tracking branch 'blueyed/client-set-screen-with-tags' 2014-03-24 22:18:27 +01:00
Uli Schlachter 981acad29d awful.tag: Don't tag clients before manage() (FS#1238)
This commit partly reverts commit b4c83d0e70.

Because the C code emits property::screen before manage, this caused
awful.tag.withcurrent() to run on a client before it really was being managed.
This then tagged the client. Because of this tag changes, awful.layout reacted
and ran the layout code. Because c.type wasn't set up at this point yet, the
client wasn't considered to be floating yet. This caused the client's geometry
to change and thus its floating geometry was messed up.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-24 22:05:21 +01:00
Daniel Hahler fc9284fc53 Drop focus:raise() in magnifier.arrange
This is a useful fix in general, but especially after commit 620732a
(Remove raise call from mouse.client.move).

Ref: https://github.com/awesomeWM/awesome/pull/9#issuecomment-37736135
2014-03-24 17:20:49 +01:00
Daniel Hahler 8194d555ec Set c.screen in ewmh.tag and before tags in rules.execute
The current premise is that c.screen should be the same as
awful.tag.getscreen(t).

The addition in `ewmh.tag` appears to be the important part here,
changing the order in awful.rules.execute is (maybe) only for
consistency across the codebase.
2014-03-24 17:01:52 +01:00
Uli Schlachter df49d180dd Revert "Set c.screen in ewmh.tag and before tags in rules.execute"
This reverts commit 3f9c439311.
2014-03-24 09:49:30 +01:00
Uli Schlachter ca434a7e3a Merge remote-tracking branch 'blueyed/expand-tilde-path-in-beautiful-init' 2014-03-24 09:23:04 +01:00
Uli Schlachter 92b86a56f7 Merge remote-tracking branch 'blueyed/client-set-screen-with-tags' 2014-03-24 09:21:13 +01:00
Daniel Hahler c11153c630 Fix the call to tag.history.restore from tag.delete
By default, tag.history.restore switches between the previous history
states, which is not what should get done when deleting a tag.

Without this, deleting multiple tags in a row, will jump back to the
first/fallback tag, instead of the older history entries.
2014-03-24 01:17:54 +01:00
Daniel Hahler 56c8e6fe16 Expand '~' in the path for beautiful.init
This expands the tilde in the path to beautiful.init and changes the
expansion in theme values to only match '^~/': tilde expansion is only
meant to be expanded at the beginning.

The latter is not really tested.
2014-03-24 01:10:45 +01:00
Daniel Hahler 3f9c439311 Set c.screen in ewmh.tag and before tags in rules.execute
The current premise is that c.screen should be the same as
awful.tag.getscreen(t).

The addition in `ewmh.tag` appears to be the important part here,
changing the order in awful.rules.execute is (maybe) only for
consistency across the codebase.
2014-03-24 00:18:35 +01:00
Uli Schlachter 1847b0ae1f gears.color.create_opaque_pattern: Fix for SurfacePatterns (FS#1236)
Sorry!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-23 21:51:29 +01:00
Uli Schlachter b4c83d0e70 Use signals on classes instead of instances where appropriate
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-23 19:48:07 +01:00
Uli Schlachter 23659817bc beautiful: Don't use non-existant API
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-23 19:29:53 +01:00
Uli Schlachter dd31b42ada beautiful: Don't use a PangoLayout for getting font height
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-23 18:57:48 +01:00
Uli Schlachter db00145406 wibox.layout.base.fit_widget: Enforce sane width and height
Previously, odd things could happen if a widget was getting fitted into a
negative width or, even worse, width being NaN (not a number)!

This can e.g. happen due to a margin layout which doesn't get enough space to
even draw the margin that it is supposed to add.

Fix this by enforcing a minimum value of 0 for the width and height that a
widget gets fitted into.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-23 17:48:26 +01:00
Uli Schlachter 0ac80ddf30 imagebox: Avoid division by zero
Given an imagebox i with i.resize_forbidden = false and a valid image set, the
call t:fit(0, 0) would return two times "not a number".

This is because the code first does some calculations to get the input image
into the available space and then tried to do some calculations needed for
scaling images up.

The first calculation already gave us h == 0 == w, the second calculation would
then calculate 0/0. This results in NaNs.

This was only noticed because NaN is not a valid table index in lua.

Fix this by returning 0,0 if we have an image of width or height 0 after the
first calculation. Since 0x0 images are valid in cairo, this also fixes the same
bug with such images.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-23 17:39:42 +01:00
Uli Schlachter 82efb1b69e awful.client: Add marked and unmarked signals (FS#1227)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-23 16:34:04 +01:00
Uli Schlachter ae996ee8d6 awful.rules: Emit request::activate on the client
There is a strong hint that you are doing something wrong: You call
client.emit_signal(some_signal, c). Chances are high that this signal is
supposed to be emitted on the client object 'c' instead of the underlying client
class.

This applies to awful.rules' usage of this signal.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-18 16:01:04 +01:00
Uli Schlachter 41bc77d64c Bump minimum lgi dependency to 0.7.0
Before commit 1b2826 in lgi, the get_rgba() function on cairo SolidPatterns was
specified like this:

    get_rgba = { ret = cairo.Status,
                 { ti.double, dir = 'out' },
                 { ti.double, dir = 'out' },
                 { ti.double, dir = 'out' } },

The above commit fixed this (without saying so) and the code became:

    get_rgba = { ret = cairo.Status,
                 { ti.double, dir = 'out' },
                 { ti.double, dir = 'out' },
                 { ti.double, dir = 'out' },
                 { ti.double, dir = 'out' } },

The prototype for the corresponding cairo function is:

cairo_public cairo_status_t
cairo_pattern_get_rgba (cairo_pattern_t *pattern,
                        double *red, double *green,
                        double *blue, double *alpha);

As you see, this functions gets four double* as arguments and it will save its
result via those pointers. Old versions of lgi call this function with too few
arguments and this will cause a segmentation fault when cairo dereferences an
invalid pointer.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-17 17:52:09 +01:00
Uli Schlachter 873358a0b8 EWMH: Handle _NET_WM_DESKTOP in lua
We now handle all "important" EWMH messages in lua and lua can decide to do
different things than the current obvious one.

Consistency!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-17 16:15:20 +01:00
Uli Schlachter bbe86e4e25 awful.client.movetoscreen: Don't untag clients completely (FS#1196)
If a client gets moved to a screen without any selected tags, that client
disappears and it is non-trivial to get it back. Since this is unexpected and
annoying, make movetoscreen do nothing if the target screen has no tags
selected.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-16 21:53:58 +01:00
Daniel Hahler edaca590f6 Only set client's urgent after startup
This looks at awesome.startup in the default 'request::activate' signal
handler.
2014-03-16 21:26:05 +01:00
Daniel Hahler 9a5a8dc6e8 Factor `awful.rules.apply_do` out of `apply`
This allows to apply properties and callbacks to a client like
awful.rules.apply would do, without the matching part.

This is useful with the new startup notifications, and lets you apply
the same properties and callbacks from e.g. a manage signal handler.
2014-03-16 20:20:14 +01:00
Uli Schlachter 1924ee9e6e drawin: Only redraw on move with translucent background
If a drawable has an opaque background, we don't need pseudo transparency and
thus its content don't change when it is moved. However, when we need pseudo
transparency, then we have to redraw the drawable to apply the new background.

Previously we just always did the redraw. This commit adds a helper function
gears.color.create_opaque_pattern() that analyzes a cairo pattern for
transparency. We use this new function to only redraw-on-move when there is
actual pseudo transparency in effect. Otherwise, this redraw can be skipped.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-16 14:58:14 +01:00
Uli Schlachter 40e28be700 awful.tooltip: Work with all gears.colors as foreground
This fixes awful.tooltip so that colors other than "#123456" can be used.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-16 13:25:01 +01:00
Emmanuel Lepage Vallee d6e06450d3 Add end to end support for spawning tracking using startup notifications
This allow to spawn something, then apply some properties or rules when
the client show up ("manage").

This commit add:
 * "startup_id" property for all clients object (immutable, can be nil)
 * Second return value to awful.util.spawn() with the startup_id
 * Update the documentation

Example:

  local wait_for_it = {}

  local pid,snid = awful.util.spawn("urxvtc")
  wait_for_it[snid] = {ontop=true,sticky=false,
     tag = awful.tag.gettags(mouse.screen)[1] }

  client.connect_signal("manage", function (c, startup)
     if c.startup_id and wait_for_it[c.startup_id] then
        for k,v in pairs(wait_for_it[c.startup_id]) do
           c[k] = v
        end
        if wait_for_it[c.startup_id].tag then
           c:tags({wait_for_it[c.startup_id].tag})
        end
     end
  end)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-15 23:14:02 +01:00
Daniel Hahler d9aed1b21e awful.rules: add does_match and matching_rules functions (FS#1224)
Signed-off-by: Daniel Hahler <git@thequod.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-15 09:00:20 +01:00
Daniel Hahler a15e53deec Minor doc fixes 2014-03-15 08:52:14 +01:00
Daniel Hahler 31e3399abe Fallback to comparing layout names in awful.layout.inc
This helps in cases where you have accidentally cloned an entry from
`layouts`.

Previously, no current index would be found and the function would
silently fail.

Signed-off-by: Daniel Hahler <git@thequod.de>
2014-03-14 20:37:24 +01:00
Daniel Hahler 11f7b5aa3d Add a "deep" option to awful.util.table.clone
This allows for having clones of a table, where its entries are still
references to the original values.

This is useful for copying a "default props" table, where you want to
keep the reference to entries like `awful.layout.suit.tile`.

Signed-off-by: Daniel Hahler <git@thequod.de>
2014-03-14 20:36:26 +01:00
sirkha b1c14d5660 Added Comments
Added some comments to explain the changed code and how it functions

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-13 12:11:20 +01:00
sirkha fbba41ddaa Added Expand Modes
Added set_expand function with options of "none" "outside" or "inside" modes.
The "inside" mode is the default and will result in the original behavior. The
main benefit is being able to actually center a widget in the available space
with options of how to draw the outside widgets (expand to take the space,
or not.) Further functionality can be had by ommiting one of the outside
widgets. Set default layout mode in the constructor.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-13 12:11:04 +01:00
sirkha 601dc232db Fixed Flex Layout Fit Behavior
Modified flex:fit so that it will not return more than its sub-widgets need.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-13 12:05:50 +01:00
sirkha ceaeaedb5b Fix Align Layout Fit Behavior
This changes the align layout fit function so that align:fit will not return
more space than is actually needed by its sub-widgets. Changes to align:draw
were also required so that any widget assigned to the middle slot will expand
to fill the remaining space.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-13 12:05:50 +01:00
Daniel Hahler c855b1babb Do not raise clients in client_manage
Instead, use stack_client_push and emit the `request::activate` signal
from awful.rules.apply, if the client gets focus.

Signed-off-by: Daniel Hahler <git@thequod.de>
2014-03-12 16:01:01 +01:00
Massimiliano Brocchini b965adc33f prompt: CTRL+DELETE deletes history entries
Pressing CTRL+DELETE removes the visible history entry, if any, then moves to the next history entry (like pressing DOWN would do).
If the last history entry is removed the previous one is shown in the prompt (like pressing UP would do).
CTRL+DELETE works on history entries only: i.e. it has no effect on a command entered but not executed yet.
To implement above behaviour I added saving history table to file on Escape key press.

Signed-off-by: Massimiliano Brocchini <massimiliano.brocchini@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-12 10:16:27 +01:00
Daniel Hahler c8cbada899 Emit tag::history::update signal from tag.history.restore
Restoring a previous history entry changes the tag history (in the
meaning of currently selected tags), and therefore should also emit the
tag::history::update signal.

A use case might be to automatically hide tags with no clients on them.

Signed-off-by: Daniel Hahler <git@thequod.de>
2014-03-12 01:49:10 +01:00
Campbell Barton 620732a015 Remove raise call from mouse.client.move
This makes move consistent with 'resize' which doesn't raise either.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-11 09:41:20 +01:00
Uli Schlachter 2ac95b4ae8 Fix handling of _NET_CURRENT_DESKTOP messages (FS#1219,FS#1217)
Instead of having the C code mess with which tags are selected, we now emit a
signal on the tag that says that something requested it to be selected. Lua can
then handle this by only switching tags on the correct monitor and by updating
the focus history correctly.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-08 15:33:34 +01:00
Uli Schlachter 62e2dee4ba Add awesome.register_xproperty (FS#1212)
This commits adds awesome.register_xproperty(). This allows lua code to register
arbitrary X11 properties with awesome which will then watch these properties.
Whenever such a property is changed on a client or drawin, we will emit the
xproperty::name signal.

This also adds window:get_xproperty(name) and window:set_xproperty(name, value)
which allows to mess with properties.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-07 16:17:40 +01:00
Uli Schlachter f19912900d awful.util.spawn*: Remove obsolete screen argument
Ever since commit 6b2e4352b (from 2010!), awesome.spawn() doesn't have a screen
argument anymore and the extra argument from util.spawn was just ignored. Fix
the code and the luadoc for these functions.

Thanks to blueyed for noticing this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-07 10:54:52 +01:00
Uli Schlachter 8cf48d1fe8 Revert "awful.ewmh: Enforce client geometry (FS#764,FS#1216)"
This reverts commit 20afb26080.

The commit caused endless loops with tracebacks like this (shortened):

        lib/awful/ewmh.lua.in:122: in function <lib/awful/ewmh.lua.in:117>
        [C]: in function 'geometry'
        lib/awful/ewmh.lua.in:122: in function <lib/awful/ewmh.lua.in:117>
        [C]: in function 'geometry'
        lib/awful/ewmh.lua.in:122: in function <lib/awful/ewmh.lua.in:117>
        [C]: in function 'geometry'
2014-03-06 22:08:00 +01:00
Uli Schlachter 20afb26080 awful.ewmh: Enforce client geometry (FS#764,FS#1216)
When a client's geometry changes (and I consider the border width to be part of
the geometry here) and that client is one of fullscreen or
maximized_{horizontally,vertically}, make sure that the geometry as specified by
the state is still obeyed.

This also (accidentally) fixes things when a client gets moved to another
screen!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-06 18:08:55 +01:00
Uli Schlachter 23e9258fb5 awful.ewmh: Correctly handle bw change for maximized clients
Due to a copy&paste error, maximized_vertical and maximized_horizontal were
handled the same. Of course, vertical and horizontal aren't the same direction.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-06 17:58:03 +01:00
Uli Schlachter 04dee81d13 client: Add request::activate signal (FS#848)
When we receive a _NET_ACTIVE_WINDOW request on the root window, we used to just
focus and raise the window. This didn't do much for clients which are on
non-selected tags.

Thus, this commit makes awesome emit request::activate on the client instead.
This is used in awful.ewmh to implement the old behavior again, but with
additionally marking the client as urgent if it isn't visible.

People who don't like this behavior can use client.disconnect_signal to disable
this behavior again. To make this really possible, awful.ewmh becomes a
"non-nil" module.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-06 17:47:55 +01:00
Uli Schlachter 91cc8519b5 wibox.drawable: Cache the wallpaper
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-02-23 12:19:26 +01:00
Björn Åström c6365fa2f6 drawable: Support for true transparency (FS#1210)
This makes the drawable paint the wallpaper in the background
(i.e. pseudo transparency) only if there is not a composite manager running,
as reported by the value of awesome.composite_manager_running.

In other words: drawables can now make use of true transparency.

Signed-off-by: Björn Åström <bjoast@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-02-23 12:16:00 +01:00
Uli Schlachter 019f55a1da naughty: fix ldoc
lib/naughty.lua:65: ?: 'class' cannot have multiple values; {table,table}

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-02-22 16:35:17 +01:00
Massimiliano Brocchini b8c172a2dc prompt: search in prompt history using exact string match
The default value for the second argument to :find() is 1, so nothing is changed
here. The third arguments disables pattern matching and instead gets us literal
interpretation of strings. This means that pattern characters like e.g. [, ] and
. don't get interpreted.

Signed-off-by: Massimiliano Brocchini <massimiliano.brocchini@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-02-22 16:32:34 +01:00
Massimiliano Brocchini 77a2b27426 prompt: fix search term ctrl+up/ctrl+down when starting from existing entries
Signed-off-by: Massimiliano Brocchini <massimiliano.brocchini@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-02-22 16:32:34 +01:00
Fabienne Ducroquet 94a8c72596 layouts: spiral: Avoid gaps between windows
When an area is split in two, for example horizontally, one of the windows
should have height math.floor(previous height / 2) and the other
math.ceil(previous height / 2), to be certain that no gaps are left between the
windows.

For instance, if the first window has height h and the second window has height
math.floor(h / 2), the height of the third window should be math.ceil(h / 2)
instead of the same as for the second window.

So to compute the size of window n + 1 it’s necessary to remember the size of
window n - 1 as well as that of window n.

Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-01-23 18:39:52 +01:00
Rocco Aliberti 7adc21e2ca wibox.layout.margin: Add margins color parameter
This adds a :set_color() method so that the margin layout can color the margins,
drawing a bordered widget.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-01-20 17:28:04 +01:00
Rocco Aliberti 64dc578efc awful.menu.clients: Remove useless line (FS#1200)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-01-20 16:30:24 +01:00
Uli Schlachter 479f7b990c awful.menu.clients: Fix API (FS#1200)
This gets rid of the unused first argument and adds a new second argument that
can influence individual items.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-01-11 21:23:23 +01:00
Uli Schlachter 5cd8c7e540 awful.tag.viewmore: Make screen optional (FS#1203)
The documentation says that screen, the last argument to viewmore(), is an
optional argument. However, the implementation only treated it as an optional
argument in one place.

Fix this by always setting the screen variable itself to a screen.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-12-30 11:33:09 +01:00
Uli Schlachter aa51379be0 menubar: Fix API docs
ldoc wants documentation comments to start with "---", not just "--".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-12-30 00:17:07 +01:00
Uli Schlachter 2936f63d67 awful.menu: Add missing "local" declaration
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-12-26 16:13:01 +01:00
Enrico Scholz 77e92e17a1 menu: do not double escape name in 'menu:clients()' (FS#1202)
Label of menu entries will be escaped automatically.  Doing it manually
in menu:clients() will escape it it twice.

Patch removes the util.escape() call in menu:clients()

Signed-off-by: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-12-26 16:12:31 +01:00
Jan Larres 9723f23f26 taglist: Add [bg|fg]_empty
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-12-02 15:10:10 +01:00
Uli Schlachter d4b12bb1b2 awful.tag.delete: Deactivate tags
The activated property was added to tag objects between awesome 3.4 and 3.5.
This is used in the C code to keep tags alive even when nothing else refers to
it and includes a tag e.g. in some root window properties.

Thus, to get rid of a tag and to make the C code drop its reference to it, we
have to set activated to false in this function.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-11-23 14:54:13 +01:00
Uli Schlachter 15f0881966 tasklist: Add default colors for broken themes
In case loading the theme failed and we don't have fg_normal or bg_normal, add
default values for these properties. All the other colors are only used if they
are defined, but these two always need to be defined.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-11-18 15:19:54 +01:00
heithe 80aa6b1922 Add awful.titlebar.widget.minimizebutton
Signed-off-by: heithe <heithe01@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-11-03 09:47:11 +01:00
Uli Schlachter 4abf42b92f awful.tag.withcurrent: Also act on restarts (FS#1155)
When awesome restarts because a new screen was added or removed, clients can end
up being on a different screen than before the restart. However, the tags will
be carried across the restart. This means that a client could end up being
tagged with a tag from another screen. This results in weird behavior of tag
switches and confuses users.

To work around this, remove the client from any tags that are on a different
screen during startup. If the client ends up without any tags, it will then be
tagged with the currently selected tags.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-10-08 10:45:22 +02:00
Uli Schlachter f3573dbb19 awful.client.tiled: Ignore fullscreen (etc) clients (FS#1106)
I am looking forward to the bug reports requesting awful.client.floating.set(c,
true) to also automatically un-fullscreen the client...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-10-04 12:04:16 +02:00
Uli Schlachter a6466864f9 awful.screen.focus: Don't move mouse to (0, 0) first (FS#1173)
Setting mouse.screen moves the pointer to the top left corner of that screen.
However, the very next line would then move the pointer elsewhere again. Thus,
the first one wasn't needed at all.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-10-04 11:27:35 +02:00
Uli Schlachter 4368629836 naughty: Verify image parameters coming from dbus (FS#1162)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-10-04 11:21:47 +02:00
Björn Åström 8792d6a4ba wibox.layout.fixed: Fix fill space
The last widget always took up the remaining
space even though fill_space(false)
had been called on the layout.

This got broken in commit 9d333113dd.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-10-03 15:44:45 +02:00
Uli Schlachter d82342e386 awful.titlebar: Add show, hide, toggle functions
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-19 14:37:07 +02:00
Uli Schlachter 3edd216560 wibox: Add widget geometry cache
This commit adds and uses wibox.layout.base.fit_widget(). This function is a
wrapper for widget:fit() that caches the result and thus speeds things up.

This is necessary because some layouts call :fit() from their :fit() and :draw()
functions. Nesting such layouts means that at the widget at the tail of the
stack gets its :fit() function called quite often. If this function is not
blazingly fast, this results in noticeable slowness.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-08-21 12:26:47 +02:00
Uli Schlachter 14daf85fe9 awful.tooltip: Set the bg color correctly (FS#1148)
Well, whoops. There is no .bg property on wiboxes for quite a while already, it
is now a :set_bg member function.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-05-13 19:27:19 +02:00
Ross Lagerwall fc49e28025 naughty: Don't interpret markup in titles
Since only the body text of a notification may contain markup,
by combining the two together and calling set_markup(), the
title would also get interpreted as if it had markup.
This could be seen with:
$ notify-send "Title & text" "<i>body text</i>"

The unescaped & would get interpreted as broken markup and so
naughty would fall back to escaping everything which would make
the "<i>" tags be shown rather than interpreted.

So, the title must always be escaped so that it is not interpreted
as markup.

Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-26 10:17:51 +01:00
Uli Schlachter 8af54130d6 Fix wibox.layout.flex:fit() (FS#1126)
The flex:fit() function was calling the fit() function of the widgets it
contained with too large values, trying to hand out more space than it had
available. This resulted in more space being requested than was available and
some weird layout issues resulted.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-24 22:32:53 +01:00
Emmanuel Lepage Vallee d5a3669e96 Add support for "geometry" argument for mouse events and awful.button 2013-03-23 21:24:52 +01:00
Jo De Boeck e0a163cba0 Fix calculation of distance between clients
This fixes move by direction

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-21 15:11:35 +01:00
Emmanuel Lepage Vallee a484ef076d Allow to disable taglist icons.
This is used if the user want to use a custom drawing method.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-17 23:43:29 +01:00
Emmanuel Lepage Vallee 67710d0008 Add ability to set background images for empty tag
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-17 23:43:29 +01:00
Emmanuel Lepage Vallee e920c74fd9 Add ability to disable tasklist icons and restore ability to set bg_images
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-17 23:43:29 +01:00
Emmanuel Lepage Vallee 1c76560da7 Add external function for {tag,task,tab}list background image
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-17 23:43:28 +01:00
Uli Schlachter 7a47355c99 awful.mouse: Follow C API changes
Whoops. This was broken ages ago. Thanks to Elv13 for making me notice.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-17 22:52:39 +01:00
Poggles ed763b9ad3 Speed up the RGBA->BGRA conversion (FS#1112)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-17 17:23:04 +01:00
Uli Schlachter 2b0398c59b awful.tag: Use sane tag index values (FS#1125)
Since commit d8a93dafa3, tags have an "index" property which decides about
the order in which they are displayed in the taglist. If a tag doesn't have this
property set, the next call to awful.tag.gettags() will fix this and "invent" an
index for this new tag.

However, if multiple tags didn't have an "index" property, gettags() would
assign all of them the same index. The following call to table.sort() would then
do random magic to these tags (remember: table.sort() is not a stable sorting
algorithm, so it is allowed to randomly swap around entries which have the same
sorting key).

Fix this by making sure that the new "index" properties are different from each
other.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-16 16:51:55 +01:00
cdump d8a93dafa3 awful.tag: add index property for custom tag order
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-12 15:14:38 +01:00
Uli Schlachter 4540b8927a awful.util.spawn_with_shell: Use table as argument
Thanks to the previous commit, spawn_with_shell() can now easily fix lots of
problems that we previously had with escaping the argument to the shell.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-10 15:00:05 +01:00
Uli Schlachter 4c3bac07ec wibox: Improve constructor functions for some layouts
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-10 13:46:28 +01:00
Uli Schlachter 23b30be106 Move size hints handling back into C (FS#1117)
Having this in lua means that size hints are only applied after the client got
resized. The bad side effect of this is some flickering if awesome is being
slow. And apparently, it is slow for way too many people...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-10 12:13:32 +01:00
Lukáš Hrázký 5365dfdb79 wibox.layout.constraint: fix the min and max strategies
Fixes mixed up min/max strategies and other bugs in min and max. Also
removes enforcing the size in draw, adhering more to awesome's layout
concept.

Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-10 11:24:53 +01:00
Poggles 2876718210 Make awful.util.cycle() less while'y
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-10 11:19:37 +01:00
Uli Schlachter 2e38c08569 wibox.wibox.systray: Allow multiple systrays
This has to be removed because it breaks the fallback to the default config if
the first config already managed to create a systray widget. This doesn't mean
that it is suddenly possible to have the systray visible in more than one place,
it just means that awesome will no longer complain about this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-10 11:11:43 +01:00
Uli Schlachter b36b56058f naughty: Handle broken icon arguments better (FS#1076)
Before this, surface.load() would throw a lua error because it couldn't load the
icon which broke naughty's state.

With this commit, this error is caught and an error message is printed on stderr
instead.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-10 10:57:49 +01:00
Uli Schlachter 873d41bb5b wibox.drawable: Redraw when moved
Let's consider the following notification:

  naughty.notify({ text = "foo", bg = "#88888888", timeout=1 })
  naughty.notify({ text = "foo", bg = "#88888888", timeout=2 })

When the first notification disappears, the second one is moved and takes its
place. However, its content was not redrawn. This makes the pseudo-transparency
break and the wallpaper that is shown in the back of the notification doesn't
match the real wallpaper.

Fix this by redrawing drawables when they get moved.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-26 11:21:48 +01:00
Uli Schlachter 2de450dff9 wibox.drawable: Don't redraw drawables without surfaces (FS#1079)
Thanks to the previous commit, a drawable can no longer have a finished cairo
surface. Instead, it will now have a nil surface. This commit handles this new
possibility.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-20 14:19:31 +01:00
Lukáš Hrázký 470142acc3 wibox.widget.textbox: return 0, 0 from fit() if either w or h is 0
A hack around abusing the fact that width of a textbox is 0 when its
empty, while it's height is still set according to the font.

Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-20 13:08:27 +01:00
Lukáš Hrázký 1881ceb9d3 wibox.layout.flex: add set_max_widget_size() function
The function can be used to set the maximum size the widget in the
flex layout should take.

Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-20 13:08:27 +01:00
Poggles bd05219a72 Make awful.layout.inc() accept a screen number
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-19 19:49:07 +01:00
Uli Schlachter f859131bf3 wibox.widget.systray: Properly work when rotated (FS#1115)
The systray widget's fit() function worked in the (rotated) user coordinate
space while the draw() function used device coordinates (unrotated). This meant
that width and height were swapped up in the calculations and the systray ended
up being way too small.

Fix this by making the draw() function use user coordinates, too. This means
that it needs some new magic to detect a rotated coordinate space. This, in
turn, means that the systray is now automatically rotated when you put it into a
rotate layout.

This might cause some minor breakage because people no longer need to call
:set_horizontal() on the widgets.

Thanks a lot to Alexander Gehrke for his help!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-16 22:14:08 +01:00
Uli Schlachter f86a9c896c gears.wallpaper: Create smaller image surface (FS#1087)
When no wallpaper exists yet, instead of creating a black image surface which
covers all the screens, just create a surface for the screen which we need. This
means that way less pixels have to be uploaded to the X11 server, which should
be faster.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-12 15:15:16 +01:00
Felix Bier e4be0017ff Incorrect calculation of unused size (FS#1108)
Signed-off-by: Felix Bier <flx.bier@googlemail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-11 16:10:48 +01:00
Uli Schlachter fca2f3e58d gears.color: Accept cairo patterns as arguments
This allows to use cairo patterns directly for any kind of "color". This makes
it easier to use things which aren't possible through gears.color.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-11 14:26:05 +01:00
Thomas Jost cd5180f60f gears.wallpaper: Add wallpaper.fit
Signed-off-by: Thomas Jost <schnouki@schnouki.net>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-10 17:38:19 +01:00
Alexander Yakushev b0a056f50a menubar: Treat KP_Enter as pressing Enter (FS#1072)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-10 17:01:41 +01:00
Ignas Anikevicius (gns_ank) 9631ada0d2 Menubar utils fix the wm_name matching once more.
The previous attempt at making the utils.wm_name variable useful for
accessing some entries was silly. This is because a typical ShowOnlyIn
string would look as: 'Unity;Gnome;KDE;' and the matching currently is
done for the whole string, where as we need to match only a part of it.

This small (hackish) commit fixes that, or do we wanna parse this line
of a .desktop file properly?

Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-10 16:45:05 +01:00
Uli Schlachter 6608b0aa1c wibox.layout.align: Give middle widget full height
I amended some change to commit 8560de597c which made the align layout's
middle widget really centered instead of being way too wide. However, this also
shrunk the widget on the "other" axis, too. This commit fixes that up.

A big "sorry" to Lukáš for breaking his patch.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-08 22:06:25 +01:00
uzsolt 23fe017bd4 fix locale problem (decimal separator isn't dot but comma)
If user changes locale with os.setlocale to a "dirty"
locale (which use comma as decimal separator (not dot), e.g.
hu_HU) `tonumber` will produce "0,6" instead of "0.6"
which causes bad comparision.

Signed-off-by: uzsolt <udvzsolt@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-06 12:08:02 +01:00
Lukáš Hrázký 02ea5f9b23 awful.widget.common: remove unsed function
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-05 23:05:30 +01:00
Lukáš Hrázký dd29a41c4e tasklist: add a theme option for a plain task name
If theme.tasklist_plain_task_name is set to true, the various client
state marks will not be prepended to the task name.

Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-05 23:05:30 +01:00
Lukáš Hrázký 66e52229f7 wibox.layout: add a new constraint layout
This layout can be used to constraint the size of the widget it holds.
Depending on the strategy passed to it, the widget will have a minimum,
maximum or exact size that was set through this layout.

Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-05 23:05:30 +01:00
Lukáš Hrázký 4463f89b15 {tag,task}list: add update_function and base_widget constructor arguments
The arguments are optional, making it possible to use a custom function
to create the {tag,task}list layout. The base_widget arguments can be
used to override the base layout of the {tag,task}list widget.

Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-05 23:05:30 +01:00
Lukáš Hrázký 8560de597c wibox.layout.align: make the middle widget really centered
Centers the middle widget in the align layout in the remaining space
left by the widgets on the sides.

Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-05 23:05:30 +01:00
Lukáš Hrázký e38651bafb wibox.layout.align: don't take up all space in the other axis
This adds a fit function to the align layout that makes sure that
the layout will not take up all the available space in the other
axis than it's direction. Eg. for horizontal align layout, it will
only take up the maximum of its widgets' heights in the vertical axis.

Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-05 21:05:45 +01:00
Lukáš Hrázký f6d9443c5d wibox.layout.flex: fix the fit function
The fit function of the flex layout is different from the fixed.fit one.

Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-05 21:04:48 +01:00
Lukáš Hrázký 9d333113dd wibox.layout: remove unnecessary wrapping of draw and fit functions
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-05 20:59:42 +01:00
Uli Schlachter 987c2b9b30 awful.screen.getbycoord(): Always return a valid screen
No callers expect a nil result from this function. In fact, this broke
awful.tooltip because it tried to get the workarea of screen nil.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-05 20:56:20 +01:00
Uli Schlachter 1fa23fef81 awful.tooltip: Don't place tooltips when text changes
The tooltip is now only placed when it is made visible, not while it is
invisible.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-05 20:54:38 +01:00
Uli Schlachter 3a25e78224 wibox.layout.rotate: Add some good constructor arguments
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-05 20:52:00 +01:00
Uli Schlachter ae69b2db03 wibox.layout.base: Use math.min/max
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-05 20:50:17 +01:00
Uli Schlachter 7d1a963352 awful.placement.no_offscreen: Fix border handling (FS#1065)
The (x,y) position of a client is outside of the border, but the width/height
does not include the border (so the real width is width+2*border).

This means that we have to also subtract 2*border to make sure that the client
including its border really is inside of the expected area.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-16 18:11:57 +01:00
Uli Schlachter fdfb7c5bb5 naughty: Fix docs a little
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-16 11:40:06 +01:00
Daniel 29b56fd051 Expose naughty.notifications again
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-16 11:36:39 +01:00
Uli Schlachter 823cd10be7 awful.widget.button: Fix name clash (FS#1064)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-15 10:08:23 +01:00
Uli Schlachter 487fb3f945 mouse.resize: Allow resize across screens (FS#1059)
No clue why this code is here, but it only allowed floating clients to be
resized beyond the edge of their screen. Clients on a floating layout were
forced to stay on their screen. Quite an unintuitive behavior and now this
behavior is gone.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-14 19:38:30 +01:00