Commit Graph

396 Commits

Author SHA1 Message Date
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
Michael Stapelberg c130cefa93 Handle FocusIn events generated by clients and update decoration accordingly (Thanks mseed) 2011-03-20 16:26:36 +01:00
Michael Stapelberg 0639a7d95b Make i3 compatible with the very latest xcb
This involves:
 • Compiling with xcb-util instead of xcb-{atom,aux} (they merged the libraries)
 • Not using xcb-{event,property} anymore (code removed upstream)
 • Not using the predefined WINDOW, CARDINEL, … atoms (removed upstream)
 • Using the new xcb_icccm_* data types/functions instead of just xcb_*
   (for example xcb_icccm_get_wm_hints instead of xcb_get_wm_hints)

Also I refactored the atoms to use x-macros.
2011-03-18 14:39:27 +01:00
Michael Stapelberg 89ef41dadf re-implement support for MappingNotifys 2011-03-14 17:20:04 +01:00
Michael Stapelberg f162e7efaa refactor font caching to just save the ID instead of mainting a cache with pattern→id-mapping 2011-03-10 23:20:17 +01:00
Michael Stapelberg 0689f6d8f1 Bugfix: use tree_render() instead of x_push_changes() to re-render and update the stack 2011-03-06 20:45:03 +01:00
Michael Stapelberg f6a21994bf Re-implement focus follows mouse for outputs
That is, moving your mouse pointer to a different workspace which does not have
any windows on it yet will correctly update the focus.
2011-03-03 16:36:18 +01:00
Michael Stapelberg e0647b7fc2 Bugfix: don’t focus dock clients (Thanks mseed, mist)
Fixes #321 and #323
2011-03-03 13:59:42 +01:00
Fernando Tarlá Cardoso Lemos f4ec0bceff Very minor issues found with statical analysis.
The Clang Static Analyzer uncovered those issues:

- The variable "changed" in handlers.c is written to, but it's
  never read since that specific write, so the write is not
  necessary.

- In util.c, "tail" may be NULL. In that case, we shouldn't pass
  it to strlen because strlen's behavior is not defined when s is
  NULL.

- In util.c, "write_index" is incremented twice. It's never used
  anymore after being incremented once, so the second increment is
  not necessary.
2011-02-28 16:48:22 +01:00
Michael Stapelberg 3383437705 refactor some places to use con_descend_focused instead of duplicating code 2011-01-27 16:09:14 +01:00
Michael Stapelberg 228b5c51ff change many LOG/printf messages to use DLOG 2011-01-07 20:58:58 +01:00
Michael Stapelberg 5098e45f23 Re-Implement support for RandR changes 2011-01-05 00:16:10 +01:00
Michael Stapelberg 38b231b848 handlers.c: remove obsolete code 2010-11-29 22:25:55 +01:00
Fernando Tarlá Cardoso Lemos 371ec037b8 Fix click to focus. 2010-11-29 22:09:05 +01:00
Michael Stapelberg 49308d5026 Bugfix: don’t update focus when moving mouse over stacked/tabbed decorations (Thanks fernandotcl) 2010-11-28 21:07:08 +01:00
Michael Stapelberg 61e3415ddc Bugfix: Add deco_height to bsr.y (to configure the floatingcon correctly). Fixes t/12-floating-resize.t 2010-11-28 20:43:35 +01:00
Michael Stapelberg 02b786509b Upon ConfigureRequests, send a generated ConfigureNotify (Thanks fernandotcl)
This fixes problems with GVim in stacking mode for example.
2010-11-28 13:19:49 +01:00
Michael Stapelberg 622b51a1ea Fix switching containers by moving the mouse over their decorations when in the same container 2010-11-28 01:13:18 +01:00
Michael Stapelberg 6fe0e58a64 Bugfix: Also render decorations of nearby cons when getting an ExposeEvent (Thanks fernandotcl) 2010-11-28 00:52:24 +01:00
Michael Stapelberg 3f3fa08b15 more debug for ClientMessages 2010-11-27 16:44:32 +01:00
Michael Stapelberg 6431d3d187 fix indention 2010-11-27 16:44:20 +01:00
Michael Stapelberg 962fe075b9 Bugfix: Upon ExposEvents, redraw decoration also for the window itself
In the meantime, windows can have decorations (borders) on their own frame, too.
2010-11-26 18:37:34 +01:00
Michael Stapelberg e744b48b30 Bugfix: When handling an EnterNotify for a child window, access the correct con->layout 2010-11-26 18:18:40 +01:00
Michael Stapelberg db651679c5 Bugfix: Properly ignore UnmapNotify events (especially for floating windows)
This fixes the bug which caused floating windows to be visible even when
switching to a different workspace.

