Commit Graph

62 Commits

Author SHA1 Message Date
Uli Schlachter 08cd44dda7 drawin: Remove screen property
There isn't much point in the screen property of a drawin because the geometry
already defines on which screen the drawin is.

The biggest chunk of changes from this is due to removing the functions
drawin_detach and drawin_attach which where called when the screen property was
set/unset.

The code from drawin_detach is moved into drawin_set_visible and drawin_wipe.
drawin_attach is moved into drawin_init.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-27 16:21:49 +02:00
Uli Schlachter 4e31c72497 drawin: Remove some dead code
Thanks to a recent commit, a drawin's window will always be a valid and existing
window. This means we can remove all the code which checks this before doing
something.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-09 16:21:20 +01:00
Uli Schlachter 61fde273ca drawin: Update the drawing-stuff less often
We don't need an up-to-date pixmap and cairo surface for a drawin which isn't
visible. Thus, only bring those up-to-date when the drawin is visible.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-09 16:21:20 +01:00
Uli Schlachter 2f406a9385 Simplify drawin screen handling
Instead of creating/destroying a window whenever the drawin is attached/detached
from some screen, a window is now created when the drawin is created and it
isn't destroyed until the drawin is garbage collected.

Since we can now safely assume that a drawin always has a associated window,
this should make it possible to simplify some stuff.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-09 16:21:08 +01:00
Uli Schlachter f57dbb6a78 Remove a possibility for lua to cause X11 errors
The lua code could keep a reference to out cairo surface for a drawin after it
was destroyed. So make sure the surface is finished before the associated
drawable is destroyed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-12-19 14:29:52 +01:00
Uli Schlachter da78a89dcd Remove some pointless code
This is a left-over from when widgets where removed (commit
d213f19c5f).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-12-19 14:26:34 +01:00
Uli Schlachter 1076a6ea47 Drawin: Add bg_color property
We actually have to set a proper background color on all our drawins, else the
default black will "flicker through" while the window is drawn.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-12-12 21:14:04 +01:00
Uli Schlachter 742c0dead0 Systray: Fix
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 15:38:44 +02:00
Uli Schlachter d9aa194cb3 drawin: Let lua access the drawing surface
Lua now has access to a cairo surface via drawin.surface. When the drawing to
this surface is finished, it should call drawin:refresh() to make the result
visible.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 14:15:34 +02:00
Uli Schlachter 9c7ebf55fa Fix some style errors
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 13:53:07 +02:00
Uli Schlachter 1ba7f28d06 Drawin: Keep a surface for all drawing isntead of a context
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 13:53:07 +02:00
Uli Schlachter 5f5787d97b Wibox: Rename to drawin
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 13:36:02 +02:00