Commit graph

550 commits

Author SHA1 Message Date
Uli Schlachter
68691ff818 Check that the Lua stack is empty in the main loop
The Lua stack is a finite resource and everything that pushes something there
should also clean up. This is not a problem for functions that are called by
Lua, because their "stack frame" is freed when they return. However, in global
context, Lua does not and cannot automatically clean up for us. Thus, it makes
sense to print a warning in this case.

(Additionally, this cleans up the stack if something is left)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-17 18:40:01 +01:00
Uli Schlachter
4ad516c63a Remove some unused fields from globalconf
These fields were only ever written to since commit 19137a55c3.
This commit removes the fields and the code that sets them.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-22 17:25:45 +01:00
Lukáš Hrázký
ea94f7f7e6 add an option to set the preferred client icon size
_NET_WM_ICON contains a list of icons and until now, the first one was
picked without regard to it's size. This adds a global option to set
the preferred icon size. When getting the client icon, the best size
match is picked. The size can be set via
awesome.set_preferred_icon_size() and the default is 0, which will pick
the smallest non-zero size icon available.

Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
2015-12-07 22:59:32 +01:00
Uli Schlachter
6ca85af53b Set WM_CLASS and WM_NAME on all our windows (#551)
The only exception is the window for _NET_SUPPORTING_WM_CHECK. That window
already had a _NET_WM_NAME property before and doesn't get a WM_NAME property in
this commit. I just decided for myself that it doesn't need one. :-)

Right after startup with the default config we now have the following situation:

$ xwininfo -root -tree

xwininfo: Window id: 0x2d7 (the root window) (has no name)

  Root window id: 0x2d7 (the root window) (has no name)
  Parent window id: 0x0 (none)
     7 children:
     0x200011 "Awesome drawin": ("awesome" "awesome")  1500x20+0+0  +0+0
     0x200010 "Awesome drawin": ("awesome" "awesome")  1x1+0+0  +0+0
     0x20000d "Awesome drawin": ("awesome" "awesome")  100x30+0+0  +0+0
     0x20000a "Awesome no input window": ("awesome" "awesome")  1x1+-1+-1  +-1+-1
     0x200009 "Awesome systray window": ("awesome" "awesome")  1x1+-1+-1  +-1+-1
     0x200008 "awesome": ("awesome" "awesome")  1x1+-1+-1  +-1+-1
     0x200007 "Awesome WM_Sn selection owner window": ("awesome" "awesome")  1x1+-1+-1  +-1+-1

One of those drawin is the awful.wibox. Another drawin is created by awful.menu.
I guess that the third one is created by awful.tooltip, but I'm not sure. Wow,
so many windows...

Closes https://github.com/awesomeWM/awesome/pull/556.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-19 22:23:25 +01:00
Uli Schlachter
33f8a06594 Document "--replace" better
This adds it to the output of "awesome -h" and translates the version in the man
page to italian. Thanks, eri_trabiccolo for the translation!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-10-11 15:00:08 +02:00
Daniel Hahler
0478b946fb Merge pull request #513 from psychon/WM_Sn_selection
Various selection stuff that ICCCM requires us to do.

Fixes https://awesome.naquadah.org/bugs/index.php?do=details&task_id=782.
Fixes https://github.com/awesomeWM/awesome/issues/292.
Closes https://github.com/awesomeWM/awesome/pull/513.
2015-10-11 13:30:32 +02:00
Uli Schlachter
7ed29196bb Make awesome.quit() during startup work
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-10-10 22:25:56 +02:00
Uli Schlachter
f6e633eee4 Add a --replace argument
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-10-10 22:19:22 +02:00
Uli Schlachter
19111121ce Check if WM_Sn is already owned before acquiring it
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-10-10 22:12:25 +02:00
Uli Schlachter
86313e0afd Send an event after we acquired the WM_Sn selection
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-10-10 22:06:41 +02:00
Uli Schlachter
e824f8f30d Exit when we loose the WM_Sn selection
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-10-10 21:59:12 +02:00
Uli Schlachter
5a17b3978c Acquire the WM_Sn selection during startup
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-10-10 21:51:04 +02:00
Uli Schlachter
2f78ec5b30 Never explicitly focus the root window
Whenever client.focus == nil, we set the input focus to the root window to
express "nothing has the input focus". However, thanks to the way X11 input
works, this means that whatever is under the mouse cursor gets keyboard input
events. This can easily be reproduced with urxvt and some small addition to the
config to unfocus things.

This commit changes things. Instead of focusing the root window, we create a
special "no focus" window that gets focused if we want nothing to have the
focus.

Closes https://github.com/awesomeWM/awesome/pull/470.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-28 23:36:23 +02:00
Daniel Hahler
4aa6c33951 awesome_atexit: keep client order always
This is not only useful for soft restarts, but also when TERMinating
awesome during development/testing.

The drawback appears to be that it would leak a property on the root
window in case it is really meant to be quit.

Closes https://github.com/awesomeWM/awesome/pull/374.
2015-07-30 01:04:05 +02:00
Uli Schlachter
c945492176 Keep client order across restarts
This saves the order of clients in a property called AWESOME_CLIENT_ORDER on the
root window during shutdown. During startup, after managing all existing
windows, we force the client list into the order described by this property
(overwriting any changes that Lua possibly did).

This code should safely handle cases where the property doesn't contain all
existing clients or contains a client which doesn't exist anymore.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-27 13:47:09 +02:00
Uli Schlachter
86e242b983 Keep stacking order across restarts
ReparentWindow puts the window at the top of the stacking order. Thus, we have
to reparent clients back to the root window in the stacking order.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-07-27 13:47:09 +02:00
actionless
cec04b2684 Add DPI support and 'xresources' theme
This makes awesome respect DPI settings, and adds a new theme based on
xrdb and xsettingsd color settings ("xresources").

Closes https://github.com/awesomeWM/awesome/pull/229
2015-06-25 06:40:38 +02:00
Daniel Hahler
3b366f993c Make stdout/stderr line buffered
This improves the behaviour with print()ing for debugging, when the
output is redirected to a file.

I was using `setbuf(…, 0)` initially, but it makes sense to buffer it
per line.  This uses `setvbuf` instead of `setlinebuf`, which might not
be available everywhere.

Closes https://github.com/awesomeWM/awesome/pull/267
2015-06-20 13:05:25 +02:00
Peter Junos
19137a55c3 Support for XKB - changing keyboard layouts
This commit adds support for writing in prompt (<Super>+R by default)
while different keymap is selected

Signed-off-by: Peter Júnoš <petoju@gmail.com>
2015-05-28 23:20:17 +02:00
Aleksey Fedotov
996f6785a8 xkb: implementation of keyboard layout switched
This patch provides functions to get/set current keyboard layout.

Current implementation doesn't support any configuration of layout,
it's a merely a layout indicator and switcher, however layout
configuration can be set by tools like setxkbmap or by any third-party
tools.
2015-03-03 00:33:16 +03:00
Uli Schlachter
6adeafdec3 Test if cairo-xcb is usable during startup
Create a pixmap of size 1x1 and a cairo-xcb surface for this pixmap. If the
surface ends up in an error state, awesome will refuse to start.

This turns a "awesome is unusable and prints lots of errors on X11 servers where
the root window has a depth of 8bpp and no one knows where exactly the problem
is" into "awesome refuses to start on such X11 servers and prints an error that
helps Uli to say immediately what the problem is".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-02-18 21:23:47 +01:00
Daniel Hahler
6183d8587a Merge pull request #118 from blueyed/fix-proper-activate-via-rules
Properly fix activating an "invisible" client via rules
2015-02-14 20:55:04 +01:00
Uli Schlachter
fd1b6b15cc Remove superflous xcb_flush() call (Issue #108)
Some lines down we are calling awesome_refresh(). That function already calls
xcb_flush() for us.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-02-14 15:43:00 +01:00
Uli Schlachter
006b43cb6f awesome: Add startup signal
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-02-14 15:41:11 +01:00
Daniel Hahler
76ede0ef45 Revert "awful.rules.execute: use delayed_call for emitting request::activate"
The 'request::activate' signal should be sent and handled immediately,
and not delayed.  It was too much of a hack to work around the client
not being visible.

Instead, the "is visible" constraint on `capi.client.focus` will be
removed.

This reverts commit 6963ede3dc.
2015-02-14 14:30:04 +01:00
Daniel Hahler
6963ede3dc awful.rules.execute: use delayed_call for emitting request::activate
This is a followup to commit 90fde13, which caused the client not to be
visible during the request::activate callback.

This requires an initial call to `awesome_refresh` before the main loop
to get `awesome.startup` right.

Ref: https://github.com/awesomeWM/awesome/commit/90fde139#commitcomment-9308225
2015-02-10 09:35:53 +01:00
Uli Schlachter
27988ecdde Remove titlebars from clients during shutdown (FS#1159)
This reparents all clients back to their proper position during shutdown, so
that their top-left corner is now where their titlebar's top-left corner was.
Hopefully, this fixes floating clients moving around across a restart.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-11 10:42:45 +01:00
Uli Schlachter
e5120e1bec Hide globalconf.L
Everything that needs the lua_State should create a local variable like this:

  lua_State *L = globalconf_get_lua_State();

This ensures that the compiler warns if there are two variables with name "L" in
scope. The idea here is that it should become harder to accidentally use the
global lua state instead of the state of the current state.

While writing this commit, I found another place that gets its wrong: Reading
client.focus from a coroutine was broken, since it was returning the result on
the main thread instead of the current one.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-12-06 11:56:58 +01:00
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
d8b73de739 screen.[ch]: Move into objects/
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-30 15:12:47 +02: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
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
Uli Schlachter
6c4668cb49 scan(): Use less iterations for scanning for windows
There isn't much of a point in doing all the GetGeometry requests in an extra
run through the list. This commit merges it into the previous loop through all
windows.

This means that we now request some information during startup that we never
actually need, but I can live with that just fine.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-15 11:48:32 +01:00
Uli Schlachter
202567dc12 Improve fatal signal handling
First, we reset the signal handler back to the default one when a fatal signal
is received. This should make sure that we never get into an endless loop where
the signal handler causes the signal to happen again.

Then this commit also makes awesome print a backtrace on more signals than
before. Crashing with a backtrace is always better than without. ;-)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-07 10:51:39 +01:00
Uli Schlachter
9e9366950e Measure the time a main loop iteration takes
This commit makes awesome measure how long all the event handling takes. That
is, this measure the time between waking up from poll and going to sleep again.
If that time is above 0.1 seconds, we print a warning and increase the limit for
this warning to the last duration to avoid flooding messages.

This should help figuring out cases were people do stupid things in their
config, like synchronously contacting an IMAP server and getting the number of
unread mails.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-07 10:39:49 +01:00
Uli Schlachter
65a6febaf5 Improve the check for another window manager
We detect other WMs when we fail to request SubstructureRedirect on the root
window. Previously, the code used an unchecked request and then tried to
cleverly detect if an error occurred. This isn't needed.

Instead, we now use a checked request and use xcb_request_check() to see if any
errors were generated. This also gets rid of a round-trip to the server (one is
still implicitly done by xcb_request_check()).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-01 17:29:00 +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
6a669a8775 Print libxcb error codes for broken connections
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-11-16 11:28:27 +01:00
Uli Schlachter
efd243b6d7 event: Handle MotionNotify before ButtonPress/Release (FS#1136)
The above-mentioned bug report says that a window cannot be moved via its
titlebar if you move the move quickly while clicking.

The reason for this was awesome's "event compression": We don't handle all
MotionNotify events, because they can come in big quantities. Instead, we only
want to handle the latest one and ignore all earlier ones (the mouse isn't in
that position anymore anyway).

The problem now appears if a MotionNotify is moved across a ButtonPress event
and the ButtonPress is what should cause the window to be moved. Awesome first
handles the ButtonPress event normally and starts grabbing mouse input. Then,
our event loop feeds us with an old MotionNotify event in which the button was
not pressed yet. The code for moving clients gets a motion event in which no
mouse button is pressed, concludes that the move is done and ungrabs the mouse
again, even though the button is still physically pressed.

Fix this by making sure that MotionNotify events are never moved across
ButtonPress or ButtonRelease events. We already did this for EnterNotify and
LeaveNotify events for similar reasons.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-10-06 10:40:57 +02: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
9b78733922 Fix possible deadlock during startup
For setting up the wallpaper, awesome needs a second connection to the X11
server (isn't SetCloseDownMode just great?).

However, it was possible to have a dead-lock with our main connection due to
this. Awesome does a GrabServer during startup so that nothing else can use the
X11 server while we set ourselves up. The server is ungrabbed right before the
lua config is read. However, nothing makes sure that this ungrab request really
is sent to the server instead of just waiting in xcb's output buffer.

The dead-lock would now happen if we try to establish a second connection to the
X11 server before the ungrab request was flushed on the main connection. The
server will wait for the ungrab on the first connection, awesome is waiting for
the second connection to be successfully established.

Fix this by making sure the UngrabServer request is flushed before parsing the
config file.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-10-04 10:01:03 +02:00
Uli Schlachter
aaa771f887 Switch from libXcursor to libxcb-cursor
Thanks to Michael Stapelberg, there is now a xcb-only port of libXcursor which
does everything we need. This patch switches awesome over to that new library.

Since the only reason for using XOpenDisplay() instead of xcb_connect() was so
that we can use libXcursor, we can get back to that older state again. This
means that this effectively reverts the following commits:

531f8b415c "Added initial support for Xlib cursor themes"
77243cd09a "Add x11-xcb to the pkg-config checks"
779d43fc46 "Don't let Xlib own the event queue"
03759b4847 "Fix keyboard layouts"

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-19 16:48:10 +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
03759b4847 Fix keyboard layouts
Commit 08ca70c00d added support for Xlib cursor themes by making awesome use
Xlib for its X11 connection and for setting cursor icons. Everything else was
still done through xcb.

However, an unexpected side effect of this is that Xlib enabled the XKB
extension without asking us. This changes the way that keyboard events are
reported which causes problems with various keyboard events.

(Normally, Xlib hides these things by silently fixing up the events that it
hands out to applications. However, since we bypassed Xlib via xcb...)

The fix is simple: Luckily Xlib provides a function for disabling its XKB
support which is just what we need.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-01 23:06:08 +01:00
Uli Schlachter
0b6b3bb458 Correctly handle focus across restarts (FS#1055)
X11 is a great protocol. When a window manager dies, it can make sure that
client windows don't get destroyed via the save-set. However, revert-to-parent
focus handling means that the focus now shifts to the parent which gets
destroyed and afterwards the focus is "none", which is a really bad state.

Fix this in two places:

First, when shutting down, we switch to PointerRoot mode. This makes sure that
the input focus follows the mouse pointer if no window manager is started.

Also make sure that we set the input focus the way we want it to be after start
up. This obviously cleans up any weird state which might exist before we manage
the input focus.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-13 20:31:18 +01:00
Uli Schlachter
ea30119410 Use glib instead of libev
This commit ports awesome from libev to the glib main loop. This means that
awesome has fewer dependencies, because we were already depending on glib before
and now no longer need glib.

However, the main reason for this change is that, thanks to lgi, we have glib
bindings for lua. This means that lua code can add all kinds of event sources to
the main loop (timeouts, fd watchers, SIGCHLD watchers, ....). Yay

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-21 21:01:12 +01:00
Uli Schlachter
37d074f881 Drawin: Re-add shape support
Commit 03e0ee53d2 removed window shapes, because at the time I was too
lazy to port them from the old image system to oocairo.

This commit re-adds them, but for now only as a way to set the shape.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-05 18:11:16 +01:00
Uli Schlachter
779d43fc46 Don't let Xlib own the event queue
Since commit 531f8b415c, we are using Xlib for our X11 connection. However,
we still use XCB for event processing. This means we actually have to tell Xlib
to leave all events alone.

This might fix FS#1047. Perhaps.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-24 15:22:52 +02:00
Tumin Alexander
531f8b415c Added initial support for Xlib cursor themes
I hope this time i got all right with git format-patch.

Signed-off-by: Tumin Alexander <iamtakingiteasy@eientei.org>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-07 12:39:56 +02:00
Uli Schlachter
9fef3dd07c Move some helper functions to draw.h
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-07-29 15:25:40 +02:00
Uli Schlachter
36329f9fa6 Print signal number while dying
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-07-15 00:18:06 +02:00
Uli Schlachter
f7aa4b5969 Use ARGB visuals by default again (FS#837)
My intel driver no longer is broken with ARGB visuals, so let's enable this by
default again. Let's see how long it takes for someone else to hit a broken
driver and complain. :-)

This reverts commit c7da695e10.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-11 20:17:52 +02:00
Uli Schlachter
f9d7ac595c Add root.wallpaper() for querying the wallpaper
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-07 21:32:45 +02:00
Uli Schlachter
2354c6a623 Signal config errors via a naughty popup
If loading of any config file fails, awesome will now remember the error message
and make it available to lua. The default config is modified to open a naughty
popup on errors.

This should help all those people who modify their config and then wonder why
there change is ignored, not noticing awesome's error message on stderr.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-23 17:36:19 +02: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
Uli Schlachter
1801a8be46 Add a define for the root window's event mask
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-19 15:08:54 +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
10186a7a29 "Handle" events during startup (FS#877)
awesome.c contains this comment:

    There can be no events yet, so if his function returns something, it must be
    an error.

Sadly, this wasn't true. It seems like something managed to generate
MappingNotify events (no idea how).

Fix this by discarding all pending events after our GrabServer, but before we
ask for SubstructureRedirect on the root window.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-10 14:28:34 +02:00
Chris Newton
471babcc70 Added a flag to the exit signal
This boolean can be used to differentiate between restarts and exits.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-21 07:41:41 +01:00
Uli Schlachter
4ee86fc5e4 Make ./awesome -a work
Some time ago I added a --no-argb option with the short-hand version -a.
However, the short version didn't actually work. Whoops!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-19 20:02:41 +01:00
Uli Schlachter
7898cc7de7 Properly die when the X server dies
When the X connection breaks for whatever reason, awesome wouldn't properly
exit, but go into a busy loop instead. Fix this by dying when our connection to
the X server dies.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-11-13 22:29:05 +01:00
Uli Schlachter
c7da695e10 Use the screen's default visual by default again
Seems like there are enough bugs in the X server that one can't really use a 32
bit visual. Looks of repaint errors. :(

This should somehow be fixed properly before release. For now, this just swaps
the default behavior and the "--no-argb" behavior.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-21 18:18:29 +02:00
Uli Schlachter
e7cd824c07 Ignore changes to the root pixmap
We no longer use the root pixmap at all, so we can ignore changes to it.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-10 15:10:04 +02:00
Uli Schlachter
3bfcf4594e Event handling: Don't reorder mouse handling
For performance reasons, we only handle the last motion notify we receive.
However, we must make sure that the motion isn't moved after enter or leave
notifies. Else, breakage is ensured!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 21:14:10 +02:00
Uli Schlachter
9deafe68c8 Font: Remove, oopango took over the job
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 20:09:17 +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
37bb1e088f Add 'awesome --no-argb'
If awesome is started with that flag, it won't use ARGB visuals. Theoretically,
this shouldn't be necessary, but it seems like this triggers bugs in the X
server. (Or is it just my server that doesn't like me?)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-05 22:37:33 +02:00
Uli Schlachter
894e59eac8 Revert "Revert "Use an ARGB visual if one is available (FS#829)""
This reverts commit 2452747e04.
2010-10-04 09:26:47 +02:00
Uli Schlachter
371536a396 Create a temporary window for globalconf.gc
We don't have any window with globalconf.depth yet at this point, so we have to
create one just for setting up our GC.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-04 09:26:47 +02:00
Uli Schlachter
2452747e04 Revert "Use an ARGB visual if one is available (FS#829)"
This reverts commit 643ec85117.
2010-09-30 20:56:58 +02:00
Uli Schlachter
643ec85117 Use an ARGB visual if one is available (FS#829)
With this commit, awesome prefers ARGB visuals over the screen's default visual.
This means that all our (visible) windows now can get an alpha channel that a
compositing manager can use for producing transparent windows.

The reason why this is done is to fix a bug. We are reparenting clients into
other windows. If one of these client window uses an ARGB visual, its
transparency would have no effect.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-30 14:43:58 +02:00
Uli Schlachter
8ea94154a6 Associate our default GC with the systray window
The window that is specified when a GC is created is used for two things. First,
it specifies which protocol screen the GC should be associated with. Second, it
specifies for which color depth the GC is valid.

Due to this second property, we have to use the systray window instead of the
root window. The systray window uses globalconf.default_depth.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-30 14:43:58 +02:00
Uli Schlachter
cbf9bbd66a screen_default_visual(): Move to awesome.c
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-30 14:43:58 +02:00
Uli Schlachter
eef3fdb452 Add variables for tracking some X11 defaults
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-30 14:43:54 +02:00
Uli Schlachter
6ff0263072 Stop trying to use named colors
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-10 11:31:02 +02:00
Uli Schlachter
03e0ee53d2 Wibox: Remove shape support
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-30 10:22:50 +02:00
Uli Schlachter
16286f0b75 Use a single gc for all graphics operation
The GC isn't really used, we just need one because X11 wants one.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-17 15:44:44 +02:00
Uli Schlachter
cb550e59f7 Remove the now pointless struct root_win_t
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-16 14:14:15 +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
9ab8cd4039 Set our event mask on the root window later
This moves the setting of the event mask after scan() so that we won't receive
any events from scan()'s activity (especially no UnmapNotifies which would cause
us to lose clients).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-11 11:54:30 +02:00
Uli Schlachter
84526dd630 Select our events on new after the reparent
Together with the previous commit, this makes us not lose clients across
restarts any more.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 13:33:08 +02:00
Uli Schlachter
58bb601658 Stop using most of libxcb-event
Upstream removed most of the code from libxcb-event and there is no
event-related stuff left in this library. We now no longer use any of the parts
that were removed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-08 17:35:48 +02:00
Uli Schlachter
c20e88fdce Avoid some round-trips on startup
This makes awesome prefetch some of the data it needs during startup to avoid
some useless round-trips to the server.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-07 13:31:20 +02:00
Uli Schlachter
e9c2907488 Don't manually unban all windows on exit
The last commit made sure the X server does this for us instead. No need to do
that work twice.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-14 21:37:07 +02:00
Uli Schlachter
0517b0002f Don't reparent systray windows on exit
Since the last commit, systray windows will automatically be reparented by the
X11 server. This means we no longer have to do this ourselves.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-14 17:42:53 +02:00
Uli Schlachter
5c232572a3 Check for UNMAPPED instead of UNVIEWABLE
A window is unmapped if it is not mapped (oh noes! ;). If it is mapped, it can
be either mapped or unviewable. If any of its ancestors is unmapped, it's
unviewable, else it's unmapped

Since this code looks at children of the root window, it should never be seeing
clients which are unviewable (can one unmap the root window at all...?). What
this really wants to check for is unmapped, so this patch implements this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-03-29 17:47:28 +02:00
Julien Danjou
e3ba851692 spawn: disable signalfd in libev
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-11-14 09:55:29 +01:00
Julien Danjou
31552f2122 font: remove draw_ prefix in names
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-27 12:16:22 +01:00
Julien Danjou
3ce7638e0f window: rename to xwindow
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:05 +02:00
Julien Danjou
371ee3e8cc titlebar: remove
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:05 +02:00
Julien Danjou
e204473dfc client: move into objects
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:05 +02:00
Julien Danjou
6b426b1da1 globalconf: move argv out
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:04 +02:00
Julien Danjou
4c178d5441 hooks: remove
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:04 +02:00
Julien Danjou
67b66a8d62 awesome: fix memory leak with confpath
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-08 12:01:07 +02:00
Uli Schlachter
3d69f38e45 awesome_atexit(): Clean up libev's state
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-04 16:32:00 +02:00
Uli Schlachter
e1d6f0a150 Disconnect from the X server after closing lua
Else stuff like this can happen:

  Invalid read of size 4:
    at 0x300280BB7F: (within /usr/lib/libxcb.so.1.1.0)
    by 0x300280BD21: xcb_get_extension_data (in /usr/lib/libxcb.so.1.1.0)
    by 0x300280A55A: xcb_send_request (in /usr/lib/libxcb.so.1.1.0)
    by 0x300C604A4F: xcb_render_free_picture (in /usr/lib/libxcb-render.so.0.0.0)
    by 0x300B24C4BB: (within /usr/lib/libcairo.so.2.10800.8)
    by 0x300B22F1B6: cairo_surface_finish (in /usr/lib/libcairo.so.2.10800.8)
    by 0x300B22F234: cairo_surface_destroy (in /usr/lib/libcairo.so.2.10800.8)
    by 0x300B218124: (within /usr/lib/libcairo.so.2.10800.8)
    by 0x300B212750: cairo_destroy (in /usr/lib/libcairo.so.2.10800.8)
    by 0x42E4D0: wibox_wipe (draw.h:110)
    by 0x42E568: luaA_wibox_gc (wibox.c:46)
    by 0x3008E0CB15: (within /usr/lib/liblua5.1.so.0.0.0)
  Address 0x4e56ec0 is 20,928 bytes inside a block of size 20,992 free'd
    at 0x4A0761F: free (vg_replace_malloc.c:323)
    by 0x40F974: awesome_atexit (awesome.c:97)
    by 0x410316: main (awesome.c:577)

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-04 16:31:58 +02:00
Brian Gianforcaro
3145e3145e Grammar/spelling corrections in comments and docs.
Signed-off-by: Brian Gianforcaro <b.gianfo@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-31 10:39:36 +02:00