Commit Graph

5973 Commits

Author SHA1 Message Date
Uli Schlachter e7fbbf47e5 Fix client_apply_size_hints()
The bit that indicates that the base size is set is
XCB_ICCCM_SIZE_HINT_BASE_SIZE. However, instead this code checked
XCB_ICCCM_SIZE_HINT_P_SIZE which is set to indicate how the initial window
position is chosen. So we were checking the complete wrong bit. Whoops...

Fixes: https://github.com/awesomeWM/awesome/issues/456

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-06 21:34:34 +01:00
Uli Schlachter 9b5ab994b0 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-11-06 21:33:54 +01:00
Kazunobu Kuriyama abf7d1546c Fix the definition of A_STRNEQ_CASE
Replace A_STRCASEEQ whose definition is not given anywhere with A_STREQ_CASE.

Closes https://github.com/awesomeWM/awesome/pull/488.
2015-11-06 21:32:49 +01:00
Uli Schlachter de8fd4ffd4 Handle enter/leave events with detail=Inferior correctly
There is a client window C. Around this window, awesome adds a frame window F.
When the pointer is inside of C and then moves inside of F, we get a LeaveNotify
with detail=Inferior, but from our point of view, the pointer is still inside of
C, because F is contained in C.

Similarly, if the pointer is in F and moves to C, we get an EnterNotify with
detail=Inferior that we should ignore. However, for an EnterNotify the pointer
can now be inside of a titlebar, so this case has to be handled now.

The above explains the enter/leave behavior for clients. Let's now think about
titlebars: When the pointer moves from C to F, it cannot be in any titlebar any
more, so we must generate a leave event on that titlebar. Similar when the
pointer moves from F to C, but in this case we also have to figure out which
titlebar now contains the pointer.

This patch makes the code handle these events with detail=Inferior correctly.

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

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-06 21:30:52 +01:00
Uli Schlachter a638310e89 Fix compilation
This fixes a bad cherry-pick from commit db087fdda7.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-06 21:29:27 +01:00
Uli Schlachter ac72f8e5a0 Fix enter/leave events on titlebars
This adds a global variable that tracks the drawable that is currently under the
mouse cursor. This new variable is then used so that we get consistent behavior
for enter/leave signals. Such signals are now also generated when a MotionNotify
event tells us that the pointer is now in a different titlebar.

Before this, it was possible that we did not generate a leave event on a
titlebar since the LeaveNotify contains the cursor position after the leave and
we did not manage to figure out which titlebar was left.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-11-06 21:28:47 +01:00
Uli Schlachter f320cc74d0 Force systray redraw on BG color change
This commit makes awesome track the current background color of the systray
window. When Lua applies another color, a redraw of all icons is forced.

Fixes: https://github.com/awesomeWM/awesome/issues/359
Closes: https://github.com/awesomeWM/awesome/pull/402

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-29 18:26:34 +02:00
Daniel Hahler d37cc7e9df 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-08-29 18:20:28 +02:00
Uli Schlachter db087fdda7 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-08-29 18:18:34 +02:00
Uli Schlachter 0412acfdc0 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-08-29 18:18:21 +02:00
Daniel Hahler 581ccc80ad cmake: s/ESCAPE_QUOTE/ESCAPE_QUOTES
This appears to be the correct name for 2.8.12 [1] already, but CMake
3.2.3 complains loud(er) now.

1: http://www.cmake.org/cmake/help/v2.8.12/cmake.html#command:configure_file
2015-08-29 18:08:28 +02:00
Daniel Hahler 925e6ecc17 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-08-29 18:07:10 +02:00
Uli Schlachter 4c517cf9d3 Screen __index: Don't turn argument into a string
Calling lua_tostring() on a number/integer, turns that stack slot into a string.
This patch changes the code to only call lua_tostring() if the function argument
really is a string.

This partly also caused https://github.com/awesomeWM/awesome/issues/238.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-29 18:05:57 +02:00
▟ ▖▟ ▖ 84f09d9c69 awful.menu: update t new layout api
Apparently the style to get the direction of a wibox.layout.* changed
from calling get_dir to just accessing the attribute dir.
2015-08-29 18:01:00 +02:00
Heiko Becker 00d466204f awesomeConfig.cmake: Allow setting AWESOME_DATA_DIR
The motivation behind this patch is my distro moving to a multiarch
layout. While binaries, libraries, etc. are are installed into
/usr/{host}/{bin,lib,...} architecture-independent data should still
go to /usr/share.
2015-08-29 17:59:28 +02:00
Daniel Hahler 2efc09d103 tag.lua: add "property::icon_only" signal
Thanks @NormalRa for the patch.