Instead of ignoring a specific sequence, we now set an ignore_unmap counter for
each container. (So, should containers be closed too early or stay open even if
they should be closed, we probably need to have a closer look at the counter.
At the moment, it is increased by one on reparenting and unmapping (for
workspace changes) and decremented by one on each UnmapNotify event).

This system is better because a sequence does not describe a single unmap or
reparent request but a request to X11 on the network layer -- which can contain
multiple requests.
2010-11-20 19:11:43 +01:00
Fernando Tarlá Cardoso Lemos ea1e9b20be Get rid of the remaining hardcoded height. 2010-11-15 12:25:06 +01:00
Michael Stapelberg 055bd18142 Bugfix: after the first UnmapNotify, unignore the event 2010-11-14 20:15:12 +01:00
Michael Stapelberg d760a1c7b2 Bugfix: don’t kill parent when currently in tree_close() for a child of this parent 2010-11-14 20:14:09 +01:00
Michael Stapelberg 432073dbe5 implement support for WM_TRANSIENT_FOR, expand testcase 2010-11-13 01:19:21 +01:00
Michael Stapelberg ad9be5402a Implement support for WM_CLIENT_LEADER 2010-11-12 23:46:03 +01:00
Michael Stapelberg 8f7bd538d8 implement configure requests, adapt testcase
testcase does not pass 100% due to clients not being reparented correctly yet.
2010-11-12 21:41:10 +01:00
Michael Stapelberg 5c2758af26 Implement support for size hints (including test case) 2010-10-11 21:32:29 +02:00
Michael Stapelberg 61f9a79347 use decimal coordinates in debug message 2010-07-11 22:01:25 +02:00
Michael Stapelberg 32be3af109 Re-implement support for the urgency hint, extend t/13-urgent.t
The actual rendering will follow
2010-06-02 17:55:10 +02:00
Michael Stapelberg 14a312c152 more debug output 2010-06-02 17:04:26 +02:00
Michael Stapelberg 1c5adc6c35 Don’t ignore sequence in UnmapNotify, there might be multiple windows in one sequence
This would lead to i3 thinking that a new window was already managed if it
has the same X-ID as the old window. Instead, we need to fix the EnterNotify
problem in a different way.
2010-06-02 17:03:26 +02:00
Michael Stapelberg 2d52ecf071 Add parameter to reparent windows instead of killing them when closing a container
Necessary because when windows are unmapped, they are not necessary to
be killed (an application can unmap it temporarily).
2010-05-15 00:16:59 +02:00
Michael Stapelberg def41582d1 re-render the three after calling parse_cmd 2010-05-14 23:41:17 +02:00
Michael Stapelberg 8c5d824fa8 Ignore UnmapNotify events generated by reparenting 2010-05-14 23:37:56 +02:00
Michael Stapelberg 7adf921bc3 use the new parser for handling keybindings 2010-05-11 23:04:47 +02:00
Michael Stapelberg c4d87e2f81 handle destroynotify events 2010-04-17 17:27:53 +02:00
Michael Stapelberg d973f30fc2 push X11 changes after a window is mapped 2010-04-17 16:43:34 +02:00
Michael Stapelberg c56867792a handle client messages (fullscreen window state) 2010-04-17 13:54:45 +02:00
Michael Stapelberg 2534f21940 ignore sequence of unmapnotify events (generates enternotify events) 2010-04-16 20:56:49 +02:00
Michael Stapelberg 24725cd94a re-add fullscreen mode 2010-04-13 20:51:43 +02:00
Michael Stapelberg 8959c5005f cleanups 2010-04-13 19:33:40 +02:00
Michael Stapelberg 8e5a831e27 re-add focus follows mouse handling 2010-04-13 18:43:37 +02:00
Michael Stapelberg dd7acf73e9 re-add support for legacy window titles (WM_NAME) 2010-04-13 17:46:54 +02:00
Michael Stapelberg fd8735a6fd correctly update/display window title/class 2010-04-13 17:22:34 +02:00
Michael Stapelberg c145f7e529 first step of the big refactoring ("tree" branch).
From here on, we can track changes. It made no sense to put the
development up to this point into git.
2010-04-13 13:17:39 +02:00
Michael Stapelberg 46e7cf5fe1 Handle destroy notify events like unmap notify events
This helps for windows which are immediately destroyed instead of
unmapped, like when starting i3status | ./foobar | dzen2 -dock
and foobar does not exist (i3status and dzen2 will get a SIGPIPE).
2010-03-24 16:52:16 +01:00
Michael Stapelberg 56139f3656 Bugfix: only restore focus if the workspace is focused, not if it is visible 2010-03-23 14:43:35 +01:00
Michael Stapelberg aec40126b4 ipc: implement output event 2010-03-19 22:40:43 +01:00
Michael Stapelberg c738b2e454 Don’t use SYNC key bindings for Mode_switch but re-grab keys
Before this commit, i3 used key bindings in SYNC mode for bindings
like Mode_switch + <a> and replayed the key if the current state
did not include Mode_switch. This had some problems:

