Commit Graph

5794 Commits

Author SHA1 Message Date
Uli Schlachter d82342e386 awful.titlebar: Add show, hide, toggle functions
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-19 14:37:07 +02:00
Uli Schlachter bcea1aab66 Stop linking against xcb-image
Since the previous commit we don't use this library any more.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-16 12:12:16 +02:00
Uli Schlachter 813fb94ce8 client.content: Return a cairo xcb surface
We no longer have to turn the client's content into an image buffer "by hand".
Instead, we can just use cairo for the job.

Even more exciting, we don't need to turn this into an image buffer at all. We
can just directly return a cairo xcb surface for the client window. Depending on
how lua will use this surface, this could make it possible to avoid having to
create the image buffer at all!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-16 12:09:40 +02:00
Uli Schlachter 11bef0795a client.content: Use correct client size (FS#1150)
The size saved in c->geometry also includes the titlebars. Thus, for getting the
window content, we have to subtract this from the size.

Before this, the call to xcb_image_get() was failing with a BadMatch error,
because we were asking for an area that is outside of the actual client's
window's geometry.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-16 12:06:10 +02:00
Uli Schlachter bb304c80a3 draw: Add function for finding a visual by id
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-16 11:59:00 +02:00
Uli Schlachter 3edd216560 wibox: Add widget geometry cache
This commit adds and uses wibox.layout.base.fit_widget(). This function is a
wrapper for widget:fit() that caches the result and thus speeds things up.

This is necessary because some layouts call :fit() from their :fit() and :draw()
functions. Nesting such layouts means that at the widget at the tail of the
stack gets its :fit() function called quite often. If this function is not
blazingly fast, this results in noticeable slowness.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-08-21 12:26:47 +02:00
Uli Schlachter a0e45e878e client: Ignore "fake" string property changes
I noticed high CPU usage while using asunder. The reason was that asunder
re-sets its window name every 0.1 seconds (and awesome's drawing code is way too
slow).

A semi-fix for this is to ignore string property changes if the old and new
value for the property are equal.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-08-01 11:48:03 +02:00
Uli Schlachter 14722aa6e4 Fix WM_CLIENT_LEADER handling
This was broken since 5d0a81c8bf. Whoops.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-06-19 19:23:19 +02:00
Uli Schlachter 5b5dd0a198 luadoc: Clients have a leader_window, not leader_id
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-06-19 19:15:02 +02:00
kardan 57bec371f7 honor appended -c option for --check
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-06-12 22:37:39 +02:00
Uli Schlachter 0c62831eea lua: Print traceback on startup errors
We do some special magic so that we can have tracebacks on errors messages.
However, the code for parsing the rc.lua called it without this magic and thus
errors didn't have tracebacks.

This is bad, because if something goes wrong in e.g. wibox.widget.textbox, you
don't really have any clue where this error is coming from.

Fix this by adding our "print traceback on error"-magic here, too.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-06-08 13:21:14 +02:00
Uli Schlachter 14daf85fe9 awful.tooltip: Set the bg color correctly (FS#1148)
Well, whoops. There is no .bg property on wiboxes for quite a while already, it
is now a :set_bg member function.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-05-13 19:27:19 +02:00
Uli Schlachter 2d3103345e Implement window gravity in ConfigureRequests (FS#1137)
Previously, awesome didn't move windows when they sent a ConfigureRequest (and
it also shrunk them by the size of titlebars, before it forgot to add these).
This commit adds proper gravity support to ConfigureRequest handling.

This was tested with test-gravity from metacity (in src/wm-tester).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-04-07 11:57:40 +02:00
Uli Schlachter ddfd9c0e79 change codename
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-04-01 13:44:46 +02:00
Uli Schlachter 2e921d9096 Fix minor memory leak in mouse_query_pointer()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-31 18:15:25 +02:00
Uli Schlachter a7c3f10ce5 Send correct position in ConfigureNotify events (FS#1030)
This event should contain the position of the top-left corner of the client's
content area. Thus, we have to add the border width to the position.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-31 18:07:49 +02:00
Uli Schlachter ee1fe4dd59 Revert "Support more than 5 mouse buttons" (FS#1082)
This reverts commit bd8158495e.

The idea was to track the current list of pressed and depressed mouse buttons,
because we get button events for more than 5 buttons, but can only query the
state of the first 5 buttons.

However, there are cases where we see button presses, but won't see the
corresponding release event. This is quite bad.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-29 16:07:13 +01:00
Ross Lagerwall fc49e28025 naughty: Don't interpret markup in titles
Since only the body text of a notification may contain markup,
by combining the two together and calling set_markup(), the
title would also get interpreted as if it had markup.
This could be seen with:
$ notify-send "Title & text" "<i>body text</i>"

The unescaped & would get interpreted as broken markup and so
naughty would fall back to escaping everything which would make
the "<i>" tags be shown rather than interpreted.

So, the title must always be escaped so that it is not interpreted
as markup.

Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-26 10:17:51 +01:00
Uli Schlachter 8af54130d6 Fix wibox.layout.flex:fit() (FS#1126)
The flex:fit() function was calling the fit() function of the widgets it
contained with too large values, trying to hand out more space than it had
available. This resulted in more space being requested than was available and
some weird layout issues resulted.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-24 22:32:53 +01:00
Emmanuel Lepage Vallee e7912fc2a8 Fix mod4+[1-9] in default rc.lua
The old code had flaws:
* If the tag chnaged screen, the code was unstable.
* If awful.tag.del was used, then it displayed an error
* If tags were added later, the keyboard shortcut were unavailable
2013-03-23 21:25:44 +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
Jo De Boeck e0a163cba0 Fix calculation of distance between clients
This fixes move by direction

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-21 15:11:35 +01:00
Emmanuel Lepage Vallee a484ef076d Allow to disable taglist icons.
This is used if the user want to use a custom drawing method.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-17 23:43:29 +01:00
Emmanuel Lepage Vallee 67710d0008 Add ability to set background images for empty tag
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-17 23:43:29 +01:00
Emmanuel Lepage Vallee e920c74fd9 Add ability to disable tasklist icons and restore ability to set bg_images
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-17 23:43:29 +01:00
Emmanuel Lepage Vallee 1c76560da7 Add external function for {tag,task,tab}list background image
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-17 23:43:28 +01:00
Uli Schlachter 7a47355c99 awful.mouse: Follow C API changes
Whoops. This was broken ages ago. Thanks to Elv13 for making me notice.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-17 22:52:39 +01:00
Poggles ed763b9ad3 Speed up the RGBA->BGRA conversion (FS#1112)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-17 17:23:04 +01:00
Uli Schlachter 2b0398c59b awful.tag: Use sane tag index values (FS#1125)
Since commit d8a93dafa3, tags have an "index" property which decides about
the order in which they are displayed in the taglist. If a tag doesn't have this
property set, the next call to awful.tag.gettags() will fix this and "invent" an
index for this new tag.

However, if multiple tags didn't have an "index" property, gettags() would
assign all of them the same index. The following call to table.sort() would then
do random magic to these tags (remember: table.sort() is not a stable sorting
algorithm, so it is allowed to randomly swap around entries which have the same
sorting key).

Fix this by making sure that the new "index" properties are different from each
other.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-16 16:51:55 +01:00
Uli Schlachter 9d5e2a981a rc.lua: Fix titlebar button events (FS#1116)
Due to some layout changes, the client title widget is no longer assigned all
the remaining space. To work around this, we wrap the widget in a flex layout
which means that it asks for all the available space. This way, moving via the
titlebar works again.

Additionally, these button events are now also assigned to the client's icon
widget. No idea why this wasn't done before...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-14 20:14:43 +01:00
Uli Schlachter bc1507f96d Send correct size to fullscreen clients (FS#1093)
Titlebars are not visible for fullscreen clients, so it doesn't make sense to
substract the area used for the titlebar in ConfigureNotify events.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-13 21:20:13 +01:00
cdump d8a93dafa3 awful.tag: add index property for custom tag order
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-12 15:14:38 +01:00
Uli Schlachter d0ab8dc0c1 Fix ignoring size hints
The function c:geometry() should only honor size hints if this was enabled for
this client. Whoops.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-12 11:33:05 +01:00
Uli Schlachter 4540b8927a awful.util.spawn_with_shell: Use table as argument
Thanks to the previous commit, spawn_with_shell() can now easily fix lots of
problems that we previously had with escaping the argument to the shell.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-10 15:00:05 +01:00
Uli Schlachter 3c40d6b470 awesome.spawn: Accept tables as arguments
With this change, awesome.spawn() can be called with a table as its command line
argument. This gets rid of lots of problems with escaping the arguments. For
example, the following call is now possible:

  awesome.spawn({ "bash", "-c", "echo \"foo\"" })

Thanks to Ignas Anikevičius for inspiring me to this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-10 14:54:58 +01:00
Uli Schlachter 4c3bac07ec wibox: Improve constructor functions for some layouts
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-10 13:46:28 +01:00
Uli Schlachter 23b30be106 Move size hints handling back into C (FS#1117)
Having this in lua means that size hints are only applied after the client got
resized. The bad side effect of this is some flickering if awesome is being
slow. And apparently, it is slow for way too many people...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-10 12:13:32 +01:00
Lukáš Hrázký 5365dfdb79 wibox.layout.constraint: fix the min and max strategies
Fixes mixed up min/max strategies and other bugs in min and max. Also
removes enforcing the size in draw, adhering more to awesome's layout
concept.

Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-10 11:24:53 +01:00
Ignas Anikevicius (gns_ank) c34e9780b2 Remove F1-9 bindings from the manpages.
There was a leftover info about marked client keybindings and the
default rc.lua doesn't have those.

Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-10 11:22:35 +01:00
Poggles 2876718210 Make awful.util.cycle() less while'y
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-10 11:19:37 +01:00
Uli Schlachter 2e38c08569 wibox.wibox.systray: Allow multiple systrays
This has to be removed because it breaks the fallback to the default config if
the first config already managed to create a systray widget. This doesn't mean
that it is suddenly possible to have the systray visible in more than one place,
it just means that awesome will no longer complain about this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-10 11:11:43 +01:00
Uli Schlachter b36b56058f naughty: Handle broken icon arguments better (FS#1076)
Before this, surface.load() would throw a lua error because it couldn't load the
icon which broke naughty's state.

With this commit, this error is caught and an error message is printed on stderr
instead.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-10 10:57:49 +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
Julien Danjou 5a2c4fa928 Remove NoDisplay from desktop file
Signed-off-by: Julien Danjou <julien@danjou.info>
2013-02-25 11:50:00 +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 983001613a Drawable: Improve signal behavior
When property::surface is emitted, the drawable didn't know its geometry yet,
which had weird side effects. Fix this by changing the C API a little. The
function drawable_set_surface() now no longer allows a NULL surface as its
argument.

The required changes for the titlebar code also means that we no longer throw
away the double-buffering surface when a client is moved.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-20 14:09:19 +01:00
Lukáš Hrázký 470142acc3 wibox.widget.textbox: return 0, 0 from fit() if either w or h is 0
A hack around abusing the fact that width of a textbox is 0 when its
empty, while it's height is still set according to the font.

Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-20 13:08:27 +01:00
Lukáš Hrázký 1881ceb9d3 wibox.layout.flex: add set_max_widget_size() function
The function can be used to set the maximum size the widget in the
flex layout should take.

Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-20 13:08:27 +01:00
Stefan Haller ca73777017 Raise the window on EWMH request.
Additionally to handing over the focus to the window this commit raises
the window too. Otherwise a window which is hidden below other windows can
request the focus and because the window is not fully exposed, the user is
unaware which window has the input focus and is actually receiving the
keystrokes.

Signed-off-by: Stefan Haller <haliner@googlemail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-20 13:04:15 +01:00
Poggles bd05219a72 Make awful.layout.inc() accept a screen number
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-19 19:49:07 +01:00