Commit Graph

12 Commits

Author SHA1 Message Date
Uli Schlachter 1924ee9e6e drawin: Only redraw on move with translucent background
If a drawable has an opaque background, we don't need pseudo transparency and
thus its content don't change when it is moved. However, when we need pseudo
transparency, then we have to redraw the drawable to apply the new background.

Previously we just always did the redraw. This commit adds a helper function
gears.color.create_opaque_pattern() that analyzes a cairo pattern for
transparency. We use this new function to only redraw-on-move when there is
actual pseudo transparency in effect. Otherwise, this redraw can be skipped.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-16 14:58:14 +01:00
Uli Schlachter 91cc8519b5 wibox.drawable: Cache the wallpaper
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-02-23 12:19:26 +01:00
Björn Åström c6365fa2f6 drawable: Support for true transparency (FS#1210)
This makes the drawable paint the wallpaper in the background
(i.e. pseudo transparency) only if there is not a composite manager running,
as reported by the value of awesome.composite_manager_running.

In other words: drawables can now make use of true transparency.

Signed-off-by: Björn Åström <bjoast@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-02-23 12:16:00 +01:00
Emmanuel Lepage Vallee d5a3669e96 Add support for "geometry" argument for mouse events and awful.button 2013-03-23 21:24:52 +01:00
Uli Schlachter 873d41bb5b wibox.drawable: Redraw when moved
Let's consider the following notification:

  naughty.notify({ text = "foo", bg = "#88888888", timeout=1 })
  naughty.notify({ text = "foo", bg = "#88888888", timeout=2 })

When the first notification disappears, the second one is moved and takes its
place. However, its content was not redrawn. This makes the pseudo-transparency
break and the wallpaper that is shown in the back of the notification doesn't
match the real wallpaper.

Fix this by redrawing drawables when they get moved.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-26 11:21:48 +01:00
Uli Schlachter 2de450dff9 wibox.drawable: Don't redraw drawables without surfaces (FS#1079)
Thanks to the previous commit, a drawable can no longer have a finished cairo
surface. Instead, it will now have a nil surface. This commit handles this new
possibility.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-20 14:19:31 +01:00
Uli Schlachter e24c09e828 Update titlebar color when focus changes (FS#1056)
The current code relied on some widget to cause a redraw when the focus changes.
Obviously, this assumption is wrong.

Instead, the code now uses the proper "focus" and "unfocus" signals for setting
titlebar colors, but it also needs to set these colors when a new titlebar is
created (v1 of this patch forgot that). For this reason, update_colors has to be
saved for when a titlebar's colors are updated.

This commit also reverts the ugly redraw_hook hack from commit a1918b8306.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-29 16:52:19 +01:00
Uli Schlachter 14fa66c63f wibox.drawables: Fix a memleak
Drawables could never be garbage-collected, because of the "wallpaper_changed"
signal. The callback function for this signal kept a strong reference to the
drawable.

Fix this by putting all drawable's draw() methods into a weakly keyed tabled so
that the strong reference to them disappears.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-03 19:52:39 +01:00
Uli Schlachter fa86fbeb52 lib/wibox: Make signals from drawables available
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-31 22:12:30 +01:00
Uli Schlachter a1918b8306 awful.titlebars: Implement
This commits adds the necessary lua code so that we finally can have titlebars.
As the baseline for the needed functionality, the titlebar code in awesome 3.4
and a quick poll on the mailing list were used.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-23 20:37:50 +02:00
Uli Schlachter 1e418cbe3b drawable: Add property::surface
This new property is used for fixing some missing redraws that the old code had.
Those could be seen via awful.menu. Open and close a submenu repeatedly and the
submenu will appear black.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-20 22:51:52 +02:00
Uli Schlachter 41ef107b88 Add titlebars on the C side
This commit makes it possible to add titlebars to a client. These titlebars are
drawables.

The drawin's input handling is moved to the drawable. This allows it to use the
same code for drawin and titlebar input handling, although there are lots of
differences between the two on the C side.

On the lua side, a new wibox.drawable module is created which handles all the
drawable-specific magic and which can also be used for titlebars.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-14 17:30:59 +02:00