[awesome bugs] #1296 - Updated signal causes total relayout (Attachment added)

2014-10-05 Thread awesome
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#1296 - Updated signal causes total relayout
User who did this - Uli Schlachter (psychon)

--
Another new version. This now introduces a layout cache similar to the fit 
cache.
This removes the wibox argument for :fit() and :layout() since the result of 
these functions is cached and thus must not depend on the wibox.
This also changes the API for :layout() so that it is no longer recursive. 
Instead, :layout() returns a table that describes all child widgets together 
with their positions and transformations. This table is cached. This change 
should also make it much easier to test things.

You guys don't have to look through all the code in there, but it would be nice 
if you looked at the fixed and the img widgets in there (lines 269 to 359) 
and tell me if the API they use looks sensible. The other 250 lines in there 
just implement this API.

Oh and another new change: The result from :fit() goes through math.ceil(). 
This should make it harder for introduce non-integer positions for widgets, 
although this is still easily possible...
--

One or more files have been attached.

More information can be found at the following URL:
https://awesome.naquadah.org/bugs/index.php?do=detailstask_id=1296#comment4157

You are receiving this message because you have requested it from the Flyspray 
bugtracking system.  If you did not expect this message or don't want to 
receive mails in future, you can change your notification settings at the URL 
shown above.

--
To unsubscribe, send mail to awesome-devel-unsubscr...@naquadah.org.


[awesome bugs] #1296 - Updated signal causes total relayout

2014-10-05 Thread awesome
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#1296 - Updated signal causes total relayout
User who did this - Uli Schlachter (psychon)

--
Sorry for spamming.

I tested a 45 degree rotation and quite some code broke. Here is the code for 
the rotation:

local custom = base.make_widget()
function custom:fit(width, height) return width, height end
function custom:draw() end
custom.before_draw_children = custom.draw
custom.after_draw_children = custom.draw
function custom:layout()
local m = cairo.Matrix.create_translate(30, 30)
m:rotate(math.pi / 4)
m:translate(0, -30)
return {
base.place_widget(f, m, 30, 10),
}
end

And here are the needed fixes:

function wibox:damage_area(x, y, width, height)
local rect = cairo.RectangleInt({
x = math.floor(x),
y = math.floor(y),
width = math.ceil(width),
height = math.ceil(height)
})
self._dirty_area:union_rectangle(rect)
end

function wibox:_widget_needs_redraw(widget_state)
-- We have to transform this widget's geometry into global coordinates
local m = cairo.Matrix.create_identity()
local state = widget_state
while state ~= nil do
m:multiply(m, state.matrix)
state = state.parent
end

-- XXX: How can this be done nicer?
local x1, y1 = m:transform_point(0, 0)
local x2, y2 = m:transform_point(0, widget_state.height)
local x3, y3 = m:transform_point(widget_state.width, widget_state.height)
local x4, y4 = m:transform_point(widget_state.width, 0)
local x = math.min(x1, x2, x3, x4)
local y = math.min(y1, y2, y3, y4)
local width = math.max(x1, x2, x3, x4) - x
local height = math.max(y1, y2, y3, y4) - y

self:damage_area(x, y, width, height)
end
--

More information can be found at the following URL:
https://awesome.naquadah.org/bugs/index.php?do=detailstask_id=1296#comment4158

You are receiving this message because you have requested it from the Flyspray 
bugtracking system.  If you did not expect this message or don't want to 
receive mails in future, you can change your notification settings at the URL 
shown above.

--
To unsubscribe, send mail to awesome-devel-unsubscr...@naquadah.org.


[awesome bugs] #1296 - Updated signal causes total relayout (Attachment added)

2014-10-05 Thread awesome
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#1296 - Updated signal causes total relayout
User who did this - Uli Schlachter (psychon)

--
Seems like I can't get this out of my head...

All of a widget's callbacks are now optional. Missing draw methods are just 
skipped. A missing :layout() is the same as returning {} aka no children. 
When :fit() is missing, :layout() is used and the area covered by child widgets 
is used for the return value.
(Oh and base.fit_widget() now also forces widgets to return a value between 0 
and the given width/height)
--

One or more files have been attached.

More information can be found at the following URL:
https://awesome.naquadah.org/bugs/index.php?do=detailstask_id=1296#comment4159

You are receiving this message because you have requested it from the Flyspray 
bugtracking system.  If you did not expect this message or don't want to 
receive mails in future, you can change your notification settings at the URL 
shown above.

--
To unsubscribe, send mail to awesome-devel-unsubscr...@naquadah.org.


[awesome bugs] #1296 - Updated signal causes total relayout (Attachment added)

2014-10-05 Thread awesome
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#1296 - Updated signal causes total relayout
User who did this - Uli Schlachter (psychon)

--
Yet another new version of this proof of concept. Now, after re-layouting 
things, only the part of the wibox which really changed are redrawn. I bet this 
breaks Elv13's let's ignore the widget's bound and unset the clip-magic.
I also fixed things so that the wibox code automatically emits 
widget::layout_changed on parent widgets when it is emitted on a child. (There 
is still potential for optimizations: If a widget is visible in n places, these 
signals will be emitted n times. This gets us exponential behavior for deep 
widget hierarchies. However, I do not care enough to do anything about this and 
this should still behave way better than what we had before.)

Oh and since I didn't mention it yet:
This code creates a cairo surface, places some widgets on it, forces a redraw 
of one of these widgets, then forces a relayout for one of the widgets and 
finally saves the resulting cairo surface to out.png. During this, it prints 
a message each time it calls a widget's callback to show that just the minimum 
amount of callbacks are generated.
--

One or more files have been attached.

More information can be found at the following URL:
https://awesome.naquadah.org/bugs/index.php?do=detailstask_id=1296#comment4160

You are receiving this message because you have requested it from the Flyspray 
bugtracking system.  If you did not expect this message or don't want to 
receive mails in future, you can change your notification settings at the URL 
shown above.

--
To unsubscribe, send mail to awesome-devel-unsubscr...@naquadah.org.