Commit Graph

88 Commits

Author SHA1 Message Date
Julien Danjou a8115bd45e luaobject: ref take index number as argument
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-16 17:15:20 +02:00
Julien Danjou c95ba76d2f luaobject: use object header and standard gc everywhere
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-16 16:26:45 +02:00
Julien Danjou 25b3e718d1 wibox: do not set need_arrange on wibox detach
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-10 11:41:58 +02:00
Uli Schlachter a264acb1f0 Also track opacity for unattached wibox
Before this, setting w.opacity of a wibox that was not attached to some screen
had no effect, now this is cached and applied when the wibox is attached to
some screen.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-06-05 14:33:02 +02:00
Uli Schlachter 6b5e5f352c Use the new simplewindow functions for managing a wibox' opacity
Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-06-05 14:32:00 +02:00
Uli Schlachter 8d30ef7d43 Add a border_color parameter to simplewindow_init()
All callers immediately called simplewindow_border_color_set() anyway.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-06-05 14:31:15 +02:00
Julien Danjou 3f6ab274c0 wibox: all wiboxes go into one and only one array
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-04 17:51:35 +02:00
Julien Danjou 7cc0b13eae wibox: move position handling to Lua
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-04 17:51:30 +02:00
Julien Danjou 0c564079b5 wibox: add property hook on screen and visible changes
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-04 17:51:07 +02:00
Julien Danjou fba4accc14 Revert "client: handle struts (a lot) better"
This reverts commit 264a81f3fb.

Conflicts:

	client.c
	client.h
	lib/awful/mouse.lua.in
	screen.c
	structs.h
	wibox.c
2009-05-25 15:17:57 +02:00
Julien Danjou 43902aed69 luaa: fix memory leak in __gc
We need to wipe the ref_array.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-05-08 09:53:20 +02:00
Julien Danjou fd40431e29 wibox: add missing documentation on objects
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-05-07 15:03:45 +02:00
qsd e0c56d36e6 wibox: fix Left and Right wibox position computing (FS#512)
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-27 21:49:24 +02:00
Julien Danjou 4a34693bfb screen: remove index field
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-18 17:51:31 +02:00
Uli Schlachter 99b521b2c7 Rename luaA_pushcolor() to luaA_pushxcolor()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-18 14:02:21 +02:00
Julien Danjou f473a107b0 cleanup #includes
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-17 16:52:25 +02:00
Julien Danjou 486ef71a7f screen: replace screens pointer by a screen_t array
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-17 16:14:09 +02:00
Julien Danjou 9b61434f7e wibox: fix memory leak with cursor
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-13 12:40:33 +02:00
Julien Danjou a08794d7cd client, wibox: unref image on garbage collection
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-13 12:36:23 +02:00
Uli Schlachter bee45f1b4a Remove the code for floating wiboxes from wibox_position_update_non_floating()
The last commit moved the handling of floating wiboxes into its own function,
so the checks for floating wiboxes in here can be removed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-12 21:11:46 +02:00
Uli Schlachter b4b08fd926 Split wibox_position_update() up
Floating wiboxes are much easier to handle, so they deserve their own
function.
This function, wibox_position_update_floating() does exactly the same things
wibox_position_update() did before. No behaviour change involved.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-12 21:08:59 +02:00
Uli Schlachter 62bfc2e9ac Some minor code optimization
It's just easier to read this way. :)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-12 21:04:05 +02:00
Uli Schlachter 34554d8958 Only arrange screen for non-floating wiboxes
Floating wiboxes dont influence client's position and thus no arrange
is necessary.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-12 21:02:21 +02:00
Julien Danjou 5931bf752d wibox: use new Lua object system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:33 +02:00
Julien Danjou 81033d391b client: use new object system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:33 +02:00
Julien Danjou b1a59aca07 widget: widget are now full Lua object
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:33 +02:00
Julien Danjou 541d4f565f image: use new object system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:32 +02:00
Julien Danjou be752cc81c client: change global linked list to an array
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:32 +02:00
Uli Schlachter dc82832ccf Make sure a wibox does not display garbage when made visible
This moves the call to wibox_draw() into wibox_map() which fixes garbage
being displayed if a wibox is made visible by setting its .visible.

Since wibox_draw() already calls simplewindow_refresh_pixmap(), that call is
dropped. Because wibox_need_update() just makes sure wibox_draw() is later
called, we can replace the call to wibox_draw() by this call. This should avoid
superflous updates.

Found by lua code like this:

local w = wibox({ position = "floating", bg = "#ff0000" })
w.visible = false
w.screen = 1
<do some other stuff>
w.visible = true

Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-11 13:46:58 +02:00
Uli Schlachter ff34fd2f3b Add wibox_map() helper function
This moves some common code into a helper function to reduce code
duplication and open-coding that function all the time.

This commit doesn't cause any behaviour change at all.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-11 13:46:40 +02:00
Uli Schlachter 4574d87988 Don't update a wibox' position when it is created
For a floating wibox which isn't visible, all what wibox_position_update()
does is setting the geometry fields in the simplewindow struct. Since the next
thing luaA_wibox_new() does is setting the wibox' geometry, this call makes
no sense.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-11 13:46:34 +02:00
Uli Schlachter 99a8dbeaf7 wibox_position_update(): Skip wibox if wibox.screen is nil
If a wibox's screen is set to nil, this is reflected by setting the screen
struct member to SCREEN_UNDEF.
SCREEN_UNDEF is defined as -1. If we allow such a wibox in
wibox_position_update(), bad things will happen (globalconf.screens[-1]).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-11 13:46:30 +02:00
Uli Schlachter 95457c5ab7 Move the definition of globalconf into a header file
Pretty much every single source file needs this struct, so it makes sense to
define it in a common header instead of in every single .c file.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-10 16:32:42 +02:00
Uli Schlachter 62397eac95 wibox: add wibox_need_update()
This moves some common code into the new function wibox_need_update().

This patch is based on a patch from Julien Danjou.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-07 18:25:37 +02:00
Maarten Maathuis 264a81f3fb client: handle struts (a lot) better
- WINDOW_TYPE_DOCK are chosen first.
- Top/Bottom take precedence over Left/Right.
- Struts are automatically updated.
- Automatically avoid overlap with other struts or wibox'es.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-31 09:17:36 +02:00
Uli Schlachter 7f7aac4583 wibox: fix a (harmless) X protocol error message
When creating a wibox the call to simplewindow_orientation_set() caused a
pixmap to be allocated, but the width and height weren't initialized yet.
Thus, awesome tried to create a 0x0 pixmap which the X server doesn't like.

This fixes the error and I haven't noticed any bad effects due to this patch.
Plus this should avoid some unneeded pixmap allocations. ;)

