Commit Graph

396 Commits

Author SHA1 Message Date
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
Michael Stapelberg 28c4b045d6 Merge branch 'next' (3.β is stable now) 2009-06-26 13:27:06 +02:00
Michael Stapelberg 27a418f454 Bugfix: Correctly remove fullscreen floating clients when unmapping (Thanks Volker) 2009-06-26 04:15:21 +02:00
Michael Stapelberg aa2f20ce26 Bugfix: Correctly handle floating windows when unmapping, fix focus bug when moving 2009-06-25 13:31:58 +02:00
Michael Stapelberg 62c8d58d82 Implement the configuration option floating_modifier and document it 2009-06-24 20:31:00 +02:00
Michael Stapelberg 675d28dd54 Bugfix: Check screen for NULL, free client memory correctly (Thanks dirkson) 2009-06-24 19:22:09 +02:00
Michael Stapelberg 61b1279f67 Bugfix: Don’t invalidate container pointer and access it when unmapping 2009-06-24 19:05:33 +02:00
Michael Stapelberg cba36914a8 Implement selecting the next tiling/floating window (using "focus")
Also update documentation (manpage, userguide).
To make the code easier to read/write when checking if a client is
floating, introduce client_is_floating().
2009-06-21 16:14:15 +02:00
Michael Stapelberg 8140619d5b Implement reconfiguration of floating clients 2009-06-21 13:29:48 +02:00
Michael Stapelberg 83d3146b65 Bugfix: Correctly raise the currently focused client when going into stack mode 2009-06-20 00:31:57 +02:00
Michael Stapelberg 589a73c8ea Bugfix: Correctly check for floating mode in the buttonpress handler (Thanks Mirko) 2009-06-19 22:48:18 +02:00
Michael Stapelberg 00c6bdeb0b Implement changing focus via keyboard between floating clients, fix several floating bugs 2009-06-14 01:04:59 +02:00
Michael Stapelberg 13002dc04e Bugfix: Actually reconfigure unmapped windows when they request it
Before, we only sent a fake message. While this was sufficient for the
client side most of the time, it didn’t allow us to open floating
windows with the correct size.
2009-06-12 23:47:04 +02:00
Michael Stapelberg 052190ad05 Handle transient hint and window class dialog to mark clients as floating 2009-06-12 22:59:23 +02:00
Michael Stapelberg d70ea03356 Remove some dead code, add default paths to switch() to make static analyzers happy
Check was done with scan-build from the LLVM suite. The remaining reports are false
positives and have been reported to llvm:

http://llvm.org/bugs/show_bug.cgi?id=4358
http://llvm.org/bugs/show_bug.cgi?id=4359
2009-06-10 19:59:36 +02:00
Michael Stapelberg 2f334c3f59 Bugfix: Don’t set focus when unmapping clients if the workspace is not active (Thanks Mirko)
This fixes ticket #53 because current workspace was set to the
workspace which was deleted.
2009-06-07 19:09:39 +02:00
Michael Stapelberg fb63c2ed58 Implement moving floating clients using Mod1+Left mouse button 2009-06-03 13:54:13 +02:00
Michael Stapelberg 036728c4d7 Use the size when mapping the window as size for floating (correct size for tool windows) 2009-06-02 14:24:37 +02:00
Michael Stapelberg 2a67630aa6 Optimization: Get the colorpixels when loading configuration, make use of the new config struct
Instead of building arrays of colorpixels we can simply use a pointer
to a struct Colortriple. Furthermore, by getting the colorpixels when
loading the configuration, we save a lot of function calls in the
main code.
2009-06-01 15:14:45 +02:00
Michael Stapelberg 517c47ca95 Don’t check twice for client.focused, change all places were colorcodes are used 2009-05-31 17:18:49 +02:00
Michael Stapelberg 0cb5d7448d Implement clients going automatically into floating 2009-05-31 00:31:18 +02:00
Michael Stapelberg b1eb93326f Bugfix: Correctly cleanup stack_windows when setting clients to floating
This fixes ticket #44
2009-05-30 11:35:32 +02:00
Michael Stapelberg d4fb34abdd Bugfix: Don’t ignore enter_notify events for clients on different screens (Thanks Mirko)
This fixes ticket #41.
2009-05-27 18:19:14 +02:00
Michael Stapelberg b58e2fa8ed Move toggle_fullscreen to client.c 2009-05-26 16:49:57 +02:00
Michael Stapelberg ac5c2fcf19 Bugfix: Fix fullscreen for floating clients, fix window name updates for floating clients 2009-05-26 16:46:50 +02:00
Michael Stapelberg 5b8e2ecb18 Implement floating (please test and find bugs)
Details which are missing: A command to hide/show all floating clients,
moving/resizing clients with your mouse holding Mod1 (click anywhere
in the client, not just on its borders), resize/move by keyboard, select
next/previous client by keyboard
2009-05-23 16:34:03 +02:00
Michael Stapelberg 7fde55578d Bugfix: Correctly handle mode_switch state bit, more debugging output for states
We abuse (1 << 8) as mode_switch bit, which is in the range of the
filtered state bits (see previous commit). Therefore, we need to
filter first and then check for mode_switch.