1) The WM needed to acknowledge much more key presses than you
   actually had bindings for, thus making the system a bit laggy
   sometimes.
2) Users of layouts who constantly type in the third level (like
   russian layouts) did not get their cyrillic symbols correctly
   (they were not replayed right), neither did the keybindings
   work in both modes.

So, the current implementation uses the following approach: XKB
provides an event which contains the current state (including
the current level). i3 signs up for this event and upon receival,
it re-maps the bindings using Mode_switch (enables them when the
level goes to the third level and disables them as soon as the
level goes back to normal). This fixes both problems.
2010-03-14 22:40:58 +01:00
Michael Stapelberg 3db4890683 ipc: implement events, cleanup the code a bit 2010-03-12 21:05:05 +01:00
Michael Stapelberg 93a9f3c244 Bugfix: Don’t mess up x/y coordinates in configurerequests for floating windows
This was the cause for ticket #93, which actually has a false
conclusion for the reason of this bug.

This code needs to be refactored.
2010-03-11 23:34:29 +01:00
Michael Stapelberg 40475b250f Allow unsetting WM_CLIENT_LEADER (XCB_NONE is not an invalid value) 2010-03-05 17:42:50 +01:00
Michael Stapelberg 8d648b4e37 Update function names, variable names and documentation for the RandR changes 2010-03-05 16:18:41 +01:00
Michael Stapelberg 8b192ac7ed Bugfix: Correctly hide/show workspaces when enabling new outputs, correctly handle focus (Thanks Merovius) 2010-03-05 15:22:12 +01:00
Michael Stapelberg e5f222e03e Save a resize_client() when handling the size hints 2010-03-03 01:23:38 +01:00
Michael Stapelberg 7839b7a4fe Bugfix: checked for wrong flag in size hints 2010-03-03 01:23:38 +01:00
Michael Stapelberg 818e02ef35 huge change: implement RandR instead of Xinerama
Thanks to Merovius for doing a proof of concept on this one and
being a driving force behind the idea.

Using RandR instead of Xinerama means that we are now able to use
the full potential of the modern way of configuring screens. That
means, i3 now has an idea of the outputs your graphic driver
provides, which allowed us to get rid of the ugly way of detecting
changes in the screen configuration which we used before. Now, your
workspaces should not be confused when changing output modes anymore.

