Commit Graph

194 Commits

Author SHA1 Message Date
Uli Schlachter d2b1e92f9e Clean up header includes
Every .c file has to include the corresponding .h file first to make sure the
headers are self-contained. Additionally, this moves some unneeded includes
around.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-30 20:07:48 +02:00
Uli Schlachter fed199eee5 Also allow screen objects were screen indices are expected
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-30 17:55:42 +02:00
Uli Schlachter 271f084735 screen: Turn into proper lua object
This makes the screen objects use our existing infrastructure for implementing
classes and objects with lua instead of hand-rolling an own version.

This results in some small API change: Screen objects no longer have an
add_signal() function and instead this function exists on the parent screen
class.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-30 16:37:19 +02:00
Uli Schlachter d8b73de739 screen.[ch]: Move into objects/
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-30 15:12:47 +02:00
Uli Schlachter 03fec2b0f5 Don't set a background-pixel for our client frame windows
Previously we would get a short black flicker when a client closes. This
happened because first the client's window would get hidden and only a short
moment later would awesome react to this and close its own window. In the mean
time, the X server filled the frame window with its background-pixel which was
black.

Just removing the background-pixel means we get the default value which is None.
This means that the content will be left untouched and the client's window will
be visible for a moment longer.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-30 14:58:03 +02:00
Uli Schlachter 163fc18ab8 Ignore enter/leave events when unmanaging a window (FS#1239)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-28 13:15:24 +01:00
Uli Schlachter 7c3702e60a Fixup indentation
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-17 16:34:35 +01:00
Uli Schlachter 86f3b7f11f Drawable: Ignore exposes when we have nothing to draw
The X11 server tells us about things that need to be redrawn via expose events.
When we get such an expose event before lua drew the drawable, we just fill the
exposed area with old data (which is black for newly-created drawables).

Fix this by tracking if we have any usable data in a drawable's double buffering
pixmap. This flag is unset whenever we throw away the old content (e.g. due to a
resize) and is set when lua gave us some new content to display.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-17 16:27:10 +01:00
Uli Schlachter 873358a0b8 EWMH: Handle _NET_WM_DESKTOP in lua
We now handle all "important" EWMH messages in lua and lua can decide to do
different things than the current obvious one.

Consistency!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-17 16:15:20 +01:00
Uli Schlachter fed803a6bc client manage signal: Remove startup argument
We now have awesome.startup which does the same thing in better.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-16 20:15:02 +01:00
Uli Schlachter 794318c1a0 drawable: Add pixmap member
Previously, ownership of the pixmaps that we are using for double buffering was
a little weird. The pixmap belonged to the drawin/titlebar, but the
corresponding cairo surface was owned by the drawable. Clean this up by moving
the pixmap to the drawable.

This cleans up lots of ugly code and also fixes a crash: When a drawable was
garbage collected before its drawin, drawin_wipe() would crash accessing the
drawable. This was needed to make it forget about the cairo surface we gave to
it for the pixmap that is being destroyed.

By moving the pixmap to the drawable, this whole issues goes away.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-16 17:08:36 +01:00
Uli Schlachter 1da87eca3c Fix cairo surface memory leak
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-16 16:06:18 +01:00
Uli Schlachter 6b8bd49c0b Redraw titlebars more intelligently
Whenever a titlebar of a client needed to be refreshed, all (possibly) four
titlebars would get completely refreshed. So if someone actually added more than
one titlebar to a client, awesome would copy each titlebar's content to the
window four times. Fix this by introducing more fine-grined functions for
uploads.

This also makes awesome only update the affected area when it gets an expose
event for a titlebar instead of all four titlebars completely.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-16 15:29:11 +01:00
Emmanuel Lepage Vallee d6e06450d3 Add end to end support for spawning tracking using startup notifications
This allow to spawn something, then apply some properties or rules when
the client show up ("manage").

This commit add:
 * "startup_id" property for all clients object (immutable, can be nil)
 * Second return value to awful.util.spawn() with the startup_id
 * Update the documentation

Example:

  local wait_for_it = {}

  local pid,snid = awful.util.spawn("urxvtc")
  wait_for_it[snid] = {ontop=true,sticky=false,
     tag = awful.tag.gettags(mouse.screen)[1] }

  client.connect_signal("manage", function (c, startup)
     if c.startup_id and wait_for_it[c.startup_id] then
        for k,v in pairs(wait_for_it[c.startup_id]) do
           c[k] = v
        end
        if wait_for_it[c.startup_id].tag then
           c:tags({wait_for_it[c.startup_id].tag})
        end
     end
  end)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-15 23:14:02 +01:00
Uli Schlachter ef27189ffe Client: Add (and use) visualtype member to client_t objects
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-15 11:56:57 +01:00
Daniel Hahler a15e53deec Minor doc fixes 2014-03-15 08:52:14 +01:00
Daniel Hahler ac45dc9f59 Add client.maximized (a shortcut for ~_horizontal and ~_vertical)
This also adds the signals `property::maximized`.

Signed-off-by: Daniel Hahler <git@thequod.de>
2014-03-15 08:49:43 +01:00
Daniel Hahler c855b1babb Do not raise clients in client_manage
Instead, use stack_client_push and emit the `request::activate` signal
from awful.rules.apply, if the client gets focus.

Signed-off-by: Daniel Hahler <git@thequod.de>
2014-03-12 16:01:01 +01:00
Uli Schlachter 1b21dce46c Revert "client: Add c.blob property"
This reverts commit a54636751b.

We now have the new xproperty API which does the same thing in a much nicer way.
Thanks to Elv13 for the idea!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-07 16:21:11 +01:00
Uli Schlachter 910cbe401d client: Emit property::screen after geometry
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-06 18:08:21 +01:00
Uli Schlachter 04dee81d13 client: Add request::activate signal (FS#848)
When we receive a _NET_ACTIVE_WINDOW request on the root window, we used to just
focus and raise the window. This didn't do much for clients which are on
non-selected tags.

Thus, this commit makes awesome emit request::activate on the client instead.
This is used in awful.ewmh to implement the old behavior again, but with
additionally marking the client as urgent if it isn't visible.

People who don't like this behavior can use client.disconnect_signal to disable
this behavior again. To make this really possible, awful.ewmh becomes a
"non-nil" module.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-06 17:47:55 +01:00
Uli Schlachter a54636751b client: Add c.blob property
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-02-23 12:26:13 +01:00
Uli Schlachter 56c5797905 Finish C-side support for window shapes (FS#1051)
A drawin's and a client's bounding and clip shape can now be queried and is
returned as a cairo surface.  Also, a client window's shape (e.g. xeyes setting
its own shape) can be queried via c.shape_client_bounding and
c.shape_client_clip.  All of these properties now emit signals when changed.

(This also silently fixes a bug in luaA_drawin_set_shape_bounding() which forgot
to include the drawin's border in its size calculation)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-01-03 17:01:43 +01:00
Uli Schlachter db167ebe80 Revert "client: Don't move clients around across restarts (FS#1159)"
This reverts commit c3bca6ac34.

This caused problems where clients would always spawn on the top-left screen and
couldn't be moved around. This was because lua placed them on the other screen,
but when the titlebar got added, their top-left corner was moved over again.
2013-10-06 10:22:49 +02:00
Uli Schlachter c3bca6ac34 client: Don't move clients around across restarts (FS#1159)
This kind of forces every client to have a window gravity of "static".

This fixes most of the problem of clients moving around across restarts due to
the titlebar. What is left is that they move due to the border width which
should be handled in another patch. Also, another patch should make this honor
the client's actual window gravity.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-10-04 16:12:06 +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 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 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
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 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
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
Jeremy Bethmont 882099f900 Fixed bounding shape size to take into account border size.
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-12 17:51:41 +01:00
Uli Schlachter 265060f1f7 Fix a bug when switching fullscreen mode
The code assumed that a window gets resized when it enters/leaves the fullscreen
mode. This was needed because the code for resizing a window hides and shows the
titlebars.

However, it is possible for a window to enter/leave fullscreen mode without
getting resized, because it already has the correct geometry. In this case,
titlebars were not handled correctly.

This commit fixes that by forcing a resize to the current geometry when the
fullscreen flag is toggled.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-09 18:50:38 +01:00
Uli Schlachter c18f5f22f9 client: Re-add shape support
Same reasoning as for the recent commit which adds these to drawins.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-06 20:51:54 +01:00
Uli Schlachter 52d618c811 Fix fullscreen windows
Fullscreen windows only worked on a screen which had x and y coordinates 0.
Otherwise, the window inside the frame window was completely misplaced.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-04 21:35:32 +01:00
Uli Schlachter 3c320927f8 Hide titlebars on fullscreen clients
Fullscreen clients shouldn't be decorated, thus hide titlebars on those.

This commits assumes that clients get resized when they enter or leave the
fullscreen state. I don't think that this assumption is necessarily true, but
let's just wait for bug reports. :-)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-03 19:34:16 +01:00
Uli Schlachter e57e4a99c5 Enlarge clients when adding titlebars
Previously, the area of the window that the client could draw to got smaller
when titlebars are added. This causes all sorts of odd-looking effects, so
instead this should enlarge the window suitably.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-03 18:44:44 +01:00
Uli Schlachter 10d48e1fc8 Send correct geometry in ConfigureNotifies
The code was sending out ConfigureNotify events which contained the size of the
frame window. Thus, the client assumed that it is was larger than it actually
was.

Fix this by subtracting the size of the titlebars from the geometry for the
event.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-29 10:20:03 +01:00
Uli Schlachter 1f69f36993 Client: Properly get rid of titlebars on unmanage
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-23 10:19:10 +02:00
Uli Schlachter 8348d44444 Tags: Remove screen property
A tag's screen is now implemented purely in lua and it is no longer C's
business.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-23 10:05:34 +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
Uli Schlachter 29b09cf7da Ignore re-focusing the focused client
When something gives the input focus to the client which already has the input
focus, bad things can happen. Normally, you'd expect nothing to happen in this
case, but X11 is not that simple.

When updating the input focus and the focused client has the nofocus hint set,
we are actually taking away the focus from this client.

Hopefully this fixes FS#973.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-07-06 13:37:58 +02:00
Uli Schlachter fc76521edb Don't change focus in response to FocusIn events
Previously, when we received a FocusIn event, we would update the input focus,
because client_focus_update set globalconf.focus.need_update to true.

However, this is wrong for clients following the globally active focus model,
because in this case its the client which controls which window has the input
focus. It could happen that we thus took away the focus from the client which
just gave itself the focus.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-07-06 13:33:27 +02:00
Arvydas Sidorenko d61cdb86c9 Renamed luaL_reg to luaL_Reg
The original struct name is luaL_Reg, but Lua v5.1 had a
`typedef luaL_reg luaL_Reg`, which in v5.2 was removed
and as a result breaking the build in Awesome which uses luaL_reg
version exclusively.

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
2012-06-12 10:52:10 +02:00
Uli Schlachter e57af377bb Don't pass cairo surfaces around on the lua stack
Now that the C code uses lightuserdata for passing around cairo surfaces, they
are no longer automatically garbage collected. To avoid memleaks, this commit
compares the C code to use cairo_surface_t pointers instead of the lua stack.

This also fixes a memleak were a client's icon was leaked.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-28 09:29:47 +02:00
Uli Schlachter 4f30dfd198 Switch from oocairo to lgi.cairo
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-27 19:20:34 +02:00
Uli Schlachter f252746e86 Fix a harmless compiler warning
objects/client.c:678:1: warning: no previous prototype for ‘client_set_hidden’

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-05 12:13:08 +02:00
Anurag Priyam c654cfd8d2 unset hidden state when a client regains focus
This should be the expected behavior, imo.  Otherwise the client doesn't appear
in tasklist regardless of being focussed.

[Thanks Uli][1] :).

[1]: http://thread.gmane.org/gmane.comp.window-managers.awesome.devel/7096

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-05 12:09:39 +02:00
Uli Schlachter ba64f3c3cd client_focus_refresh: Always set input focus
Lua code can give the input focus to unfocusable clients. That means they have
nofocus set and they don't implement WM_TAKE_FOCUS.

Previously, the previously focused client continued getting input events in that
event. Now the last client is properly unfocused.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-06 12:24:34 +02:00
Majic 0e8fc995bb Minor readability fixes, STREQ()-like macros added
Signed-off-by: Julien Danjou <julien@danjou.info>
2011-11-18 17:56:21 +01:00
Uli Schlachter bf76b3842b Ungrab the server before parsing the config
This moves the loading of the rc.lua and managing of pre-existing clients to
after we ungrab the server during startup. To make sure we have no races with
clients which start up parallel to awesome, we do the QueryTree for all the
clients that we have to manage before the ungrab, but start managing the clients
only after the ungrab.

This means that we have already selected our event mask on the root window in
scan() and thus received an UnmapNotify event when we reparent windows into a
frame window. This has the effect that we immediately unmanage the client again,
whoops.

To fix this, we grab the server again and remove our event mask on the root
window again while we reparent.

This should hopefully fix all cases where we deadlock during startup because
pulseaudio wants to talk to the X server, but is being ignored because we have
the server grabbed while at the same time we are waiting for pulseaudio.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-19 15:11:11 +02:00
David Palacio db1610c7dc Desktop clients may not be visible on all tags.
Usually desktop clients are on a sticky state. If the client
is not sticky, only show on selected tags.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-04 20:24:39 +02:00
Gregor Best c2ea920ca0 remove encoding=utf-8 from modelines
This option is no longer valid in modelines, so it has been removed from
all modelines using the following shellscript:

    #!/bin/ksh

    git ls-tree -r HEAD | cut -f2 | while read f; do
        egrep -e '^(//|--) vim: .*encoding=' $f >/dev/null || continue
        sed -E -e '/^(\/\/|--) vim:/s/:encoding=utf-8//' $f > /tmp/foo
        mv /tmp/foo $f
    done

Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-11 17:34:09 +02:00
Arnaud Fontaine be7fda45d8 Update the code following release of xcb-util 0.3.8.
xcb-util is now split into several repositories since 0.3.8. This
release also cleaned up the API a lot, thus update the code
accordingly.

Signed-off-by: Arnaud Fontaine <arnau@debian.org>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-10 18:27:39 +02:00
Uli Schlachter af5e5e8e9c Remove a useless function argument
Both client_isvisible() and client_maybevisible() where almost exclusively
called with the client's screen as their second argument. Remove this second
argument and let these functions instead always act on the client's screen.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-27 20:07:14 +02:00
Uli Schlachter 244d19fd0e Stop doing per-screen banning
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-27 20:01:05 +02:00
Uli Schlachter b6baca5857 Client: Only emit property::{x,y,width,height} if necessary
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-11 17:21:00 +01:00
Uli Schlachter eff4474c6d Move size-hints handling to lua
The C core now completely ignores size hints and let's lua handle them.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-11 17:21:00 +01:00
Uli Schlachter dafcc68427 Send correct signals when c.name updates
When a client sets WM_NAME (client->alt_name) but doesn't set _NET_WM_NAME
(client->name), we give alt_name to lua when c.name is used. However, we still
emitted property::alt_name instead of property::name to lua. Obviously, this
breaks stuff.

(The same applies to client->alt_icon_name)

I noticed this via feh whose tasklist entry wasn't refreshed when multiple
images were displayed and I switched to the next one.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-10 17:04:26 +01:00
Uli Schlachter 659d949052 Tag clients more intelligently (FS#700)
Before this commit, c:tags(tags) and t:clients(clients) first removed all
tags/clients and then added the new one.

This is now changed into only removing the tags/clients that have to be removed
and leaving the others in place. Hopefully, this avoids all kinds of weird
issues which we had.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-18 14:21:37 +01:00
Uli Schlachter 6494540b0c Unban clients when they are focused
In commit 3dbf89c I removed a client_unban() in the code path for focusing
clients. The idea was that client focusing is now done after rebanning, so that
it should already be visible by the time this code is executed.

However, minimized clients obviously don't get unbanned, So we have to call
client_unban() here to make sure the client is unminimized.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-09 10:44:19 +01:00
Uli Schlachter b9c427d48f Fix another lua stack balance problem
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-10 15:07:07 +02:00
Uli Schlachter 8b16d1ee4b client_unfocus_update: Merge into client_unfocus
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-10 14:59:02 +02:00
Uli Schlachter 3dbf89c990 Lazyle set the input focus (FS#804)
Instead of immediately setting the X11 input focus when client.focus is assigned
something, we now just remember that we'll have to do something later. The focus
is then set in the next prepare call by libev (= after the current main loop run
is done).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-10 14:57:14 +02:00
Uli Schlachter f931af7ce1 Rename globalconf.client_focus to focus.client
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-10 14:46:56 +02:00
Julien Danjou fe43b99a2a client: remove prev_client_focus
Not sure it's good however.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-10-10 14:05:52 +02:00
Uli Schlachter af8fd15a8f client_unmanage(): Handle destroyed windows
When we receive a DestroyNotify, we have to unmanage the client. However, we
were just informed that the window was destroyed, so it doesn't make sense to
try to do "something" with the window.

This commits fixes some errors from the X server (which we ignored, but still
they are gone now).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-07 12:05:43 +02:00
Uli Schlachter 6826e5dfc4 Remove globalconf.colors
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 20:01:44 +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
Uli Schlachter aca253420d Make sure we set some required values on windows
All windows which use globalconf.default_depth must also have a backpixel,
borderpixel and colormap set when they are created. Without this, all these
xcb_create_window() calls would fail when globalconf.default_depth is no longer
the screen's default depth.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-30 14:43:58 +02:00
Uli Schlachter dfd95f1f72 Use the new defaults from globalconf
This makes all the code use the default colormap, depth and visual from
globalconf.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-30 14:43:58 +02:00
Uli Schlachter 368925beff Remove compatibility to image class
All the APIs that accept both an image and a cairo surface now only accept cairo
surfaces. Images are gone.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-29 19:35:59 +02:00
Uli Schlachter 36924247ca client: Use a surface for c:get_content()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-29 13:19:30 +02:00
Uli Schlachter 146a5dd67c Convert a client's icon to a cairo surface
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-29 13:18:35 +02:00
Uli Schlachter acc0ca624b Move window type from client_t to window_t
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-27 21:52:18 +02:00
Uli Schlachter 5b96d66634 client.content: Use p_new() instead of p_alloca() (FS#824)
alloca() allocates stack space. The image that we were producing is possibly
huge which means that we were asking for e.g. 9MiB of stack space. This is not
really a good idea and caused crashes.

Fix this by using heap memory instead.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-27 11:25:20 +02:00
Uli Schlachter bf3aa6d79e client: Stop using a_tokenize
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-02 19:19:01 +02:00
Uli Schlachter eae3e5b9c4 luaclass properties: Use C strings
This modifies the lua class code to use C strings instead of the tokens
generated via gperf.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-01 15:41:41 +02:00
Julien Danjou b5e5d1f2a0 client: emit object signals rather than class ones
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-26 18:15:19 +02:00
Uli Schlachter e0774377ca Sort all signal lists alphabetically
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-26 17:46:17 +02:00
Uli Schlachter 8cd4d53877 Add some signals that were previously missing
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-26 17:43:24 +02:00
Uli Schlachter ab4c151ed8 Add signals before using them
This commit makes it an error if an unknown signal is connected, disconnected or
emitted. All signals have to be added before they can be used.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-25 23:00:36 +02:00
Julien Danjou 63e4ba460b client: client_set_focus is static, so merge
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-18 10:50:40 +02:00
Julien Danjou 195dac628b client: client_unfocus is static
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-18 10:47:01 +02:00
Julien Danjou 80d1a4ea96 client: client_unfocus_update is static
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-18 10:46:42 +02:00
Julien Danjou 712234b133 client: use window attribute rather than invalid
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-18 10:44:58 +02:00
Julien Danjou bb54142746 client: macrotify property setter
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-18 10:39:55 +02:00
Julien Danjou 548e5441b1 ewmh: use client signals to call ewmh_update_net_client_list
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-18 10:38:17 +02:00
Uli Schlachter 85c97f45fd Revert "Don't call "focus" hook in client_focus()"
This reverts commit 27f9c0177a.

This commit broke code like the following because reading client.focus would
still return the previously focused client:

awful.client.focus.byidx(1)
if client.focus then client.focus:raise() end
2010-08-17 21:33:07 +02:00
Uli Schlachter 28de7741cd Remove globalconf.screen_focus
This moves the appropriate fields for client focus from screen_t to globalconf
since only the first screen's fields were used anyway.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-17 15:52:49 +02:00
Uli Schlachter 3b2f6329a9 Remove an unneeded argument to screen_getbycoord()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-16 14:25:12 +02:00
Uli Schlachter 6b2e4352bb Remove globalconf.xinerama_is_active
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-16 14:20:45 +02:00
Uli Schlachter 5d35771673 Save the screen in globalconf.
There can only be on xcb_screen_t now, so we can save it in globalconf.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-16 14:10:58 +02:00
Uli Schlachter 32d9a5b2ab Remove support for zaphod mode
This makes awesome support only a single X11 protocol screen. If you are still
using zaphod mode, you can run multiple instances of awesome on the single
screens, e.g.:

DISPLAY=:1.0 awesome & DISPLAY=:1.1 awesome &

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-16 13:47:40 +02:00
Uli Schlachter 27f9c0177a Don't call "focus" hook in client_focus()
Later on that call will be done through a FocusIn event.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-15 13:17:07 +02:00
Uli Schlachter ce814b4dbf Use globalconf.timestamp
This makes us use globalconf.timestamp instead of XCB_CURRENT_TIME in the places
where it makes sense.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-12 14:52:23 +02:00
Uli Schlachter 47caab4580 Always unban a client that we are trying to focus
Previously, if a client had nofocus == true, it wasn't unminimized if sth tried
to focus it. Also, if this client had the WM_TAKE_FOCUS protocol, the focusing
would fail since it's an error to set the input focus to an unviewable window.

For consistency, this also moves the code that sets a client's minimized
property to false into client_unban() since it doesn't make sense to have a
minimized client unbanned (i.e. visible).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-12 14:32:27 +02:00