Furthermore, we used 0x2 before, which was just wrong. So, use our
bitmask, not the normal one (0x2).
2009-05-19 15:24:17 +02:00
Michael Stapelberg d98c514f82 Bugfix: Correctly handle mode_switch state bit, more debugging output for states
We abuse (1 << 8) as mode_switch bit, which is in the range of the
filtered state bits (see previous commit). Therefore, we need to
filter first and then check for mode_switch.

Furthermore, we used 0x2 before, which was just wrong. So, use our
bitmask, not the normal one (0x2).
2009-05-19 15:22:50 +02:00
Michael Stapelberg 5038b3c592 Bugfix: keypress: Only use the lower 8 bits of the mask so that mouse buttons are filtered out (Thanks Mirko)
Sometimes, when the mouse button gets stuck, state contains the bit for
BUTTON_MASK_1 (or other buttons). We filter them out to continue processing
keys correctly.
2009-05-19 13:52:23 +02:00
Michael Stapelberg 77ab4c0b10 Bugfix: keypress: Only use the lower 8 bits of the mask so that mouse buttons are filtered out (Thanks Mirko)
Sometimes, when the mouse button gets stuck, state contains the bit for
BUTTON_MASK_1 (or other buttons). We filter them out to continue processing
keys correctly.
2009-05-19 13:51:03 +02:00
Michael Stapelberg 1089fb7311 Bugfix: Don’t crash when above dock windows (Thanks Mirko) 2009-05-17 10:54:12 +02:00
Michael Stapelberg b35599004a Move the manage_*-functions into their own file as they got quite large 2009-05-16 18:25:04 +02:00
Michael Stapelberg d5d44e66a2 Bugfix: Re-assign dock windows to different workspaces when a workspace is deleted
Killing a dock client and having destroyed workspace 1 before (or the workspace
on which the dock client was started when it was not auto-started) crashed i3 before
this bugfix.
2009-05-16 18:12:35 +02:00
Michael Stapelberg e79cca8f72 Implement putting clients onto specific workspaces ("assign" in the configfile)
This closes ticket #39
2009-05-16 17:32:36 +02:00
Michael Stapelberg 1256730b4b Bugfix: Fix display/resizing of colspanned containers 2009-05-09 18:43:50 +02:00
Michael Stapelberg 3ccc0d7794 Bugfix: Fix display/resizing of colspanned containers 2009-05-09 18:43:02 +02:00
Michael Stapelberg 5b4f10eaca Bugfix: Store width_factor/height_factor per workspace, not per container
This is a relatively big change, however all cases should be handled by
now.

Because the function to do graphical resizing got rather large, I’ve created
a new file src/resize.c for it.

This fixes ticket #35.
2009-05-09 17:50:51 +02:00
Michael Stapelberg 8e1990f058 Bugfix: Store width_factor/height_factor per workspace, not per container
This is a relatively big change, however all cases should be handled by
now.

