Re: Multiple wibox on same 'position'

2009-09-18 Thread Julien Danjou
At 1253219120 time_t, No No wrote:
 I feel a little stupid as layouts work indeed fine and seem more flexible.
 Still, space must be divided into two equally large parts but that's really
 a minor concern...

This is because of lack of real vertical layout support for now. AFAIK
Gregor is working on that.

-- 
Julien Danjou
// ᐰ jul...@danjou.info   http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
// I'm no superman.


signature.asc
Description: Digital signature


Re: Multiple wibox on same 'position'

2009-09-17 Thread No No
I feel a little stupid as layouts work indeed fine and seem more flexible.
Still, space must be divided into two equally large parts but that's really
a minor concern...

Cheers

On Wed, Sep 16, 2009 at 11:34 AM, Julien Danjou jul...@danjou.info wrote:

 At 1253042531 time_t, No No wrote:
  Thus, I'm here asking for opinions on this patch's usefulness and
  implementation.

 Usefulness is questionnable since you can do the same kind of stuff with
 widget layout.

 It has been removed because it is damn simpler to handle only one wibox
 at edge, and conform better with this crappy EWMH specs.

 Cheers,
 --
 Julien Danjou
 // ᐰ jul...@danjou.info   http://julien.danjou.info
 // 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
 // There is nothing under this line.

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (GNU/Linux)

 iEYEARECAAYFAkqwsTYACgkQpGK1HsL+5c2zJgCghPlH2jFEasrnOOjoiWKpP4ol
 0mEAnj9D6LWxIKC3LsxiXAtHrQoD4omk
 =33Kw
 -END PGP SIGNATURE-




Re: Multiple wibox on same 'position'

2009-09-16 Thread koniu
On Wed, Sep 16, 2009 at 10:34, Julien Danjou jul...@danjou.info wrote:
 Usefulness is questionnable since you can do the same kind of stuff with
 widget layout.

I have some arguments for usefulness - here's one as discussed with farhaven:

15:44  koniu why don't u fix stacking wiboxes at the same position
while ur at it
15:44  farhaven because that's what we have widget layouts for :P
15:45  koniu and there can be only one way of doing things and it's
farhaven's way =]
15:45  koniu (aka widget layouts)
15:46  koniu btw i've seen a shot of your on-screen kbd, nice one
15:46  farhaven thx
15:46  farhaven needs a lot of work to be usable though
15:46  koniu now say someone had a wibox on the bottom
15:47  koniu and then they wanted to toggle the on-screen kbd at bottom too
15:47  koniu they'd have to go thru meddling with changing widget
table of the wibox, its height etc
15:47  koniu where they could only be hiding/showing the extra wibox
15:50  farhaven koniu: damn, you are right
15:50  farhaven though wait
15:50  farhaven nope :D
15:50  farhaven the onscreen keyboard would still be visible
15:50  farhaven people could just offset it after creating it
15:50  farhaven but that's kludgy...
15:50  farhaven ah what the heck, i'll try fixing that too :P
15:52  koniu it's just an example but the bottom line is that
there's a number of ways of achieving something, and we should provide
as many options as we can. it shouldnt be too difficult to check the
current struts while creating a new docked wibox

k

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


Re: Multiple wibox on same 'position'

2009-09-16 Thread Julien Danjou
At 1253100761 time_t, koniu wrote:
 15:52  koniu it's just an example but the bottom line is that
 there's a number of ways of achieving something, and we should provide
 as many options as we can. it shouldnt be too difficult to check the
 current struts while creating a new docked wibox

Problem is that strut assume you put the wibox at the bottom of the
screen in your example.
So that's supported, you can put 2 wiboxes on bottom, but both have to
be at the bottom edge of the screen and the MAX() of the two wiboxes
height will be used to reserved area.

That's an EWMH limitation. Fix EWMH and I'll fix awesome. ;)

Cheers,
-- 
Julien Danjou
// ᐰ jul...@danjou.info   http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
// The more we fly, the more we climb, the more we know that heaven is a lie.


signature.asc
Description: Digital signature


Re: Multiple wibox on same 'position'

2009-09-16 Thread Uli Schlachter
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Julien Danjou wrote:
 At 1253100761 time_t, koniu wrote:
 15:52  koniu it's just an example but the bottom line is that
 there's a number of ways of achieving something, and we should provide
 as many options as we can. it shouldnt be too difficult to check the
 current struts while creating a new docked wibox
 
 Problem is that strut assume you put the wibox at the bottom of the
 screen in your example.
 So that's supported, you can put 2 wiboxes on bottom, but both have to
 be at the bottom edge of the screen and the MAX() of the two wiboxes
 height will be used to reserved area.
 
 That's an EWMH limitation. Fix EWMH and I'll fix awesome. ;)

Then be creative and start EWMH2 (feel free to improve on that name) and fix
this. Or, even better, just ignore EWMH here since wiboxes are something
internal to awesome, no other window manager will ever touch them.
There got to be a way to let awful stack wiboxes

Uli
- --
Do you know that books smell like nutmeg or some spice from a foreign land?
  -- Faber in Fahrenheit 451
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)

iQEcBAEBCAAGBQJKsNfnAAoJECLkKOvLj8sGmxYIAKmT7Asv+OL7VmASK2ufxIsG
ZrgNo2kHOg2+KOXFKfapV78AY2hDXvr+Vb+nwBzyMNxQX+X9dIgoQ3saohij1KIr
Hrx/gbep/Ksr936AfikVD47JL2y13akbhQKAEJWiPkLNvH9VmztzVJbI8IsZz5sl
rGOPYxzbU4aQ5IUTnoQgIqrvWoOmFIRVGhTBlF33cOl1auHTMdKrVd8keEt/wXo/
Uhp+VfaxJR+3PHeZ1lwf50aq35+6Tz5AiqWlkBa5UocrdyeCoYIEKPCMdf+h0Y7s
Oh8D0ldJPtP4MzWUNQkjWBPJ0f0Tlu7blq3KwYq67ml+F2lOBaOp3uAdzpnJmbg=
=P7nH
-END PGP SIGNATURE-

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


