Commit Graph

117 Commits

Author SHA1 Message Date
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
Julien Danjou 59c04ce3dc wibox: add mouse bindings
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-12-14 10:28:24 +01:00
Maarten Maathuis 2ab78b847d wibox: Always resize, otherwise your wiboxes are too large or small when the workarea changes.
Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-12-14 10:28:24 +01:00
Maarten Maathuis dbbe48898a client: Also check for struts on client_{ban,unban}
Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-12-14 10:28:23 +01:00
Julien Danjou 8b88541f0a xembed: store windows in an array
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-12-14 10:28:22 +01:00
Julien Danjou 2037a053a9 layout: move layout code to Lua
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-12-14 10:28:21 +01:00
Maarten Maathuis f9c2ee62a3 client: reimplement client_{ban,unban} for more performance
- From now on clients shall remain mapped for their entire lifetime.
- This should seriously boost tag switching speed with composite active.
- A lesser improvement may be noticed in non-composite situations.
- Titlebars that are set to invisble are still unmapped.
  Since it would clutter the implementation and titlebars are cheap to render.
  Not to mention that invisible titlebars are pretty rare.
- It's safe to attach titlebars while the client is banned.
- Titlebars are explicitly removed at exit.

Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-12-12 19:19:28 +01:00
Julien Danjou d61c6f5ae9 wibox: add cursor property
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-12-12 16:51:41 +01:00
Julien Danjou ccc6452d49 widget: change widget initialization code
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-12-12 16:51:41 +01:00
Julien Danjou c7a7437433 wibox: remove spurious fprintf()
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-12-09 17:42:18 +01:00
Julien Danjou 3d2c205969 luaa: check that object is a table before calling lua_next()
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-12-09 16:45:02 +01:00
Julien Danjou 3af636c3e6 wibox: setvisible checks for screen
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-12-09 16:23:39 +01:00
Julien Danjou a329da144d wibox: kick systray on detach
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-11-17 13:55:59 +01:00
Julien Danjou f45c3dd641 wibox: only warn on looping table
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-11-07 11:21:41 +01:00
Julien Danjou 528991fae8 wibox: copy pixmap after mapping
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-11-03 18:26:31 +01:00
Julien Danjou 993f83b788 wibox: check floating size
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-11-03 17:54:56 +01:00
Julien Danjou 5c0716109b wibox: stack correctly on attach
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-11-03 16:34:29 +01:00
Julien Danjou 16a2eadb66 wibox: check for table loops
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-10-27 14:17:12 +01:00
Julien Danjou 85c7bf07c9 luaa: merge tostring() with DO_LUA_NEW
Also use the same format as standard Lua for tostring output.

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-10-26 16:15:49 +01:00
Julien Danjou f43c455035 wibox: support for border when not floating
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-10-24 13:58:25 +02:00
Julien Danjou a0416a9abf wibox: draw before map to avoid artefacts
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-10-24 11:57:01 +02:00
Julien Danjou 25bf12868a widgets: use a geometry callback
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-10-22 17:32:17 +02:00
Julien Danjou 569ea75409 wibox: handle widget_node_t as array rather than list
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-10-21 17:21:59 +02:00
Julien Danjou a5640330d9 lua: check for ref value before getting them
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-10-21 10:35:23 +02:00
Julien Danjou 862fe193ee Rewrite {tag,task}list in Lua.
This removes the C implementation of taglist and tasklist widgets and
use a Lua one.

This works by letting .widgets property of wiboxes to be a table with
table, and setting a special metatable on them which notify awesome on
newindex events, updating wiboxes.

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-10-20 20:06:09 +02:00
Julien Danjou 96c23ad5cb wibox: initialize wibox borders correctly (FS#343)
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-10-14 17:32:03 +02:00
Julien Danjou 3c11511316 wibox: modify border color live
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-10-12 17:26:29 +02:00
Julien Danjou a57b87b411 wibox: update position correctly for titlebar
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-10-12 17:15:01 +02:00
Julien Danjou ebab2b7707 wibox: newindex allow border color change
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-10-12 17:02:42 +02:00
Julien Danjou b3580fc519 wibox: handle position on new correctly
We do not need to call setposition since we are not attached.
We just need to set orientation and position_update to get the right
coords.

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-10-03 08:57:58 +02:00
Julien Danjou a4224193d8 widget: move widget_{set,get}
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-10-01 17:45:07 +02:00
Julien Danjou 53a5f6796a wibox: compute phys_screen on right index
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-09-29 16:31:52 +02:00
Julien Danjou 5709435392 wibox: rework, merge titlebar
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-09-26 15:00:42 +02:00
Julien Danjou 2dfde8c181 util: remove off position
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-09-26 15:00:27 +02:00
Julien Danjou 08b0d71db3 wibox: add ontop attribute
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-09-26 15:00:27 +02:00
Julien Danjou 305af484f5 wibox: add full geometry
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-09-26 15:00:27 +02:00
Julien Danjou 0feb7de68e wibox: merge statusbars and titlebars Lua objects
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-09-22 14:34:43 +02:00
Julien Danjou f4648c2e26 wibox: wibox_refresh merge statusbar and titlebar
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-09-22 11:11:56 +02:00
Julien Danjou 34fe130307 wibox: merge statusbar and titlebar types
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-09-22 11:11:56 +02:00