Because the function to do graphical resizing got rather large, I’ve created
a new file src/resize.c for it.

This fixes ticket #35.
2009-05-09 17:48:35 +02:00
Michael Stapelberg 8c6c4270a9 Bugfix: Don’t raise clients in fullscreen mode, send correct position to clients in fullscreen mode (Thanks ch3ka, mist)
This fixes #38 which only happened for clients which actively tried
to reconfigure themselves.
2009-05-08 23:23:47 +02:00
Michael Stapelberg 89076ea7cf Bugfix: Don’t raise clients in fullscreen mode, send correct position to clients in fullscreen mode (Thanks ch3ka, mist)
This fixes #38 which only happened for clients which actively tried
to reconfigure themselves.
2009-05-08 23:22:40 +02:00
Michael Stapelberg 4b77d93c2e Bugfix: Resize all containers in the column instead of only the active one (Thanks Ned)
This fixes ticket #33.
2009-05-07 13:51:34 +02:00
Michael Stapelberg a2ac022208 Bugfix: Resize all containers in the column instead of only the active one (Thanks Ned)
This fixes ticket #33.
2009-05-07 13:46:34 +02:00
Michael Stapelberg 3a2b546c9e Implement a command to travel the focusstack. This can be used like a jumpback.
However, it is a bit more flexible obviously. You can specify the
offset of the window you want to go to, to implement workflows like
the following:
 * Jump to mutt
 * Jump to irssi
 * Jump back ("focus 2" would be the command)
2009-05-05 17:25:56 +02:00
Michael Stapelberg e295ab302b Implement storing WM_CLASS of each client 2009-05-05 16:53:22 +02:00
Michael Stapelberg c27c7fc020 Bugfix: Insert windows at correct position/set focus correctly when moving between containers 2009-05-03 16:24:12 +02:00
Michael Stapelberg a0d23c53b3 Bugfix: Re-distribute free space when closing customly resized containers, re-evaluate for other containers
This fixes ticket #4
2009-05-03 14:29:58 +02:00
Michael Stapelberg eab895ac9e Bugfix: Correctly restore focus when leaving fullscreen mode 2009-05-03 02:13:11 +02:00
Michael Stapelberg c689b93bce Bugfix: Don’t crash when asprintf() can’t print the window name (Thanks ch3ka)
Apparantly, under some conditions (using LANG=en_US.UTF-8, other locale
variables unset), asprintf() says "Invalid or incomplete multibyte or
wide character" when given a string in COMPOUND_TEXT encoding.

For now, we properly handle asprintf-errors (this should have been
before), but there might be a better solution.
2009-04-28 22:41:00 +02:00
Michael Stapelberg 982e453251 Don’t rely on libxcb-wm any longer, as it got removed in libxcb 0.3.4
See http://cgit.freedesktop.org/xcb/util/commit/?id=4c9a707f472e49bc3005354db265a0214071d46b
2009-04-19 20:44:34 +02:00
Michael Stapelberg 65b858b9c5 Bugfix: Fix unmapping of dock windows (Thanks Mirko) 2009-04-13 23:27:47 +02:00
Michael Stapelberg a2d20b6848 Bugfix: Send clients their absolute position/size in generated configure events, not relative
This fixes ticket #26.
2009-04-11 22:37:48 +02:00
Michael Stapelberg 7133974306 Bugfix: Don’t only check for the currently active screen, but check for all screens (Thanks Mirko) 2009-04-11 19:06:26 +02:00
Michael Stapelberg bb8727cf27 Bugfix: Perform some bounds checking for snapped containers in fix_colrowspan (Thanks jchome)
This fixes ticket #22
2009-04-11 14:52:11 +02:00
Michael Stapelberg bcbe800720 Bugfix: Store dock clients per screen, not per workspace.
This fixes ticket #12
2009-04-11 14:29:15 +02:00
Michael Stapelberg 8cc1fcf536 General small cleanups 2009-04-11 14:08:19 +02:00
Michael Stapelberg e3516d72f5 Bugfix: Don’t change to workspaces on different screens when scrolling through them (Thanks Mirko)
This fixes ticket #19
2009-04-11 11:54:30 +02:00
Michael Stapelberg aace42cd7a Bugfix: Don’t crash anymore when moving focus to another screen (Thanks, Mirko!)
This fixes ticket #24. The crash appeared only under special conditions:
- The screen on which you switch to must be empty or at least not as
  full as the screen on which you were before.