Fixes #138.
2015-08-29 17:59:05 +02:00
Uli Schlachter c03ee8ab36 Ignore more events while minimizing a client
When minimizing a client, we temporarily ignore events for the client window (so
that we don't get the UnmapNotify event that we are causing for the unmap) and
for the root window (I don't actually know why, no "harmful" events should be
caused...).

However, we weren't ignoring events on the frame window itself. This commit
fixes that oversight.

The problem here is that the pointer could be inside the window that is being
minimized. When we then unmap said window, the pointer will now be inside of the
frame window and the X11 server will thus generate an EnterNotify. When we
handle this event later on, we emit mouse::enter on the client and e.g. the
default config then focuses this client, which undoes the minimization.

This fixes a regression introduced in commit 3aeac3870c and fixes #92.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-02-28 22:58:57 +01:00
Uli Schlachter 89fd49f48c a_dbus_message_iter: Handle DBUS_TYPE_DOUBLE
Fixes #78 on GitHub.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-17 19:44:59 +01:00
Uli Schlachter 635223b5fe 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:44:18 +01:00
Uli Schlachter 3113fee2ee change codename
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-10 20:36:35 +01:00
Uli Schlachter 53b0f946d8 awful.mouse.finder: Remove rounded_corners call
Let's just quote a mail I received from Rastislav Barlik:

I tried to make use of awful.mouse.finder but I found out that it's not working
as supporting functions rounded_corners were removed with commit
03e0ee53d2.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-10 20:29:57 +01:00
findkiko 87230862d5 Vim style menu navigation in addition to arrow keys
Is there a reason it shouldn't be on by default? I'm not familiar enough with the code-base to tell if it will clash with anything.
2015-01-10 12:57:09 +01:00
Uli Schlachter 02be8943db Unmap minimized clients
Because ICCCM pretty much mandates that minimized (aka "iconic") clients are
unmapped. In detail: To go back to normal state, the client should map its
window and for this to work, the window needs to be unmapped.

Thanks to Oleg Shparber for reporting some issue he had with a self-written Qt
program and for providing a simple and short test case.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-10 01:01:05 +01:00
Uli Schlachter a44b3a2daf 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-12-10 19:02:17 +01:00
Uli Schlachter ed3d0489ce Implement icon_pixmap and icon_mask from WM_HINTS (FS#1297)
Fun fact: ICCCM specifies that icon_pixmap must have depth 1. Xterm uses a
pixmap with depth 24. Yay... As such, I don't have any test for the depth == 1
case and will just assume that it does the right thing. If it doesn't, I bet no
one will notice anyway.

Signed-off-by: Uli Schlachter <psychon@znc.in>

Conflicts:
	property.c
2014-12-07 14:16:55 +01:00
Uli Schlachter f4a7b2d73a Don't move clients on ConfigureRequests (FS#1030)
I never saw a single program that set a border on its own windows. However,
awesome commonly sets borders on its clients and the position of a client is the
part outside of the border. So when processing a position request from a client,
we also have to include this border and fix things up correspondingly.

However, the same isn't needed for the client size, because the size does not
include the borders, but just the titlebar plus the "real" client content.

Thanks to Daniel Hahler for providing a simple test case based on urxvt for
debugging this!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-12-05 18:42:35 +01:00
Emmanuel Lepage Vallee 1f431384cb layouts: Allow layouts to be invoked with fake data
This patch allows 2 things to be done:

* Write unit test to validate layouts using fake clients and tags
* Query the current layout geometry from another tag

The advantages of the former are clear and simple. Those of the later include:

* Creating a screenshot of another layout
* Display the layout wireframe in the tag list (like KDE2-3, Gnome2)
* Having and 'ALT-tab' like visual popup for tags
2014-11-09 00:09:24 +01:00
Emmanuel Lepage Vallee ed93b497b6 tag.delete: Do not reset client tag when unnecessary 2014-11-09 00:08:22 +01:00
Emmanuel Lepage Vallee 94cbc200ed tag: Improve tag property::index support (FS#1229)
* Move the "index" setting burden to individual functions
  instead of gettags().

* Add some properties earlier so the signal hooks will be called
  with valid data.
2014-11-09 00:08:03 +01:00
Emmanuel Lepage Vallee b0ede3108e Add context to request::activate signal 2014-11-09 00:07:38 +01:00
Emmanuel Lepage Vallee f637265334 awful.tag.update: Fix identical tag set detection
If the "current" table is empty, then identical always true.
There is a lot of case where this can happen. Mostly when using
dynamic tagging.
2014-11-09 00:06:36 +01:00
Uli Schlachter c4eb4b1f23 wibox.layout.base.rect_to_device_geometry: Fix for "weird" rotations
The old code transformed the top-left and bottom-right corner of the rectangle
to device space and calculated a rectangle based on these two points. However,
if you rotate a rectangle by 45°, these two points will be directly above each
other and thus the old code would calculate a width of 0.

Fix this by transforming all four corners of the rectangle into device space and
calculating a rectangle based on this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-10-11 13:31:10 +02:00
Uli Schlachter f236a5f0c7 drawin_update_drawing: Remove optimization for invisible drawins
This fixes the following code:

   local d = drawin({})
   d.visible = true

The drawin now has a cairo surface assigned

   d.visible = false
   d.width = 1234
   d.visible = true

The width change while the drawin was not visible would not get propagated to
the drawable because of the code that this patch removes. The expectation was
that drawin_map() would update the drawable later.

However, because the drawin was already visible, its drawable also already has
a surface assigned. Thus, drawin_map() wouldn't update the drawable either.

Fix this by just removing this optimizations.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-10-11 13:30:33 +02:00
Uli Schlachter 6673ecb167 drawin: Don't special-case moves
The code in drawin_moveresize() tries to be clever and only updates the drawing
state of the drawable when it is resized, not when it is moved around. This used
to be necessary because once upon a time, drawin_update_drawing() threw away all
of the drawing state and thus forcing a repaint. These days it just calls
drawable_set_geometry() as well and that function special-cases moves.

So this old code in drawin_moveresize() is no longer necessary and actually
caused problems.

These problems occurred because drawin_update_drawing() is being clever and
doesn't do anything for .visible = false drawins, because their drawing state
will be updated once they become visible. However, not skipping
drawable_set_geometry() means that this broke, because drawin_map() thought that
the drawing state was up to date while in reality it wasn't.

References: http://article.gmane.org/gmane.comp.window-managers.awesome/10852
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-10-11 13:30:32 +02:00
Uli Schlachter 03b432cdff awful.widget.button: Override :set_image() to do the right thing
Reported-at: http://article.gmane.org/gmane.comp.window-managers.awesome/10778
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-09-15 14:01:54 +02:00
Evžen 7a812fe28d fix(lib.awful.taglist): multiple tag selection
multiple tag selection wasn't highlighting properly when *_occupied is set in theme table
2014-08-24 13:31:07 +02:00
Jason Yan 3c5a1d44e2 Fix check against clients in taglist. 2014-08-24 13:30:59 +02:00
Uli Schlachter e211190234 systray: Only register/unregister when needed
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-24 13:30:16 +02:00
Uli Schlachter 9846a3274a systray: Only intern the atom once
Let's just save the systray atom and keep it around. Why should we redo this
every time this atom is needed?

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-24 13:30:12 +02:00
memeplex aec8e2944a Fix for FS#1293
FS#1293 - Systray won't show with margin layout

https://awesome.naquadah.org/bugs/index.php?do=details&task_id=1293&project=1&order=dateopened&sort=desc
2014-08-24 13:30:00 +02:00
Uli Schlachter 19252f87fe wbox: Make :find_widgets() easily accessible
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-24 13:29:58 +02:00
Sindre Føring Devik a74b3fccaa FS#1278 - Menubar should check all standard directories
Added local desktop directory to list of directories parsed by menubar
by using the XDG specification
2014-08-24 13:29:32 +02:00
Uli Schlachter 4073f8d886 Call AllowEvents after grabbed events on a drawin
When we get an event due to a previous GrabButtons call, we have to continue
normal event processing again, because the server froze the input device for us.
Without this, everything appears to freeze.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-21 10:42:23 +02:00
Uli Schlachter 160eba9384 change codename again
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-11 11:07:10 +02:00
Uli Schlachter dbfe624f67 awful.tag.setscreen: Check if old_screen == new_screen
Setting a tag's screen to what it already is shouldn't have any bad effects.
However, this code messed up the tag order and selection status.

Fix this by returning early if the tag already has the right screen.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-09 22:05:48 +02:00
Uli Schlachter ca92846bb2 awful.tag.move: Fix tag index setting
Since commit 9c69e857ed, awful.tag.setscreen() unsets a tag's index to make
sure things end up in a sane order on the new screen. Thus, the call to
setscreen() removed the "index" property that tag.move just set.

Fix this by setting the index after the screen.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-09 22:05:47 +02:00
Uli Schlachter 7ec72862d6 gears.surface: Handle the cache more intelligently
It doesn't make sense for surface.load_uncached() to load a file without
inserting into the cache. The next "cached" load will have to load it again.

So move cache insertion into surface.load_uncached() and the only thing that
surface.load() does differently is checking if we have a suitable cache entry
before calling load_uncached().

So load_uncached() does the cache insertion and load() reads from the cache.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-09 21:57:30 +02:00
Uli Schlachter 76ab008b3e naughty: Don't use the cache when loading icons (FS#1253)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-09 21:50:12 +02:00
Emmanuel Lepage Vallee c2fff5396d Make sure gears.color.create_png_pattern are being repeated 2014-04-08 22:58:16 +02:00
Emmanuel Lepage Vallee 9b872f4bce Move 'surface_size' to gears.surface and make it public 2014-04-08 22:54:09 +02:00