Commit Graph

21 Commits

Author SHA1 Message Date
Uli Schlachter d9c918c14a wibox.drawable: Stop caching the wallpaper
The C code now does this for us.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-03-27 11:45:14 +02:00
Uli Schlachter 95e5bdf5d2 Use the new way to iterate over screens in Lua
This gets us one step closer to removing screen indices.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-03-06 14:05:28 +01:00
Uli Schlachter 65b403c34a wibox: Support screen objects
This commit documents that a textbox already accepts a screen object where a
screen index is expected. Also, this changes the widget API in that a widget's
context.screen is now a screen object instead of a screen index.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-26 18:42:57 +01:00
Uli Schlachter 15e72fb037 Fix luacheck warnings in lib/wibox
Warnings pointing out actual problems are left.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-12 09:15:55 +01:00
Daniel Hahler 58954f7f08 Merge pull request #675 from psychon/remove-gears.sort
Remove gears.sort
2016-02-11 21:51:44 +01:00
Emmanuel Lepage Vallee 7666976538 drawable: Add background image support
Copy what's done in `widget.background`
2016-02-10 00:15:09 -05:00
Uli Schlachter 94e9a030c1 Remove gears.sort
It's unused since commit 0aa4304bda. Before this was a stable sorting
algorithm since table.sort is allowed to be unstable. Apparently we don't need a
stable sorting algorithm anymore.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-07 12:24:35 +01:00
Uli Schlachter de6d9334d8 wibox.drawable: Handle gears.surface's new error handling
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-17 17:39:32 +01:00
Uli Schlachter f7bbcf1263 wibox.drawable: Make screen_getbycoord() local
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-15 19:36:15 +01: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
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
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
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 56c22cde77 Merge branch 'widget_context' 2015-08-23 15:33:43 +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
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
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
Daniel Hahler 430e8664be wibox.drawable: add __tostring meta method 2015-08-01 11:21:50 +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
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