- You switch focus using your mouse.
- You previously selected a column/row which is not availably on the
  destination screen (for example (1,1) and switching to an empty
  screen).
2009-04-10 21:29:25 +02:00
Michael Stapelberg ee5cb143c0 Oops. Don’t kill the current workspace 2009-04-09 12:13:14 +02:00
Michael Stapelberg 72d82f3993 Bugfix: Delete empty workspaces even when they’re not the active workspace
This fixes ticket #23
2009-04-09 11:19:56 +02:00
Michael Stapelberg 28aa13d831 Bugfix: Don’t set focus if it is not necessary.
This fixes ticket #13
2009-04-01 12:50:42 +02:00
Michael Stapelberg 755540817e Implement scrolling on stack windows and on the bar. This implements ticket #18 2009-04-01 12:31:13 +02:00
Michael Stapelberg 75a35319c9 Bugfix: Correctly remove client from container when moving to another workspace
This fixes ticket #16
2009-04-01 12:02:22 +02:00
Michael Stapelberg a8478efa34 Bugfix: Correctly filter out the numlock state bit (doesn’t get cleared for some reason)
This fixes ticket #14
2009-03-27 15:24:52 +01:00
Michael Stapelberg 9077831ed3 Bugfix: When entering a stack window with the mouse, set the focus to the active client
Fixes ticket #17
2009-03-26 23:00:26 +01:00
Michael Stapelberg e0f7e253ff Bugfix: Fix memory leak 2009-03-20 17:31:34 +01:00
Michael Stapelberg 21f7b7a724 Disable horizontal resizing for the release version, it still has bugs 2009-03-15 21:31:35 +01:00
Michael Stapelberg 74465a562a Bugfix: Only actively change focus if this is the current container 2009-03-15 20:52:43 +01:00
Michael Stapelberg 3a994e4bf7 Implement clicking on the bar to switch workspaces 2009-03-15 17:49:25 +01:00
Michael Stapelberg 80e2bf708d Send configure notify after putting a client into fullscreen mode, log at a central place 2009-03-14 17:37:11 +01:00
Michael Stapelberg 4ad1edc5eb Remove unused variable (fixes warning) 2009-03-13 11:20:21 +01:00
Michael Stapelberg 14834c3530 Fake more configure notifies (makes xpdf work better) 2009-03-13 00:39:16 +01:00
Michael Stapelberg 755709c86d Bugfix: Completely ignore legacy hints as soon as the client uses _NET_WM_NAME 2009-03-12 16:44:44 +01:00
Michael Stapelberg cc2c63b860 Handle legacy window titles by rendering them not unicode-compatible. 2009-03-11 21:31:54 +01:00
Michael Stapelberg 17bcdd8b0f Implement cleaning up the list of ignored events 2009-03-11 20:06:30 +01:00
Michael Stapelberg 12970211c4 Fix misnomer (window_type_handler → handle_window_type), resolve TODO 2009-03-11 19:39:32 +01:00
Michael Stapelberg ec290cbfa9 Bugfix: Don’t handle mouse click events inside the titlebar 2009-03-11 00:45:49 +01:00
Michael Stapelberg 408b2bdb39 Bugfix: Eliminate race condition, fix dock windows
There was a race condition when mapping a window and not setting the event mask
before. Therefore, the ReparentNotify and (more important) the UnmapNotify generated
by reparenting were not received, thus leaving the awaiting_useless_unmap variable
of the client "true". To just make it work, in previous commits the DestroyNotify
handler was introduced. Fortunately, with fixing this race condition by first
setting the event mask and mapping the window afterwards, we can remove this handler.

As for the dock windows, there were quite some occurences were client->container
was used without checking if the client is inside a container at all.