Also, instead of having ugly heuristics to assign your workspaces
to (the screen at position X or the second screen in the list of
screens) you will be able to just specify an output name.

As this change basically touches everything, you should be prepared
for bugs. Please test and report them!
2010-03-02 12:47:21 +01:00
Michael Stapelberg 4fcbb7980e work around clients setting 0xFFFF as resize increments
I am not sure if behaviour is specified for this case, but as the
workaround is not really a big deal, why bother…
2010-02-20 20:32:43 +01:00
Michael Stapelberg 0b6b8e8380 Bugfix: Use both parts of WM_CLASS (it contains instance and class) (Thanks fallen)
Actually, WM_CLASS contains two null-terminated strings, so we cannot
use asprintf() to get its value but rather use strdup() to get both
of them. Both values are compared when a client is matched against
a wm_class/title combination (for assignments for example).
2010-02-12 12:12:25 +01:00
Michael Stapelberg 88b9700cdb Invert logic for the last commit
This makes it more clear that the option is meant to be a special
case (it *disables* part of the focus handling). Also, when
initializing the config data structure with zeros, it will get
initialized with the right value.

Furthermore, the config file parser now also accepts various values
which represent "true", not only numbers.
2010-01-29 21:58:50 +01:00
Kim Silkebækken (lokaltog) 7f10970fc7 Added focus_follows_mouse config option 2010-01-29 21:58:50 +01:00
Michael Stapelberg 848d9c1b01 Make containers containing exactly one window behave like default containers
Starting from this commit, a borderless window will always be
borderless if it is the only window in a container. For example,
you can have Firefox borderless in a tabbed container and as soon
as the download manager or a viewer gets opened, the container
will be rendered like a normal tabbed container.

This solves the user-interface dilemma of borderless/1-px-border
windows inside stacked/tabbed containers, at least for this special
case. Thanks to Merovius for this suggestion.
2009-12-22 23:40:06 +01:00
Michael Stapelberg 6ef0d1fa79 Touch each log message and classify it as DLOG (debug), ELOG (error) or LOG (verbose) 2009-12-19 22:40:23 +01:00
Michael Stapelberg ddf3119552 Bugfix: Don’t resize client after base_height changes if client is in fullscreen mode 2009-12-08 20:52:19 +01:00
Michael Stapelberg 5329ed0158 Bugfix: Resize client after updating base_height/base_width (Thanks Merovius)
This fixes the problem that urxvt/xterm "lost" a line of space before
being resized the first time.
2009-11-23 09:42:38 +01:00
Michael Stapelberg d2a88f7089 Bugfix: Don’t ignore urgency flag when the client wants to clean it (Thanks Syntropy) 2009-11-23 08:35:40 +01:00
Michael Stapelberg 29464dc791 Bugfix: Don’t set the urgency flag if the window is currently active 2009-11-20 15:55:54 +01:00
Michael Stapelberg c5da7bd266 Bugfix: Fix resizing of floating windows in borderless/1-px-border mode (Thanks Grauwolf)
Calculations were wrong (they simply didn’t take into account that
there is more than one border style, the code was from before we
implemented that…). We cannot directly set child_rect to the coordinates
as resize_client takes rect and calculates the child_rect, so we need
the new lines of code for this bugfix in any case (rect needs to be
updated).
2009-11-18 22:53:17 +01:00
Michael Stapelberg 82c32616e1 Bugfix: Correctly clear the urgency hint if a window gets unmapped without clearing the hint 2009-11-18 20:20:54 +01:00
Michael Stapelberg c0c4dd2978 Disable XKB instead of quitting with an error (Thanks sur5r)
This is necessary for running i3 in Xvnc for example.
2009-11-13 00:30:42 +01:00
Michael Stapelberg 316f62dfda Fix rendering of 1-px-border windows which require background filling 2009-11-08 13:04:14 +01:00
Michael Stapelberg 80551834d2 Bugfix: Allow dock clients to reconfigure their height (Thanks Grauwolf) 2009-10-23 16:07:03 +02:00
Michael Stapelberg 04884ab8cd Bugfix: Fix NULL pointer dereference when reconfiguring screens
This did not happen all the time. It seems like you need to have a
container which is in stacking/tabbing mode on the screen which
is being reconfigured. (when doing xrandr --output VGA1 --off for
example)
2009-10-12 18:31:31 +02:00
Michael Stapelberg df58981b57 Bugfix: Correctly restore the focus to the root screen after unmapping the last client (Thanks Rasi)
Sometimes, it may happen that the focus is "nowhere" and thus the
user is stuck. This was often the case with opera, sometimes with
pcmanfm. See ticket #118.
2009-10-07 20:26:13 +02:00
Michael Stapelberg 2b70e05ee9 Refactor workspaces to be stored in a TAILQ instead of an array
This fixes many problems we were having with a dynamically growing
array because of the realloc (pointers inside the area which was
allocated were no longer valid as soon as the realloc moved the
memory to another address).