W: awesome: xerror:289: X error: request=CreatePixmap, error=BadValue

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-17 19:51:00 +01:00
Julien Danjou 6395db4331 swindow: change border_width handling
It's now outside of the geometry.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-17 18:04:08 +01:00
Julien Danjou cc54c32c5f wibox: add support for background image (FS#464)
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-12 11:49:58 +01:00
Julien Danjou e2bfc1ca5f wibox: fix south systray orientation (FS#459)
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-02-23 15:39:37 +01:00
Julien Danjou 1e74e61c13 wibox: use orientation rather than position
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-02-23 14:51:30 +01:00
Gregor Best 10bfb36d4b wibox: add mouse_enter and mouse_leave for wibox
Signed-off-by: Gregor Best <farhaven@googlemail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-02-13 22:54:36 +01:00
Julien Danjou 5536d8e78b wibox: reparent systray only if needed (FS#436)
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-01-30 16:13:34 +01:00
Gregor Best 542312beff wibox.c: add real transparency for wiboxes
Signed-off-by: Gregor Best <farhaven@googlemail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-01-26 09:33:56 +01:00
Julien Danjou 6a10f5989e wibox: use integer as array index
Let the compiler chose the right type.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-01-19 13:24:33 +01:00
Julien Danjou 74cff05428 wibox: simplify render proto
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-01-16 15:26:40 +01:00
Julien Danjou b1ab27a576 wibox: reset mouse over some various corner cases
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-01-16 15:26:35 +01:00
Julien Danjou 4fdd239500 wibox: add ontop as possible opt in constructor
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-01-14 11:28:13 +01:00
Julien Danjou fae7e5bb8a wibox: check coordinates and screen attributes match
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-01-08 11:01:06 +01:00
Julien Danjou d709180738 wibox: reset mouse_over on visibility/attachment changes
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-12-18 16:58:15 +01:00
Maarten Maathuis 6e199bbd76 client, swindow: switch to a more convient definition of geometry
- In many places i see people correcting for border width and titlebars.
- This new definition is the equivilant of what used to be fullgeometry.
- The internal geometry is now contained to a few functions that few people ever touch.
- This should avoid confusion and make code easier.
- Also protect against several unsigned overflows.

Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-12-14 10:28:24 +01:00