Commit Graph

401 Commits (48fd6416c667bc7f5e7e48271d7fb3e24f8b6a7f)

Author SHA1 Message Date
Michael Stapelberg 091f1db39a run clang-format (3.5.0)
Not quite sure why there are so many differences. Perhaps we’ve gotten
out of the habit of running clang-format after every change.

I guess it’d be best to have a travis hook that runs clang-format for us
and reports any problems on pull requests.
2015-03-01 17:16:03 +01:00
Michael Stapelberg 5cf1a0c43b Merge pull request #1462 from carrotIndustries/netwm_moveresize
Support _NET_WM_MOVERESIZE
2015-02-11 20:30:05 +01:00
Lukas K 1c5ab5fa36 Support _NET_WM_MOVERESIZE
Add support for the _NET_WM_MOVERESIZE client message. This message
enables clients to initiate window moving or resizing. Toolkits like
Gtk3 use this message when the user drags a client-side decorated window
by its title bar. When Gtk detects that the window manager does not
support this client message, it uses a slow fallback implementation.

fixes #1432
2015-02-11 00:07:28 +01:00
Tony Crisci c815fc798d Handle button release events
This enables the --release switch on mouse button bindings.
2015-02-10 17:46:02 -05:00
Tony Crisci 8d031bfbf8 Handle _NET_CLOSE_WINDOW client message requests
> Pagers wanting to close a window MUST send a _NET_CLOSE_WINDOW client
> message request to the root window.

We interpret this message as a request to close the con for the given
window.

See: http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#idm140200472668896

fixes #1396
2014-11-17 09:08:42 +01:00
Tony Crisci 344f6be84a Handle WM_CLASS changes
http://tronche.com/gui/x/icccm/sec-4.html

> The WM_CLASS property (of type STRING without control characters)
> contains two consecutive null-terminated strings. These specify the
> Instance and Class names to be used by both the client and the window
> manager for looking up resources for the application or as identifying
> information.

i3 processes changes to WM_CLASS by updating the cached property and
running assignments. This allows the property to be used in criteria
selection.

fixes #1052
2014-07-15 09:18:40 +02:00
Tony Crisci 0514be8d4b Handle EWMH requests to change current desktop
This request is used by pagers and bars to change the current
desktop likely as a result of some user action. We interpret this as
a request to focus the given workspace.

for more information see:

http://standards.freedesktop.org/wm-spec/latest/ar01s03.html#idm140251368135008
2014-07-10 22:39:42 +02:00
Tony Crisci 136b3e345b Handle WM_CHANGE_STATE requests for iconic state
http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.4

 > IconicState - The client's top-level window is iconic (whatever that
 > means for this window manager). The client can assume that its
 > top-level window is not viewable, its icon_window (if any) will be
 > viewable and, failing that, its icon_pixmap (if any) or its
 > WM_ICON_NAME will be displayed.

For these requests, we just close the window.

fixes #1279
2014-06-24 09:39:12 +02:00
Tony Crisci ca5137eeba remove unneeded render on map request
manage_window() will call tree_render() when appropriate, so pushing
changes to X here is not needed.
2014-06-24 09:32:14 +02:00
Tony Crisci e77103012f remove unneeded render on unmap
tree_render() will call x_push_changes(), so calling it afterward is not
needed.
2014-06-24 09:32:04 +02:00
Michael Stapelberg 3f5a0f0024 Switch to xcb-xkb and libxkbcommon
This removes our last dependency on Xlib! :)

(Okay, an Xlib dependency still comes in through other libraries that we
 link against, but it’s not us. Our code is simpler by this change and
 uses one less connection to X11.)