Multiple wibox on same 'position'

2009-09-15 Thread No No
Hi,
As some may know, two wiboxes cannot be created with same 'position' field
in awesome 3.4, when in 3.3, the second declared wibox would appear just
under the first.

I worked on a small patch which modifies screen.c and awful/wibox.lua. Seems
to be working for me so far (I work with one wibox for various widgets + one
for tasks but I also tested it with two wiboxes top and one bottom).

However I admit not being really familiar with the project's code, I tried
several things and it finally worked out. Furthermore this patch could
conflict with planned rewrittings/cleanings of awesome's api.

Thus, I'm here asking for opinions on this patch's usefulness and
implementation.

Thanks in advance,
olcc
From 10df6c994c1a4976a7a4de72e7edb4087d709d91 Mon Sep 17 00:00:00 2001
From: olcc laurent.of...@gmail.com
Date: Mon, 14 Sep 2009 18:34:20 +0200
Subject: [PATCH] multiple wibox handling : first try

---
 lib/awful/wibox.lua.in |   27 +++
 screen.c   |   16 
 2 files changed, 31 insertions(+), 12 deletions(-)

diff --git a/lib/awful/wibox.lua.in b/lib/awful/wibox.lua.in
index 1bae18b..185979a 100644
--- a/lib/awful/wibox.lua.in
+++ b/lib/awful/wibox.lua.in
@@ -48,18 +48,37 @@ end
 function set_position(wibox, position, screen)
 local screen = screen or wibox.screen or 1
 local area = capi.screen[screen].geometry
+local pos = { x = area.x, y = area.y, height = area.height, width = area.width }
+
+for _, wprop in ipairs(wiboxes) do
+if wprop.wibox ~= wibox then
+if wprop.postion == right then
+pos.width = pos.width - wprop.wibox.width - 2 * wprop.wibox.border_width
+elseif wprop.position == left then
+pos.x = pos.x + wprop.wibox.width + 2 * wprop.wibox.border_width
+pos.width = pos.width - wprop.wibox.width - 2 * wprop.wibox.border_width
+elseif wprop.position == bottom then
+pos.height = pos.height - wprop.wibox.height - 2 * wprop.wibox.border_width
+elseif wprop.position == top then
+pos.y = pos.y + wprop.wibox.height + 2 * wprop.wibox.border_width
+pos.height = pos.height - wprop.wibox.height - 2 * wprop.wibox.border_width
+end 
+else
+break
+end
+end
 
 -- The length of a wibox is always chosen to be the optimal size
 -- (non-floating).
 -- The width of a wibox is kept if it exists.
 if position == right then
-wibox.x = area.x + area.width - (wibox.width + 2 * wibox.border_width)
+wibox.x = pos.x + pos.width - (wibox.width + 2 * wibox.border_width)
 elseif position == left then
-wibox.x = area.x
+wibox.x = pos.x
 elseif position == bottom then
-wibox.y = (area.y + area.height) - (wibox.height + 2 * wibox.border_width)
+wibox.y = (pos.y + pos.height) - (wibox.height + 2 * wibox.border_width)
 elseif position == top then
-wibox.y = area.y
+wibox.y = pos.y
 end
 
 for _, wprop in ipairs(wiboxes) do
diff --git a/screen.c b/screen.c
index 96a1a7a..8884483 100644
--- a/screen.c
+++ b/screen.c
@@ -179,30 +179,30 @@ screen_area_get(screen_t *screen, bool strut)
 if((o)-strut.top_start_x || (o)-strut.top_end_x || (o)-strut.top) \
 { \
 if((o)-strut.top) \
-top = MAX(top, (o)-strut.top); \
+top = top + (o)-strut.top; \
 else \
-top = MAX(top, ((o)-geometry.y - area.y) + (o)-geometry.height); \
+top = top + ((o)-geometry.y - area.y) + (o)-geometry.height; \
 } \
 if((o)-strut.bottom_start_x || (o)-strut.bottom_end_x || (o)-strut.bottom) \
 { \
 if((o)-strut.bottom) \
-bottom = MAX(bottom, (o)-strut.bottom); \
+bottom = bottom + (o)-strut.bottom; \
 else \
-bottom = MAX(bottom, (area.y + area.height) - (o)-geometry.y); \
+bottom = bottom + (area.y + area.height) - (o)-geometry.y; \
 } \
 if((o)-strut.left_start_y || (o)-strut.left_end_y || (o)-strut.left) \
 { \
 if((o)-strut.left) \
-left = MAX(left, (o)-strut.left); \
+left = left + (o)-strut.left; \
 else \
-left = MAX(left, ((o)-geometry.x - area.x) + (o)-geometry.width); \
+left = left + ((o)-geometry.x - area.x) + (o)-geometry.width; \
 } \
 if((o)-strut.right_start_y || (o)-strut.right_end_y || (o)-strut.right) \
 { \
 if((o)-strut.right) \
-right = MAX(right, (o)-strut.right); \
+right = right + (o)-strut.right; \
 else \
-right = MAX(right, (area.x + area.width) - (o)-geometry.x); \
+right = right + (area.x + area.width) - (o)-geometry.x; \
 } \
 }
 
-- 
1.6.4.3