Furthermore, the client’s strut containing the space to reserve at the screen edge
is now checked and the desired height is set to the window’s height if the strut
contains 0 or if no strut was specified at all.
2009-03-10 20:56:25 +01:00
Michael Stapelberg 434345aa30 Ignore notify events which are not in mode XCB_NOTIFY_MODE_NORMAL 2009-03-10 11:26:52 +01:00
Michael Stapelberg 441f406a4b Fix warning (typecast) 2009-03-10 09:51:00 +01:00
Michael Stapelberg c025678177 Major change: Redirect events instead of handle the notifies.
By specifying XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, the window manager
will get map request events instead of map notify events, and therefore
can act sooner (the window won’t be positioned on the screen and moved
afterwards).

Furthermore, this fixes some problems with GIMP/VLC (and probably others)
which caused endless loops.

Also, events which should be ignored are now saved in a queue rather than
saving just the last event. This should eliminate race conditions.

Note that there is a new FIXME in src/handlers.c. Some windows generate
unmap notify events when reparenting while others don’t. We need to
understand, document and implement a more correct way to handle this.
2009-03-10 00:51:15 +01:00
Michael Stapelberg d38636439c Fix warning 2009-03-09 17:50:00 +01:00
Michael Stapelberg b800408a97 Bugfix: Handle all events when dragging to resize, correctly set OVERRIDE_REDIRECT 2009-03-09 08:50:33 +01:00
Michael Stapelberg 3a34cfc603 Bugfix: Draw bar at the correct position, handle expose events for bars 2009-03-09 08:24:05 +01:00
Michael Stapelberg 38d903aea5 Update comment 2009-03-09 07:18:04 +01:00
Michael Stapelberg cc78664f9d Bugfix: Use memcmp() instead of strcmp(), use new_len * 2 to check all bytes 2009-03-09 07:02:47 +01:00
Michael Stapelberg 65595c61a8 Bugfix: Don’t strcmp() if client->name == NULL 2009-03-09 06:41:04 +01:00
Michael Stapelberg 6df039c3b5 Convert window title to UCS-2 when updating it, don’t update it if it didn’t change 2009-03-09 06:26:32 +01:00
Michael Stapelberg 4f8e704017 s/atomar/atomic 2009-03-08 21:01:06 +01:00
Michael Stapelberg cefc1dabac Bugfix: Use a new variable called new_position and initialize it correctly when resizing 2009-03-08 20:59:49 +01:00
Michael Stapelberg 71221baca0 Fix race condition when updating client->name 2009-03-08 20:04:01 +01:00
Michael Stapelberg f85990b27a Fix warnings, update DEPENDS, update Makefile for NetBSD 2009-03-08 17:30:17 +01:00
Michael Stapelberg 6f630a3335 Implement UTF-8-clean window titles 2009-03-08 00:49:11 +01:00
Michael Stapelberg 6abcc5f656 Fix some bugs found by using raster’s wm_torture 2009-03-07 02:44:46 +01:00
Michael Stapelberg a411ed24cb Bugfix: Correctly check for empty containers and unmap the stack_win 2009-03-06 19:08:59 +01:00
Michael Stapelberg 017a0c0d08 Don’t set focus outside of the current container 2009-03-06 17:13:20 +01:00
Michael Stapelberg 97f23f549b Bugfix: decorate_window() needs a flush of course 2009-03-06 17:02:43 +01:00
Michael Stapelberg 4259e58655 Bugfix: One warning was left 2009-03-06 16:36:05 +01:00
Michael Stapelberg ee1f64a94e Bugfix: return value was missing 2009-03-06 16:21:39 +01:00
Michael Stapelberg fc3338d3c1 Bugfix: Missing flush after render_container() 2009-03-06 06:56:13 +01:00
Michael Stapelberg 96ac9f9066 Implement slog() and the LOG() macro, convert printf() to LOG() 2009-03-06 06:46:43 +01:00
Michael Stapelberg 0831f3e129 Implement handling the size hints so that aspect ratio is used correctly, fix rendering on stacks 2009-03-06 06:06:19 +01:00