Again, this is a rather big change, so expect problems and enable
core-dumps.
2009-09-29 19:45:41 +02:00
Michael Stapelberg 8f67eba044 Implement modes. Modes allow you to use different keybindings and switch between them.
For example, you can create a mode which will let you resize windows
with some easy to use keys. So, instead of binding a combination
of your homerow and modifiers to resize, like this:

	bind Mod4+44 resize right +10
	bind Mod4+45 resize right -10
	...

You can instead define a new mode:

	mode "resize" {
		bind 44 resize right +10
		bind 45 resize right -10
		...
		bind 36 mode default
	}

	bindsym Mod4+r mode resize

So, if you press Mod4+r now, your keybindings will be set to the ones
defined in your resize mode above. You can then use your homerow
(without any other modifier) to resize the current column/row and
press enter to go back to the default mode when you are done.

Note that using this option requires you to enable the new lexer/parser
by passing the -l flag to i3 when starting.
2009-09-27 18:45:39 +02:00
Michael Stapelberg d9ca8e8d1a Move handler for clicking to its own file 2009-09-22 18:07:25 +02:00
Michael Stapelberg 775d3a0d91 Make gcc happy about some possibly uninitialized variables (Thanks badboy)
This warning only showed up with CFLAGS=-O2.
The variables in question could never be uninitialized because
they were definitely set, have a look at the code. But anyways,
less warnings is always a good thing ;-).
2009-09-15 16:58:10 +02:00
Michael Stapelberg ce40f79c47 Implement right mouse button + dragging to resize tiling clients aswell 2009-09-12 19:51:50 +02:00
Michael Stapelberg cef5778097 Bugfix: Fix clicking on stack windows in tabbed mode (Thanks Atsutane) 2009-09-10 21:05:29 +02:00
Michael Stapelberg ff1ae52e6b Fix compilation warning because of missing braces 2009-09-10 16:29:23 +02:00
Michael Stapelberg 9f02fb7a3a Bugfix: Don’t handle WM_HINTS if it is not set (Thanks mxf) 2009-09-10 16:27:50 +02:00
Michael Stapelberg 2ff2a6a315 Implement the urgency hint for windows/workspaces
Thanks to Mikael for bringing it to my mind. This change introduces
two new color classes, client.urgent and bar.urgent. By default,
urgent clients are drawn in red (colors by Atsutane).
2009-09-06 22:40:11 +02:00
Michael Stapelberg 39f002e0b1 Bugfix: Don’t call resize_client if the width/height increment properties did not change
This avoids an endless loop, preventing clients to go to fullscreen
2009-08-25 23:16:17 +02:00
Michael Stapelberg 55b1bf4582 Bugfix: Correctly use base_width/base_height and size increment hints, correctly send fake configure notify events 2009-08-23 21:49:38 +02:00
Michael Stapelberg d9d4d9fff1 Implement tabbing
Use command "T" to switch to tabbing
2009-08-22 09:07:23 +02:00
Michael Stapelberg c7ba95e79d Implement resizing floating clients with Mod1 + right mouse button 2009-08-22 07:49:28 +02:00
Michael Stapelberg 4b3ea4d524 Bugfix: Don’t crash when clients set an invalid leader hint 2009-08-19 10:56:42 +02:00
Michael Stapelberg 44d9111d65 More log cleanups 2009-08-11 15:23:58 +02:00
Michael Stapelberg 556f180290 Bugfix: Fix screen wrapping, cleanup some log messages
Before this fix, you could go upwards and select the screen which
was at the rightmost because it also was the one topmost (if all
screen’s top position is equal).
2009-08-11 15:02:30 +02:00
Michael Stapelberg dd134a74ef Implement support for width_inc and height_inc of size hints
This fixes the problem where you saw old window contents when resizing
a window (due to opening new windows or similar), especially in terminals.
2009-08-11 14:08:04 +02:00
Michael Stapelberg b9636ceeec Set WM_STATE_WITHDRAWN when unmapping, unmap windows when destroying (Thanks xeen)
Seems like java apps need it. Also, you probably want to use XToolkit,
when you have to work with java apps:

