Commit Graph

463 Commits

Author SHA1 Message Date
Uli Schlachter c218b1da72 Test and fix swapping clients
The code in luaA_client_swap() is incorrect, because
luaA_object_emit_signal() already pops the arguments to the signal.
Still, the code here tried to remove the arguments from the Lua stack
again, thereby corrupting the stack (removing more items than there are
in the stack).

Normally, popping more things from the stack than it has entries
silently corrupts the Lua stack. Apparently this doesn't necessarily
cause any immediate issues, because this code has been broken since nine
months and no one noticed. This mistakes was introduced in commit
55190646.

This issue was only noticed by accident. Thus, this commit also adds a
small integration test that exercises this bug. This test catches the
issue, but only on Travis, because there we are building our own version
of Lua 5.3 and that one has assertions enabled.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-29 09:34:45 +02:00
Uli Schlachter 259c4f716f Remove @release @AWESOME_VERSION@ everywhere (#1157)
It does not provide much value. The version number is already known to
ldoc globally in the "description" variable.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-09 22:36:20 +02:00
Uli Schlachter 06f02f6004 Delay client frame window destruction (#1148)
Daniel sees a short flicker of his wallpaper when he closes a client.
This happens because the window is destroyed immediately, but other
clients are re-arranged only shortly later. In the mean time, the X
server updates the display and repaints the root window (= wallpaper
becomes visible).

Work around this by delaying the destruction of frame windows to the end
of the current main loop iteration. This means that we first update the
position of all other windows and later destroy the window that was
actually closed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-07 00:46:57 +02:00
Emmanuel Lepage Vallee c214a9b111 doc: Document the client request::activate contexts 2016-10-04 01:00:55 -04:00
Daniel Hahler d513e2c4fc doc fixes for awful.{client,screen,tag} (#1134)
This adds a tparam alias "@screen" for "@tparam screen" (when used to
document e.g. arguments for callbacks), and "@screen_or_idx" when a
function accepts a "screen" or "number".
2016-10-02 16:03:11 +02:00
Uli Schlachter 19094de661 Speed up client_ignore_enterleave_events()
There are some situations where we do things that can make the mouse pointer
enter another window. We do not want to react to these "self inflicted" mouse
enter and leave events, because they aren't "real" (= generated by the user).

Before this commit, this is done by going through all windows and toggling the
"please send us enter and leave events"-bit on them. This becomes slower when
many windows are visible and floods the server with requests.

This commit changes this to a constant-time logic. Each event contains the
sequence number of the last request that the X11 server handled. Thus, we just
remember the right sequence numbers and ignore any events that comes in whose
sequence number falls into the ignored range.

In detail, we keep a list of "begin" and "end" sequence numbers and ignore any
enter and leave events that fall in this range. If we get any event with a
sequence number higher than "end", we remove this pair from the list, since it
is no longer needed.

To generate these pairs, we use a GrabServer request in
client_ignore_enterleave_events(). This gives us a sequence number and makes
sure that nothing else besides us can cause events. The server is ours! In
client_restore_enterleave_events(), we first do a NoOperation request to
generate the sequence number for the end of the pair and then do UngrabServer.
Any event that is generated after UngrabServer will have at least the sequence
number of the UngrabServer request and thus no longer fails between begin and
end.

Fixes: https://github.com/awesomeWM/awesome/issues/1107
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-30 09:37:55 +02:00
Uli Schlachter fcf6c863cd drawin_map: Ignore enter/leave after apply_moveresize
drawin_apply_moveresize() calls client_ignore_enterleave_events() internally,
because it also wants these to be ignored. This means that the code disables
enter/leave events twice and then enables them twice. This recursive disabling
is something that should not occur.

Fix this by having drawin_map() disable the events a bit later.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-30 09:37:55 +02:00
Uli Schlachter 93ed7fd46f client_geometry_refresh(): Ignore enter/leave events less
This commit makes the function only call client_ignore_enterleave_events() when
it actually has to. Since we expect that most of the time, no client's geometry
is changed, this means that most of the time this function is not called.

Fixes: https://github.com/awesomeWM/awesome/issues/1107
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 14:37:07 +02:00
Uli Schlachter baaff93a73 Only configure client geometries once per main loop iteration
This should "protect" the user from some stupidities that Lua code might be
doing that e.g. makes a client jump to another position and then immediately
back to where it was before. Only the last change in a single main loop
iteration will actually have any effect.

Original idea by Daniel here: https://github.com/awesomeWM/awesome/pull/174

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-15 18:48:56 +02:00
Uli Schlachter dd1d81a3ac client.c: Use AREA_EQUAL()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-15 18:36:34 +02:00
Uli Schlachter 8283a12ec9 Only export a single refresh function for clients
We still need client_focus_refresh() as a separate entry point, because it is
used by event.c.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-15 18:31:29 +02:00
Uli Schlachter bc6d06a305 Remove an unnecessary variable
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-15 18:29:56 +02:00
Uli Schlachter 4d9bbf0ba6 Remove an obsolete argument to client_resize_do()
Thanks to Java being broken, the function always sends a notice anyway.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-15 18:28:46 +02:00
Emmanuel Lepage Vallée 587cc530c7 Merge pull request #1067 from BlueUsername/tiling-to-floating-window-fix
Fix a bug moving between a tiled and a floating screen.
2016-09-07 16:20:20 -04:00
Emmanuel Lepage Vallee e29a2d3ac9 client: Add property::tags
It is useful for rules debugging.
2016-09-04 02:52:16 -04:00
blueusername 9ca57a8364 Fix a bug moving between a tiled and a floating screen.
Check if any of the window is on the screen it is moved to, not just
the topmost leftmost edge.

Signed-off-by: blueusername <blueusername@github>
2016-09-02 20:15:00 +01:00
Emmanuel Lepage Vallée 08e4c304cd client: Fix a potential crash due to a race condition. (#1055)
If raise was called from the awful.rule `manage` callback at
startup with a client already present it crashed due to a
buffer underflow.
2016-08-30 12:59:45 +02:00
Daniel Hahler 63c8a310d0 doc: fix missing parenthesis with client examples (#1046) 2016-08-20 18:59:01 +02:00
Uli Schlachter 128933c115 Correctly disable RandR if it provides no usable data (#1012)
Fixes: https://github.com/awesomeWM/awesome/issues/1003
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-31 16:52:44 +02:00
Uli Schlachter bdfc0c0d71 screen: Mention the property::geometry signal in the docs
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-24 16:33:06 +02:00
Uli Schlachter 311a41b646 screen: Add old geometry as argument to property::geometry
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-24 16:32:12 +02:00
Uli Schlachter 338064ae96 screen: Add old workarea as argument to property::workarea
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-24 16:29:56 +02:00
Daniel Hahler d9cd0a4f0e Merge pull request #948 from psychon/deprecate-add-signal
Deprecate add_signal
2016-06-07 22:58:14 +02:00
Uli Schlachter 231436d9e3 C: Remove unneeded calls to signal_add()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-04 17:57:08 +02:00
Uli Schlachter 3d2c877762 Add a function for faking screen move 2016-06-04 17:39:51 +02:00
Uli Schlachter e5f9ec4723 C code: Move docs for signals away from signal_add()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-04 17:39:14 +02:00
Uli Schlachter a569487ba2 Merge branch 'dev_fix_desktop' of https://github.com/schmellow/awesome 2016-06-04 16:01:17 +02:00
Mikhail Schemelev 0befee6dfa Attempt at better handling of NET_CURRENT_DESKTOP property.
NET_CURRENT_DESKTOP is now being set to the index of the tag with currently focused client.
In case of no focused clients present, first selected tag index is taken, with fallback value being 0.
Current desktop is updated on next client signals: focus, unfocus, tagged, untagged.
Current desktop is also updated on tag property::selected signal.

This should fix drag and drop issues with chrome-based applications on multihead setups
2016-06-04 16:42:54 +03:00
Daniel Hahler 4e35d1fdd7 objects/screen.c: fix warning about unused var: "found" (#943) 2016-06-04 01:38:44 +02:00
Uli Schlachter 270baeb153 "Fix" client properties which can be absent (#932)
A client c could have no c.machine or no c.pid because the corresponding
properties are not set on its window. Previously, the C code would return an
empty string or 0 for these values. This commit makes the C code give Lua no
value instead (not even a nil).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-04 00:51:23 +02:00
Uli Schlachter 0b64c8987d Remove unused argument to systray_request_handle()
It always had the value NULL.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-29 14:33:23 +02:00
Emmanuel Lepage Vallee b8920c2a7a doc: `for s, screen do` -> `for s in screen do` 2016-05-15 23:44:09 -04:00
Emmanuel Lepage Vallee dafd29f2a3 awful.wibox: Rename to awful.wibar
Why:

 * Two different (but related) concepts had the same name
 * Users were confused for years on IRC
 * The wibar name was already in use in some doc to avoid confusion
2016-05-15 17:17:12 -04:00
Emmanuel Lepage Vallee 43ef623dc6 client: Add x, y, width and height properties 2016-05-15 17:15:55 -04:00
Uli Schlachter 992b03d8d2 struts: Avoid an integer underflow
Fixes #900
2016-05-15 17:15:55 -04:00
Uli Schlachter 959913dcd2 Merge branch 'fix_window_type_fallback' of https://github.com/psychon/awesome 2016-05-15 16:39:33 +02:00
Uli Schlachter 15cb1daff8 Merge branch 'workarea-change-on-wibox-move' of https://github.com/psychon/awesome 2016-05-15 16:15:45 +02:00
Uli Schlachter 394ff06589 Fix mouse clicks on titlebars (#901)
Commit 7dad0b3b87 made awesome only ask for mouse events on the actual
client window. Obviously, this means that we no longer get reports for clicks on
the titlebar. Whoops.

Fix this by asking for mouse events on *both* the actual client window and the
frame window. The passive grab on the actual client window is actually unneeded,
but we keep it so that the fix that was done by the above commit is still
present (xev will no longer report leave/enter events just for a mouse click).

Since we now get mouse events inside of a client reported twice, the event
handling code in event.c has to be fixed to handle both cases. E.g. x/y are
relative to the top-left corner of the window and thus needs to be fixed for
titlebar size; the second click has to be ignored.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-14 16:16:24 +02:00
Uli Schlachter cbdf403637 Fix fallback for the window type
EWMH specifies that

   If _NET_WM_WINDOW_TYPE is not set, then managed windows with WM_TRANSIENT_FOR
   set MUST be taken as [_NET_WM_WINDOW_TYPE_DIALOG].

We implement this by forcing a window's type to be "dialog" when it has a
WM_TRANSIENT_FOR property. For windows that have a _NET_WM_WINDOW_TYPE property,
this type change is then later undone. However, when a window changes its
WM_TRANSIENT_FOR property during runtime, then we would set its type to "dialog"
unconditionally.

This commit fixes this by explicitly tracking if we found a _NET_WM_WINDOW_TYPE
property on the window and only applying the fallback if we did not find such a
property.

Fixes-one-of-the-sub-issues-from: https://github.com/awesomeWM/awesome/issues/889
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-14 14:10:27 +02:00
Uli Schlachter 11553b931e Update workarea when drawin moves to another screen
Fixes: https://github.com/awesomeWM/awesome/issues/892
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-14 13:13:20 +02:00
Uli Schlachter 64f3677c96 Fix screen.fake_add()
Commit 8a6787bd54 added screen.fake_add(). Commit 08845c7a4b made us cache a
screen's workarea in the struct screen_t. This new member needs to be
initialized to the screen's geometry when a new screen is added. Since both
these commits were developed concurrently, the workarea was not initialized in
screen.fake_add().

Fix this by calling in fake_add() the helper function added in 08845c7a4b.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-09 19:22:21 +02:00
Uli Schlachter 208327bed0 Merge branch 'superflous-enter-leave' of https://github.com/psychon/awesome 2016-05-09 18:42:04 +02:00
Uli Schlachter c62da0dcc7 Merge branch 'fake-screen2' of https://github.com/psychon/awesome 2016-05-09 18:40:50 +02:00
Uli Schlachter 7dad0b3b87 Grab buttons on the child window
Since commit 102063dbbd, awesome is a reparenting WM. That means that we put our
own frame windows around child windows. This means that we have the option of
grabbing input events on the frame window or the child window. This commit chose
the frame window for this.

For keyboard events, this decision was already reverted in 532ec0cd90. This
commit does the same thing for mouse events.

This fixes the spurious leave/enter events that were visible on mouse clicks.
They occurred because the click activated a passive grab (all mouse events now
"belonged" to awesome). This passive grab caused the X server to inform clients
that they "lost" the mouse pointer (with the detail field set to "a grab
activated").

Fixes: https://github.com/awesomeWM/awesome/issues/427
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 17:30:01 +02:00
Uli Schlachter 08845c7a4b Cache a screen's workarea
Instead of computing the workarea whenever some Lua code asks for it, it is now
remembered explicitly as a property on a screen. This allows us to only emit
property::workarea if the workarea actually changed.

Fixes: https://github.com/awesomeWM/awesome/issues/756
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 16:30:37 +02:00
Uli Schlachter 8a6787bd54 Add functions for faking screen additions and removals
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 14:51:33 +02:00
Emmanuel Lepage Vallée d497cdf081 Merge pull request #875 from psychon/sn-fix
Startup-Notification fix
2016-05-08 01:03:16 -04:00
Uli Schlachter 697a88958e client_manage: Check for _NET_STARTUP_ID on WM_CLIENT_LEADER
Apparently the spec allows to set the _NET_STARTUP_ID value on the property that
WM_CLIENT_LEADER points to instead of the window itself. Thus, if we don't find
a _NET_STARTUP_ID on the window itself, check again on the client leader window.

Apparently GTK even does this (for whatever reason...)...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-05 18:29:35 +02:00
Emmanuel Lepage Vallee d50acedb35 drawin: Hide from ldoc
This object should not be used directly by the vast majority
of users.
2016-05-03 17:12:54 -04:00
Uli Schlachter 8ca65cbc26 Update screen geometry and outputs on changes
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-01 10:09:26 +02:00
Uli Schlachter 66ad236d2e Clean up after a removed screen
When a screen is removed, we have to update screen.primary (if it was the
removed screen) and assign a different screen to all clients which were on the
removed screen.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-01 10:09:26 +02:00
Uli Schlachter dceb532d26 Re-add duplicate screen removal
An earlier commit removed this code (back when it was still part of
screen_add()).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-01 10:09:26 +02:00
Uli Schlachter 080609f6ec Add a screen checker.
A client cannot be used any more after it was unmanaged. Similarly, Lua
shouldn't be allowed to e.g. assign a client to a screen that was removed. This
commit adds such a checker which "breaks" all screens which are not in the
global screen list.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-01 10:09:26 +02:00
Uli Schlachter b651373cda Stop restarting on RandR changes
This commit adds a "removed" signal to screens. Together with the "added" signal
that we have since a while, this allows the C code to update the list of
available screens dynamically without needing to restart.

So far, this code received only minimal testing. So far, I don't have a nice
idea on how to easily test this...

Closes: https://github.com/awesomeWM/awesome/issues/672
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-01 10:09:26 +02:00
Uli Schlachter 8de8df1415 Move call to xcb_randr_select_input into screen.c
The code in screen.c should decide about this kind of thing.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-01 10:09:26 +02:00
Uli Schlachter cba8655ca8 Switch to a more specific nvidia binary blob work-around
We once had the problem that with the nvidia blob, the X11 server told us that
"yes, I do support RandR; there is just a single big screen" even though there
were multiple screens and they could be queried for via Xinerama. To work around
this, we started to ignore RandR if it only provided information about a single
screen.

Our long-term goal is to stop restarting on RandR screen changes. Thus, even if
only a single screen is defined during startup, we should still use RandR later
when another screen is added. This means that we cannot just ignore RandR if it
only mentions a single screen.

This commit copies what GTK+ does: If there is an output named "default", then
some compatibility layer is assumed and we ignore RandR.

I have no way to test if this really does the right thing.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-01 10:09:26 +02:00
Uli Schlachter ebe86e32d7 Restructure the way screen_scan() works
Instead of adding all screens directly to globalconf.screens, the individual
"scanner functions" now get a screen_array_t as their argument and add the
screens there. Also, they no longer emit the "added" signal themselves (through
screen_add()), but the caller does now does this instead once all screens are
found.

This commit drops the "deduplication" of screens. This likely means that clone
mode causes duplicate screens. This will have to be re-added later.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-01 10:09:26 +02:00
Emmanuel Lepage Vallee e54387904b client: Add request::geometry
Remove request::fullscreen and request::maximized_* and use
a single request for them. The other client resizing features
will soon also start to use this.
2016-04-20 00:11:04 -04:00
Emmanuel Lepage Vallee 9991f9ccc8 geometry: Use the relevant rounding functions instead of integers
In the case where one want to put the cursor at the middle of the
workarea, it is logic to do:

   x=screen.workarea.x+screen.workasrea.width/2

However, this can cause floating points. This commit move the
burden back to the C-API so the Lua placement code doesn't have
to add a large number of rounding methods. Given 1 type of rounding
cover a vast majority of use cases for each types of coordinates,
the C-API can take care of it in peace. For the other corner cases,
it is still possible for the Lua code to do the rounding there, but
no longer necessary. The convenstions are:

 'x' and 'y': use round (move to the closest point)

 'width' and 'height': use ceil (to avoid involontary truncating)
2016-04-18 04:20:22 -04:00
Uli Schlachter d46e11f5e1 Add range-checking to lots of arguments in the C code
This change catches things like c:geometry { width = -42 }.

Helps-a-bit-with: https://github.com/awesomeWM/awesome/pull/820 (fixes X errors)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-18 04:20:22 -04:00
Uli Schlachter 3e75e800ad Fix build warning
Commit c543f59696 introduced the following warnings:

objects/screen.c:307:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
objects/screen.c:307:1: warning: no previous prototype for ‘screen_scan_randr_monitors’ [-Wmissing-prototypes]

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-15 19:38:09 +02:00
Kirill A. Shutemov c543f59696 screen: XRandR 1.5 support
XRandR 1.5 adds support for the new monitor objects.

'Monitor' is a rectangular subset of the screen which represents a
coherent collection of pixels presented to the user. Each Monitor is be
associated with a list of outputs (which may be empty).

The patch below matches 1:1 screens in AwesomeWM with XRandR's Monitors.
This way I get one screen across my 4K monitor, which is represented by
two CRTCs.

Background info: http://keithp.com/blogs/MST-monitors/

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2016-04-13 02:31:37 +03:00
Emmanuel Lepage Vallee bfccd1c467 luaobject: Make the miss_handlers documentation private
As the code is now reliant on a single implementation, it cannot
be replaced by the users anymore without breaking Awesome.
2016-04-11 23:54:28 -04:00
Emmanuel Lepage Vallee 7772386f23 tag: Add better documentation 2016-04-11 23:54:28 -04:00
Emmanuel Lepage Vallee 643e35af22 tag: Use the new property ldoc syntax 2016-04-11 23:54:28 -04:00
Emmanuel Lepage Vallee 1bbdbc7053 screen: Add more documentation 2016-04-11 23:54:28 -04:00
Emmanuel Lepage Vallee eb133175ba awful.screen: Add some client getter properties 2016-04-11 23:54:28 -04:00
Emmanuel Lepage Vallee 5927c1ceed screen: Update the documentation 2016-04-11 23:54:28 -04:00
Emmanuel Lepage Vallee 5655521ec3 client: Use the new @property and @beautiful tags.
Also improve the documentation.
2016-04-11 23:46:10 -04:00
Daniel Hahler ae17c66e27 Merge pull request #798 from blueyed/fix-crash-in-screen_getbycoord
Fix crash in screen_getbycoord without any screens [ci skip]
2016-04-04 20:34:12 +02:00
Uli Schlachter b643279e4a Fix crash in screen_getbycoord without any screens
Ref: https://github.com/awesomeWM/awesome/issues/793#issuecomment-205245346
2016-04-04 20:13:27 +02:00
Daniel Hahler 449974ca61 luaA_checkscreen: display number of existing screens with error
This is meant to be helpful in the case of 0 existing screens, e.g.
during executing the config initially.
2016-04-04 20:04:19 +02:00
Daniel Hahler 3ad0a9d8d2 Merge pull request #780 from psychon/screen-add-signal
Add screen add signal
2016-04-03 18:35:08 +02:00
Emmanuel Lepage Vallee 8a09ef707a Fix an ldoc mistake 2016-04-02 04:08:24 -04:00
Uli Schlachter 2432dda3e3 screen: Add "added" signal
This signal is emitted when a new screen is added.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-03-27 10:51:28 +02:00
Uli Schlachter 611cd7c2d8 Remove luaA_pushscreen
It's just an alias for luaA_object_push().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-03-26 18:13:55 +01:00
Uli Schlachter 5ccdb933bf C-API: Return screen objects instead of indicies
This commit makes all C code that previously returned a screen index now return
a screen object, continuing the deprecation of screen indicies. Note that this
is an API break and will likely cause all kinds of problems for users.

The change also breaks some tests which are suitably fixed in this commit.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-03-26 18:09:24 +01:00
Daniel Hahler c5526ca336 Merge pull request #746 from psychon/indexless-screen-iteration
Indexless screen iteration
2016-03-07 00:26:22 +01:00
Uli Schlachter 93e50b2e23 Merge branch 'lua-index-handlers' of https://github.com/psychon/awesome 2016-03-06 14:19:00 +01:00
Uli Schlachter 0a39459605 Add a non-index way to iterate over screens
This is a preparation for getting rid of screen indices.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-03-06 14:05:28 +01:00
Emmanuel Lepage Vallee 167f5e2821 drawin: Use numbers rather than integers
This solve issues when using wibox with `awful.placement`
2016-03-04 02:43:19 -05:00
Daniel Hahler 4ba8386f7b Merge pull request #715 from psychon/lazy_border_update
Lazily apply changes to border_width and border_color
2016-02-28 22:16:32 +01:00
Daniel Hahler 87a3233be8 Merge pull request #713 from psychon/no_focus_window
Make client key bindings for e.g. xeyes work again
2016-02-28 22:16:22 +01:00
Daniel Hahler d1f43d895f Merge pull request #710 from psychon/primary-screen
Primary screen
2016-02-28 22:16:03 +01:00
Daniel Hahler 43f485b6cf Merge pull request #707 from psychon/bullet_proof_transient_for
Bullet proof transient_for
2016-02-28 22:09:04 +01:00
Uli Schlachter ee7a41370f Lazily apply changes to border_width and border_color
Fixes: https://github.com/awesomeWM/awesome/issues/592
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-28 16:24:30 +01:00
Uli Schlachter aae960e99e Make client key bindings for e.g. xeyes work again
Instead of focusing the root window, we now create a "focus window" inside of
our frame window. This window is placed so that it is not visible, but we can
grab key bindings on it to simulate the window having the input focus.

Fixes: https://github.com/awesomeWM/awesome/issues/699
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-28 13:29:25 +01:00
Uli Schlachter b02b2f7956 Fix screen index by output name
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-27 16:45:43 +01:00
Uli Schlachter 2027dd8b02 Correctly set globalconf.primary_screen under RandR
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-27 16:45:35 +01:00
Uli Schlachter 110893d9cb Add screen.primary
Right now this just always returns the first screens, but this can easily be
implemented properly later.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-27 15:44:25 +01:00
Uli Schlachter a2301ae8f3 Add and use luaA_pushscreen()
Even when a screen is just an integer, the code becomes a bit more
self-documenting. Even better, if we start to handle screen objects to Lua
instead of screen indicies, there will only be one place that needs to be
changed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-27 10:57:07 +01:00
Uli Schlachter d598a4115a Update transient_for when a new window appears
When we manage the transient before the main window, the client object's
.transient_for property would stay nil. This happens because the property points
to a window which we don't know (yet) and thus is ignored.

Fix this by remembering the value of WM_TRANSIENT_FOR and checking in
client_manage() if the new client is the "missing window we did not find
before".

Fixes: https://github.com/awesomeWM/awesome/issues/181
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-22 21:09:25 +01:00
Uli Schlachter 9907f804b2 Refactor setting of c->transient_for
This creates a new helper function for setting the transient_for property of a
client. This is a preparation for a following commit. No behaviour changes
intended.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-22 21:02:47 +01:00
Uli Schlachter 976b03f8a7 Don't modify WM_HINTS in client_set_urgent()
To quote from ICCCM (§4.1.2): "The window manager will not change properties
written by the client."

We tried to do this anyway to update WM_HINTS so that the current urgency state
is reflected. Apparently, Chrome does a similar read-modify-set cycle and the
resulting race condition meant that the "accepts input" hint on Chromium's
window was permanently disabled.

This helps with https://github.com/awesomeWM/awesome/issues/670, but I still
think that Chrome shouldn't try to implement "please don't focus me when I do
the following" by temporarily claiming "please don't ever focus me".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-16 19:31:20 +01:00
Uli Schlachter d09ece6b5a Require "integer" instead of "number" in more places
E.g. trying to press mouse button 1.5 via root.fake_input() doesn't make sense.
Previously the code silently truncated the number to an integer. Now it
complains about this instead.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-06 13:59:14 +01:00
Uli Schlachter 051d0de85f Replace many pushnumber calls with pushinteger
The only remaining calls are for a window's opacity and in the DBus type
handling. Everything else wants integers, not something with a comma.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-06 13:46:46 +01:00
Uli Schlachter cd63cabadd Always send ConfigureNotifies
ICCCM specifies when the WM has to send a ConfigureNotify. Java does not care
and wants one all the time. Meh.

Fixes: #248
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-04 18:21:25 +01:00
Uli Schlachter ad4c62e639 Fix warnings from ldoc
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-30 10:43:41 +01:00
Emmanuel Lepage Vallée d202c1f1c2 Merge pull request #629 from Elv13/upstream_dynamic_p1
client: Add swapped, raised and lowered signals
2016-01-18 16:40:07 -05:00
Emmanuel Lepage Vallee 55190646c4 client: Add swapped, raised and lowered signals
This allow layout "arrange" to be called less often and react on
the cause of the change itself rather than it's consequences
(usually, the "focus" signal).

Previously, the layout were re-arranged everytime the focus changed.
Now, with "raised" and "lowered", it require less "arrange".

"swapped" allow smarted layouts. Currently, swapped cause a full
re-arrange. It re-read the "index" list from scratch and create
a "new" layout. With "swapped", incremental layout changes are
possible.

Fixes https://github.com/awesomeWM/awesome/issues/616
2016-01-18 01:29:31 -05:00