[awesome bugs] #1269 - wrong method call in layout.margin.fit

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

The following task is now closed:

FS#1269 - wrong method call in layout.margin.fit
User who did this - Uli Schlachter (psychon)

Reason for closing: Not a bug
Additional comments about closing: Due to "some magic", the textbox returns the 
size that it wants to have when called with a size of -1, -1. However, this 
doesn't work with any other widgets and thus isn't really a good idea. And of 
course this is not supposed to work at all.

The reason for this is that most widget's size (and even so for textboxes), the 
width and height depend on the available space and aspect ratio. And I don't 
really see a way around that, sorry.

(E.g. an imagebox with resizing enabled used to return a negative size. I am 
not totally sure, but I think due to some other changes it would now always 
return 0,0)

More information can be found at the following URL:
https://awesome.naquadah.org/bugs/index.php?do=details&task_id=1269

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] #1269 - wrong method call in layout.margin.fit

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

The following task has a new comment added:

FS#1269 - wrong method call in layout.margin.fit
User who did this - Julius (che)

--
The doubled post popped up when I tried to refresh the page. Sorry for that. (I 
see no possibility to delete it)

I think I found the cause: textbox:fit() returns different values for 0, 0 and 
-1, -1.

But base.fit_widget() never calls widget:fit() with negative values. (as it 
'clears' the input with local width = math.max(0, width) )

So when I call margin:fit(-1, -1) on a textbox it _does_ make a difference in 
the output of margin:fit(-1, -1). (With caching, again, the iput values get 
cleared to at least 0, 0)

I am not sure how :fit() should behave. Nevertheless when I want to get the 
overall size of an arbitrary widget (also those that are nested several times) 
I recusively use :fit(-1, -1) on those. It mostly works fine and behaves as 
expected. Except for this example when I use textboxes in layout.margins. It 
then underestimates the width of the textboxes/layout.margins. Changing the 
code as described above, fixes that for me.
--

More information can be found at the following URL:
https://awesome.naquadah.org/bugs/index.php?do=details&task_id=1269#comment4074

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] #1269 - wrong method call in layout.margin.fit

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

The following task has a new comment added:

FS#1269 - wrong method call in layout.margin.fit
User who did this - Julius (che)

--
As I only call :set_markup() and :set_align() (which themsefels emit 
widget::updated) on my textboxes, this signal should be emitted correctly.

And I can see (in the source - during runtime I haven't had a look) that the 
cache is cleaned when widget::updated is called. (As layout.margin is created 
with base.make_widget() (from wibox/widget/base.lua) which connects the signal 
to the ret._fit_geometry_cache = setmetatable({}, { __mode = 'v' }) - which I 
assume to clear the chache)

But still the output from base.fit_widget(...) inside the margin:fit() and 
widget:fit() from outside differ.

So I wonder why this is. I'm going to have a deeper look but if somone sees 
what I'm not able to see, that would be nice...
--

More information can be found at the following URL:
https://awesome.naquadah.org/bugs/index.php?do=details&task_id=1269#comment4073

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] #1269 - wrong method call in layout.margin.fit

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

The following task has a new comment added:

FS#1269 - wrong method call in layout.margin.fit
User who did this - Julius (che)

--
As I only call :set_markup() and :set_align() (which themsefels emit 
widget::updated) on my textboxes, this signal should be emitted correctly.

And I can see (in the source - during runtime I haven't had a look) that the 
cache is cleaned when widget::updated is called. (As layout.margin is created 
with base.make_widget() (from wibox/widget/base.lua) which connects the signal 
to the ret._fit_geometry_cache = setmetatable({}, { __mode = 'v' }) - which I 
assume to clear the chache)

But still the output from base.fit_widget(...) inside the margin:fit() and 
widget:fit() from outside differ.

So I wonder why this is. I'm going to have a deeper look but if somone sees 
what I'm not able to see, that would be nice...
--

More information can be found at the following URL:
https://awesome.naquadah.org/bugs/index.php?do=details&task_id=1269#comment4072

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] #1269 - wrong method call in layout.margin.fit

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

The following task has a new comment added:

FS#1269 - wrong method call in layout.margin.fit
User who did this - Julius (che)

--
I'm sorry, too...

I looked at the lib/wibox/widget/textbox.lua and you are right, textbox:fit() 
does neither override, nor utilize base.fit_widget().

And ah, I oversaw base.fit_widget() is calling widget:fit(). Thanks.

But this probably means (as you imply) the widget (in my case textbox) wouldn't 
emit widget::updated often enough. Is it in my responsibility to emit that 
signal when I'm creating somthing that uses those widgets and layouts?
Otherwise I would try to find a fix for the textbox.

Thanks for your helpful comment!
--

More information can be found at the following URL:
https://awesome.naquadah.org/bugs/index.php?do=details&task_id=1269#comment4071

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] #1269 - wrong method call in layout.margin.fit

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

The following task has a new comment added:

FS#1269 - wrong method call in layout.margin.fit
User who did this - Uli Schlachter (psychon)

--
Uhm, that description makes no sense, sorry.

base.fit_widget() is wibox.layout.base.fit_widget() and that function is the 
way to call a widget's fit() function. It enforces some sane arguments and it 
handles the cache that is used for caching fit() results.
If something gets more correct by bypassing the cache here, then the cache 
likely contains stale values which would mean your widget didn't emit 
widget::updated often enough (emitting that signal clears the cache).

Also the textbox doesn't overwrite fit() anywhere, does it...?
--

More information can be found at the following URL:
https://awesome.naquadah.org/bugs/index.php?do=details&task_id=1269#comment4070

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] #1269 - wrong method call in layout.margin.fit

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

A new Flyspray task has been opened.  Details are below. 

User who did this - Julius (che) 

Attached to Project - awesome
Summary - wrong method call in layout.margin.fit
Task Type - Bug Report
Category - wibox
Status - Unconfirmed
Assigned To - 
Operating System - All
Severity - Low
Priority - Normal
Reported Version - 3.5.5
Due in Version - Undecided
Due Date - Undecided
Details - I think the .fit method of layout.margin 
(lib/wibox/layout/margin.lua) makes a wrong function call to the .fit method of 
the contained widget in line 49.

This fix worked for me:
replace
w, h = base.fit_widget(self.widget, width - extra_w, height - extra_h)
with
w, h = self.widget:fit(width - extra_w, height - extra_h)

I was playing a little bit when I noticed a deviatoion from the expected result 
from margin:fit to the actual result.
Looking a little bit deeper I recognised that the values the .fit method gave 
back for the widget from a) inside the margin.fit differed from those from b) 
outside.
(That sentence was too complicatet, wasn't it? - What I wanted to say: 
base.fit_widget(widget, ...) (from inside the margin.fit) =~ widget:fit(...) 
from the 'outside'.
Where the result from widget:fit(...) seems a lot more correct to me.
I think the reason is that during its creation some (at least the textbox) 
widgets overwrite (sometimes probably with good cause) the .fit method. Using 
the older variant, the base .fit function gets called. That might not match the 
actual space needed.

More information can be found at the following URL:
https://awesome.naquadah.org/bugs/index.php?do=details&task_id=1269

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.