export AWT_TOOLKIT=XToolkit
2009-08-11 12:16:10 +02:00
Michael Stapelberg 47a798ac4a Implement assignments of workspaces to screens, big cleanup of workspace code
Please test this! Plug in screens, unplug them, use your video projector,
change resolutions, etc.

To use the assignments, use the following syntax:
workspace <number> [screen <screen>] [name]

Where screen can be one of:
<number> (It is not provided that these numbers stay constant, so use with care)
<x>x<y> (Coordinates where the screen starts, so 1280 will be fine to match the
	 screen right of the main screen if your main screen is 1280 pixels
	 width. However, 1281 will not match)
<x>
x<y>

Some examples follow:

 workspace 1 screen 0
 workspace 1 screen 1
 workspace 1 screen 1280x0
 workspace 2 screen 1280
 workspace 3 screen x0
 workspace 3 screen 1 www
 workspace 4 screen 0 mail
2009-08-08 19:51:51 +02:00
Michael Stapelberg 7cdaa1b277 Implement support for using key symbols in configuration file
Use "bindsym" instead of "bind". You have to use the names of keys
as in xmodmap. To get a list of currently bounud symbols, use
xmodmap -pke

Technical quirk: Xlib generated MappingNotify events upon
XkbMapNotify events (from XKB, as the name says). XCB does not yet
have support for XKB, thus we need to select and handle the event
by ourself. Hopefully, this will change in the future.
2009-08-07 15:35:12 +02:00
Michael Stapelberg 3bd724f08d Bugfix: Track the user’s pointer over the root window and update current workspace (Thanks xeen)
When not having any windows on the first workspace, switching to the
second workspace using your mouse was not registered by i3.
2009-08-06 00:59:48 +02:00
Michael Stapelberg 3114d6821d Add support for WM_CLIENT_LEADER, put floating windows mapping to (0x0) to center of leader/workspace 2009-08-05 00:39:55 +02:00
Michael Stapelberg af3972aa9f Bugfix: Recognize clicks as client clicks (opposed to border_clicks) when clients send them for their parent window
See comment, happened for example with xfontsel. You normally got
to see the resize bar (when having >1 column, of course).
2009-08-04 22:47:42 +02:00
Michael Stapelberg 4c373c2128 Fix clicking on workspaces in internal bar (with named workspaces) (Thanks bapt) 2009-08-04 22:27:01 +02:00
Michael Stapelberg 19abb63393 s/Mod1/floating_modifier (Thanks badboy) 2009-08-02 22:58:23 +02:00
Michael Stapelberg 91aeed0442 Resolve documentation FIXMEs, remove an unnecessary struct 2009-06-29 22:20:35 +02:00
Michael Stapelberg 0305c1dc0e Bugfix: Use ->workspace instead of ->container 2009-06-28 01:58:00 +02:00
Michael Stapelberg acf1eb0c92 Don’t allow floating clients to reconfigure themselves when in fullscreen (Thanks Volker) 2009-06-28 01:52:06 +02:00