2014-06-21 19:10:37 +02:00
Michael Stapelberg 4c06e7a573 clang-format-3.5 **/*.h **/*.c
This should be the last commit that formats a big bunch of files. From
here on, whenever I merge patches, I’ll run clang-format like described
in the title.
2014-06-19 11:20:32 +02:00
Michael Stapelberg 9200094203 format **/*.c with clang-format-3.5
This has multiple effects:

1) The i3 codebase is now consistently formatted. clang-format uncovered
   plenty of places where inconsistent code made it into our code base.

2) When writing code, you don’t need to think or worry about our coding
   style. Write it in yours, then run clang-format-3.5

3) When submitting patches, we don’t need to argue about coding style.

The basic idea is that we don’t want to care about _how_ we write the
code, but _what_ it does :). The coding style that we use is defined in
the .clang-format config file and is based on the google style, but
adapted in such a way that the number of modifications to the i3 code
base is minimal.
2014-06-15 19:07:02 +02:00
Tony Crisci 8ece995001 Bugfix: prevent unneeded render on pointer enter
When `focus_follows_mouse` option is on, prevent an uneeded render on
pointer enter when the con is already focused.

This pointer enter might be caused by entering a window decoration of an
already-focused container.

This extra render can cause concurrency issues when focus is set
asynchronously with WM_TAKE_FOCUS.
2014-06-11 09:38:49 +02:00
Tony Crisci 22b4215d92 Feature: improve active window request handling
Allow client requests of type _NET_ACTIVE_WINDOW to switch workspaces if
they indicate they are a pager. Otherwise, set the urgency hint on that
con to indicate that something happened.

This allows task switchers like skippy-xd to work properly.

http://standards.freedesktop.org/wm-spec/latest/ar01s03.html#idm140251368127856
2014-05-03 15:57:43 +02:00
Marco Hunsicker 00ee86de79 Send IPC window events for focus and title changes
This patch fixes ticket #1168 to extend the window IPC event mechanism
to send IPC events for window focus and title changes. The newly added
window events use the same format as the already established "new"
event.

Specifically this patch:

* Moves the ipc_send_window_event() function from src/manage.c into
  src/ipc.c and adds an argument for the change property of the event
* Updates src/manage.c to use the new function signature. To ensure
  that the "new" event does not send the same event data as the
  "focus" event, setting focus now happens after the "new" event
  has been sent
* Adds IPC focus event notification to src/x.c. To workaround a problem
  during window close when accessing the window name, a function has been
  added to query whether a window is actually attached to its parent. To
  avoid obsolete focus notification, a new field has been added to keep
  track of the focus without any interference by the click handling
* Adds IPC title event notification to src/handlers.c. To avoid
  obsolete title notification, a function has been added to determine
  whether a window title has actually changed
* Updates the IPC documentation to include the new events
* Updates testcases/t/205-ipc-windows.t to include the "focus" event
  in order to ensure the correct event sequence
* Adds two new unit tests, b/testcases/t/219-ipc-window-focus.t and
  b/testcases/t/220-ipc-window-title.t to ensure proper "focus" and
 "title" events
2014-02-26 22:24:19 +01:00
Peter Boström 9c15b9504e Fix clang -Wextra except -Wunused-parameter.
Cleared all warnings that occur when passing
CFLAGS="-Wall -Wextra -Wno-unused-parameter" to make using clang 3.3 on
Linux x86-64.
2014-01-02 22:15:33 +01:00
Michael Stapelberg 85321bdf1d Bugfix: ignore _NET_ACTIVE_WINDOW for scratchpad windows (Thanks mistnim)
fixes: #1136
2013-12-21 21:32:23 +01:00
Tony Crisci 05e46848f0 Reply to _NET_REQUEST_FRAME_EXTENTS correctly
Reply to _NET_REQUEST_FRAME_EXTENTS by settings _NET_FRAME_EXTENTS
property of the window to widths of the respective borders added by i3.

fixes #1093
fixes #1069
2013-10-09 19:49:37 +02:00
Michael Stapelberg 1a1d421534 Bugfix: correctly recognize assigned windows as urgent (Thanks jookia)
fixes #1086
2013-09-24 07:47:36 +02:00
Michael Stapelberg 93463bc393 Bugfix: update root geometry on output changes for “fullscreen global” (Thanks kaersten)
fixes #1064
2013-08-30 19:59:57 +02:00
Kacper Kowalik (Xarthisius) 0b168ee499 Include float.h for DBL_EPSILON
https://bugs.gentoo.org/show_bug.cgi?id=480272

Patch was written by Jeroen Roovers <jer@gentoo.org>
2013-08-08 22:37:27 +02:00
Michael Stapelberg 0c7a76c2f1 Handle the _NET_REQUEST_FRAME_EXTENTS ClientMessage (java compat)
This ClientMessage can be used to estimate how big the window will be
before opening it. Java always sends the ClientMessage and checks the
atom that should be set by the window manager, but it seems that the
fallback code path has a race condition.

Let’s see if the situation gets better with this change. I have been
running this patch for about two weeks and have not seen any issues with
it.

fixes #934
fixes #709
2013-07-27 15:06:08 +02:00
Michael Stapelberg f55b7977e8 Store aspect_ratio instead of weird proportional_{width,height} (Thanks phillip)
This commit only goes to “next” because I am not sure whether it
actually makes things better in all cases and want to give it some
testing first.

There was no documented reason behind using the
proportional_{width,height} variables, so I suppose that code was just
stupidity on my part (it was written merely a month after I started this
project in 2009).

fixes #1032
2013-06-29 23:11:54 +02:00
Diego Ongaro 96575e14a0 Give layout enum a name: layout_t 2013-05-22 19:35:07 +02:00
oblique 8a4a719093 Add support for _NET_WM_STATE_DEMANDS_ATTENTION.
_NET_WM_STATE_DEMANDS_ATTENTION indicates that some action in or with
the window happened. It's a weaker hint than urgency flag of WM_HINTS,
but some applications and almost all Qt applications use it instead of
WM_HINTS' urgency flag (one example is Skype).
2013-03-09 10:55:13 +01:00
Marius Muja bfd150872d Fixing continuous resize bug in floating mode
fixes #910
2013-01-24 12:42:13 +01:00
Michael Stapelberg 36b106a9d3 Bugfix: Ignore ConfigureRequests for scratchpad windows (Thanks MeanEYE)
fixes #898
2012-12-22 14:08:11 +01:00
Sascha Kruse d8a036d776 mark parents of urgent container also as urgent 2012-09-22 19:31:34 +02:00
Simon Elsbrock 28104a480c implement delayed urgency hint reset
If there is a client with an urgency hint on another workspace and
switching to this workspace would cause the urgency to be reset (by
moving the focusing to the client), delay the reset by some time. This
gives the user the chance to see it.

This commit adds the possibility to configure the urgency delay timer
duration using the 'force_display_urgency_hint' directive. Also,
documentation and a testcase was added to allow for automated checks of
the intended behavior.

fixes #482
2012-09-22 14:12:09 +02:00
Michael Stapelberg c6c6d3a952 naive implementation of 'bindsym --release' (and bindcode)
The implementation is naive because the user has to generate exactly the
event he specified. That is, if you use this binding:

    bindsym --release $mod+x exec import /tmp/latest-screenshot.png

Then it will only be triggered if you hit $mod, hit x, release x,
release $mod. It will not be triggered if you hit $mod, hit x, release
$mod, release x. The reason is that the KeyRelease event in the latter
case will not have the modifier in its flags, so it doesn’t match the
configured binding.
2012-09-06 17:04:31 +02:00
Michael Stapelberg 65e5bcfdf4 Merge branch 'master' into next 2012-09-04 20:21:31 +02:00
Michael Stapelberg 5b95e20a62 Bugfix: Don’t allow ConfigureRequests while in fullscreen (Thanks Piotr)
This fixes a compatibility issue with gnome-terminal and xfce’s
terminal, where fullscreening would lead to moving the window and not
displaying the contents properly.

fixes #788
2012-09-04 20:21:07 +02:00
Michael Stapelberg 68a23b9577 Bugfix: only honor _NET_ACTIVE_WINDOW for visible windows (+test) (Thanks Tucos)
fixes #774
2012-08-12 16:08:53 +02:00
Michael Stapelberg 884627ef20 use I3__FILE__ for DLOG, leave __FILE__ as is
See also commit 0e752070ac, which broke
source code listings in gdb unless you cd into i3/src. This should give
us best of both :-).
2012-08-12 12:19:47 +02:00
Michael Stapelberg 6ba0944430 scratchpad: fix moving scratchpad window
From the source:

    When starting i3 initially (and after each change to the connected
    outputs), this function fixes the resolution of the __i3
    pseudo-output. When that resolution is not set to a function which
    shares a common divisor with every active output’s resolution,
    floating point calculation errors will lead to the scratchpad window
    moving when shown repeatedly.

fixes #632
2012-08-08 18:45:40 +02:00
Michael Stapelberg 0e752070ac explicitly set filenames to $(basename __FILE__)
This makes the debug log a bit more readable, especially since commit
48f1e383ca
2012-08-07 09:55:52 +02:00
Michael Stapelberg fa4894fbaa Support _NET_ACTIVE_WINDOW ClientMessages
Since we advertise _NET_ACTIVE_WINDOW support (but only set the
corresponding atom currently), it makes sense to also support the
ClientMessage. Apps such as Gajim use it to set focus to the roster
window when clicking on the tray icon for example.

fixes #767
2012-08-07 09:50:47 +02:00
Michael Stapelberg 122130d868 handlers.c: don’t call x_push_changes(croot), tree_render() already does 2012-08-07 09:50:25 +02:00
Michael Stapelberg ac8b2f637f cleanup i3 sync protocol messages 2012-08-04 16:34:57 +02:00
Michael Stapelberg cc7f16007a Display i3-nagbar when commands lead to an error
e.g. pressing Mod1+x when having the following in your configfile:

    bindsym Mod1+x some invalid command

will lead to an i3-nagbar instance popping up, offering you to view the
error log (which will contain parser errors from this commit on).
2012-08-02 17:45:09 +02:00
Michael Stapelberg 6e9bbe67ce Bugfix: fix reload crashes in rare cases (Thanks Tucos)
Depending on the memory layout, it could happen that bind->command was
exchanged with something else while the parser still accessed it.

Therefore, we now copy the command and let the parser use that copy.
2012-06-27 17:48:22 +02:00
Michael Stapelberg bbe607899c Send proper error messages upon parser failures, use yajl for generating command replies
Fixes: #693
2012-05-02 22:01:50 +02:00
Michael Stapelberg 206b96202c Use (void) instead of () for functions without args (Thanks fernandotcl)
See also:
http://article.gmane.org/gmane.linux.kernel/1268792

The C compiler will handle (void) as "no arguments" and () as "variadic
function" (equivalent to (...)) which might lead to subtle errors, such
as the one which was fixed with commit 0ea64ae4.
2012-03-31 10:53:04 +02:00
Michael Stapelberg d4523de6c8 Merge branch 'master' into next 2012-03-21 22:30:08 +01:00
Michael Stapelberg 1962c30dfb Force WM_TAKE_FOCUS event to be sent again upon EnterNotify
This fixes focus problems with Eclipse. Apparently, Eclipse waits for getting
notified about the focus, and since it used non-managed windows, i3 didn’t care
to update the focus.

Fixes: #621, #675
2012-03-21 22:27:31 +01:00
Michael Stapelberg ab9ba6fcf9 Use gettimeofday() and struct timevals instead of time()
Initially I thought using the second precision time() function is good enough,
but to make t/113-urgent.t considerably faster (>2s vs. 0.08s), we put in a
little more effort and use gettimeofday. Otherwise, this test blocks the whole
testsuite from completing much faster on modern machines :).
2012-02-21 13:38:49 +01:00
Michael Stapelberg e114b3dba2 Refactor the interface of commands.c
This change has two implications:

1) tree_render() will now be called precisely once for input which consists of
   multiple commands (like "focus left; focus right"). Also, the caller of
   parse_command() has to call it. This makes us able to fix tickets such as
   ticket #608 (where multiple tree_render() calls are noticable).

2) The output of a command is now a JSON array of return values of the
   individual subcommands. In the case of "focus left; focus right", this is:

   [{"success":true}, {"success":true}]

   While this is incompatible with what i3 returned before, the return value of
   commands was undocumented and therefore not subject to our API stability.
2012-02-15 20:57:25 +00:00
Jeremy O'Brien 53541817ef Implement urgency flag matcher
Currently it supports the following options:
"oldest": match the first window that triggered an urgent event
"latest": match the last window that triggered an urgent event
2012-02-14 22:47:10 +00:00
Michael Stapelberg 3229f7677f Rip out the old command parser, remove migration code 2012-01-27 22:11:03 +00:00
Michael Stapelberg 8d72a77c7a Merge branch 'master' into next
Conflicts:
	src/handlers.c
2012-01-21 11:50:22 +00:00
Michael Stapelberg 7a4d8ed6ed Bugfix: Force a new sequence number after UnmapNotify
This should fix the problem where (legitimate) EnterNotifys arrived with the
same sequence as the UnmapNotify and was ignored.

Fixes: #609
2012-01-21 11:49:46 +00:00
Michael Stapelberg 27b089e430 Fix prototype 2012-01-21 11:49:35 +00:00
Michael Stapelberg 47fd15649a Bugfix: Only ignore EnterNotify events after UnmapNotifies from managed windows
This should fix (some?) focus follows mouse problems.

Conflicts:

	src/handlers.c
2012-01-21 11:46:23 +00:00
Michael Stapelberg fd8e1c98c9 Merge branch 'master' into next
Conflicts:
	src/handlers.c
2012-01-18 19:18:22 +00:00
Michael Stapelberg 2d14ced024 Bugfix: Respect WM_HINTS.input for WM_TAKE_FOCUS clients
This fixes problems with Qt apps (like Quassel) and apparently Eclipse since
the last commit.
2012-01-18 19:16:57 +00:00
Michael Stapelberg 62cde927a5 Bugfix: Only ignore EnterNotify events after UnmapNotifies from managed windows
This should fix (some?) focus follows mouse problems.
2012-01-17 20:37:36 +00:00
Michael Stapelberg fca57ed077 Change prototype of handlers to static void, remove a bit of old code 2011-12-30 11:30:56 +01:00
Michael Stapelberg c4298b9311 Merge branch 'master' into next 2011-12-18 17:25:15 +00:00
Michael Stapelberg 4fba2d5f91 Bugfix: Correctly check boundaries and reassign floating windows when moving (Thanks xpt)
Fixes: #592
2011-12-18 17:24:27 +00:00
Michael Stapelberg 0d210277f0 x: Handle expose-events by only copying the requested region from our pixmap
This is faster than always updating the whole pixmap and should be safe.
2011-12-17 20:08:56 +00:00
Michael Stapelberg 75c57c4eef Bugfix: Ignore ConfigureRequests with out-of-bound coordinates (+test)
JDownloader seems to use these for its captcha popups when focus is not on the
same workspace, for some weird reason.
2011-12-17 17:15:52 +00:00
Michael Stapelberg bd4b240d56 Bugfix: Ignore EnterNotify events to prevent wrong focus in complex tabbed/stacked layouts (Thanks Phlogistique)
Fixes #560

Finally we have a good explanation and example for why we need to ignore
EnterNotify events which were caused by an Unmap :).
2011-11-28 23:26:45 +00:00
Michael Stapelberg 5f8d719835 Bugfix: Skip dock clients when handling FocusIn events (Thanks cradle) 2011-11-21 19:55:41 +00:00
Michael Stapelberg ee804a0635 Also call workspace_show() when moving cursor to an empty output (Thanks mw) 2011-10-25 23:41:52 +01:00
Michael Stapelberg 38447c4b47 Bugfix: Correctly use workspace_show() when focus changes to a different output via EnterNotify or FocusIn (Thanks pnutzh4x0r)
This makes i3bar show the correct workspace when you move your mouse from one
output to another.
2011-10-25 23:04:10 +01:00
Michael Stapelberg 91134f75c0 Move get_mod_mask to libi3, use it in i3 and i3-config-wizard
Also, the API changed a bit. There are two functions now, both assume you
already got the keysyms (which is the case for i3 and i3-config-wizard),
one gets the modifier mapping for you (aio_get_mod_mask_for) while the other
assumes you also got that. No roundtrips are required for the latter.
2011-10-23 21:26:15 +01:00
Michael Stapelberg 10d3281b0f remove/shorten a lot of debugging messages
Some of them are useless nowadays, others very unlikely to be a problem.
Those which might still be interesting somewhen in the future are just
commented out.
2011-10-23 00:15:13 +01:00
Michael Stapelberg 42d355f2b7 normalize modelines/headers across src/*.c 2011-10-22 23:40:02 +01:00
Michael Stapelberg f4f4d782bb implement a startup monitor, move code to src/startup.c 2011-10-10 15:54:17 +01:00
Michael Stapelberg c812cdcf9a make handle_client_message not return anything
The function returned an int for historical reasons.
2011-10-10 15:54:17 +01:00
Michael Stapelberg d1d4f39f9e save the last timestamp received by X11 in last_timestamp
We need it for startup notifications (to generate a unique id)

Conflicts:

	include/i3.h
	src/main.c
2011-10-10 15:54:17 +01:00
Michael Stapelberg 1481cd95c9 Implement the I3_SYNC client protocol
This is mainly useful for the testsuite. The tests can wait until i3 processed
all X11 events and then continue. This eliminates sleep() calls which leads to
a more robust and faster testsuite.
2011-09-22 23:13:12 +01:00
Michael Stapelberg 1717b88174 Merge branch 'master' into next 2011-09-22 20:11:44 +01:00
Michael Stapelberg 4dbda73114 Bugfix: Correctly revert focus to other floating windows when closing a floating window
Uncovered by the testsuite \o/
2011-09-22 20:10:51 +01:00
Michael Stapelberg b3adaa2983 Implement the window_role criterion (checks WM_WINDOW_ROLE)
Closes: #446

This is handy for matching specific windows of a multi-window application, for
example only Pidgin’s buddy list window.
2011-09-18 16:05:10 +01:00
Michael Stapelberg f2f636f9e7 Bugfix: Honor the X11 window border in ConfigureRequests 2011-09-17 14:11:01 +01:00
Michael Stapelberg b1aa8107b3 Bugfix: Correctly handle ConfigureRequests for floating windows in multi-monitor setups (Thanks thomasba)
Fixes #519
2011-09-14 22:59:19 +01:00
Michael Stapelberg e97a7e34f7 Bugfix: Re-implement reconfiguring height of dock windows (+test) (Thanks thomasba) 2011-08-27 13:47:10 +02:00
Michael Stapelberg 7951445849 xcb: use predefined XCB_ATOM_ atoms, don’t request them 2011-08-17 01:41:19 +02:00
Michael Stapelberg 95416175cd Bugfix: use FREE to correctly handle NULL replies 2011-08-09 09:27:24 +02:00
Peter Bui 5e06b1b21d Fix some potential memory leaks 2011-08-09 09:27:15 +02:00
Michael Stapelberg c883e7050a Include <limits.h> in all.h 2011-08-04 00:10:04 +02:00
Michael Stapelberg 088681c781 Bugfix: property handlers: correctly free replies in all cases 2011-07-31 17:46:41 +02:00
Michael Stapelberg 4875868689 Bugfix: Free property replies in their handlers 2011-07-31 17:12:37 +02:00
Michael Stapelberg 7a7764a0d9 handlers.c: fix warnings 2011-07-25 00:32:03 +02:00
Michael Stapelberg 05e39c1c48 Ignore X11 errors caused by ReparentWindow / ChangeProperty on already destroyed windows
These errors can happen because a DestroyWindow request by a client will
trigger an UnmapNotify, then a DestroyNotify. We cannot distinguish this
UnmapNotify from an UnmapNotify not followed by a DestroyNotify, so we just try
to send the ReparentWindow / ChangeProperty and ignore the errors, if any.
2011-07-10 23:44:13 +02:00
Michael Stapelberg 78d25c4cd9 expose event handler: use x_deco_recurse 2011-07-10 22:06:16 +02:00
Michael Stapelberg 71741d7620 Bugfix: Only set ENTER_WINDOW event mask for mapped windows (fixes focus problems)
Fixes focus problems when switching to empty workspaces or when going in/out of
fullscreen.
2011-07-04 13:41:02 +02:00
Michael Stapelberg fb9d77305e Implement 'fullscreen global' 2011-06-10 18:27:20 +02:00
Michael Stapelberg 8acea3d34c call tree_render() only after commands which require it
Saves one call of tree_render for exec, for example
2011-05-29 13:20:34 +02:00
Michael Stapelberg f680c8841f x: only re-render the tree in handle_normal_hints when they actually changed 2011-05-29 11:46:01 +02:00
Michael Stapelberg 5ae4620a24 Time Lord technology: for_window config directive to run arbitrary cmds
An example to set all XTerms floating:
    for_window [class="XTerm"] mode floating

To make all urxvts use a 1-pixel border:
    for_window [class="urxvt"] border 1pixel

A less useful, but rather funny example:
    for_window [title="x200: ~/work"] mode floating

The commands are not completely arbitrary. The commands above were tested,
others may need some fixing. Internally, windows are compared against your
criteria (class, title, …) when they are initially managed and whenever one of
the relevant values change. Then, the specified command is run *once* (per
window). It gets prefixed with a criteria to make it match only the specific
window that triggered it. So, if you configure "mode floating", i3 runs
something like '[id="8393923"] mode floating'.
2011-05-15 20:10:25 +02:00
Michael Stapelberg 167bdd26b7 Argument for 'kill' for killing a specific window (now default) or the whole client (+test)
Use 'kill window' to kill a specific window (for example only one specific
popup), use 'kill client' to kill the whole application (or X11 connection to
be specific).
2011-05-13 20:41:03 +02:00
Michael Stapelberg b0e871e0cf Bugfix: Fix focus follows mouse for non-default layout cons (Thanks phnom)
Fixes: #361
2011-05-12 22:24:52 +02:00
Michael Stapelberg c62f70856f Bugfix: Don’t crash when dock clients set the urgency hint (+testcase) 2011-05-11 22:45:20 +02:00
Michael Stapelberg 8b21812bbd Bugfix: Add missing tree_render() when handling the urgency hint (Thanks mxf) 2011-04-30 00:37:03 +02:00
Michael Stapelberg 3721bcb868 Bugfix: Ignore EnterNotifies generated by UnmapNotifies
Actually, commit 1c5adc6c35 commented out code
without ever fixing it. I think this was responsible for the 'workspace
switching sometimes does not work' bug. My observations:

Had it again today and analyzed a log of it. Looks like after unmapping the
windows on one workspace (in my case: chromium, eclipse, urxvt, focus on
eclipse) we get UnmapNotify events for chromium and eclipse, but then we get an
EnterNotify for the terminal (due to unmapping the other windows and therefore
mapping the terminal under the cursor), only afterwards the UnmapNotify
follows.

So, there are two things wrong with that:

• We handle EnterNotifys for unmapped windows

• Unmapping windows sometimes works in a sequence, sometimes the sequence gets
  split. Not sure why (if unmapping can take longer for some windows or if our
  syncing is wrong -- but i checked the latter briefly and it looks correct).
  Maybe GrabServer helps?

• We don’t ignore EnterNotify events caused by UnmapNotifies. We used to, but
  then there was a different problem and we decided to solve the EnterNotify
  problem in another way, which actually never happened (commit
  1c5adc6c35).
2011-04-19 21:50:56 +02:00
Michael Stapelberg 20b1fd4293 Skip FocusIn events with mode == NOTIFY_MODE_GRAB or NOTIFY_MODE_UNGRAB
According to the Xlib Programming Manual section 10.7.2 [1], these events are
generated when keyboard grabs activate/deactivate, while we are only interested
in focus changes which are done by other programs independend from the
keyboard.

[1] http://tronche.com/gui/x/xlib/events/input-focus/grab.html
2011-03-30 23:00:48 +02:00
Michael Stapelberg e913e519f2 refactor handlers.{c,h}: declare the handlers static, remove unnecessary parameters 2011-03-20 16:53:12 +01:00