Commit Graph

109 Commits (0b621292246f2736eeed82ef106f64749c058f68)

Author SHA1 Message Date
Tony Crisci ab0fae400b Delegate click handling to dock clients
Do not handle click events on dock clients because they are not managed
windows. Dock clients are responsible for sending the message to i3 to
focus a workspace if that is appropriate. i3bar now sends the message to
focus the correct workspace when that is appropriate.

Otherwise, it could interfere with the dock clients own click handling,
which could be an action to focus a different workspace than i3 had
assumed, such as would be the case with a workspace widget.
2014-04-30 09:31:42 +02:00
Michael Stapelberg 491274d8b3 handle ButtonPress events with child != XCB_NONE (Thanks xeen)
The X11 protocol description states:

  The window the event is reported with respect to is called the event
  window. The event window is found by starting with the source window
  and looking up the hierarchy for the first window on which any client
  has selected interest in the event.

For the case of urxvt with URxvt.internalBorder > 0, urxvt sets up a
subwindow for its actual contents that is placed “in the middle” of the
urxvt window. In terms of the X11 protocol, the source window is urxvt’s
window, but urxvt does not select ButtonPress events for that.
Therefore, X11 will go up in the hierarchy and deliver the event to i3
for i3’s window decoration, even though this was not actually a click on
the decoration, but into the managed window.

Therefore, we check whether child != XCB_NONE for clicks on window
decorations and then handle them as a click inside the window.

fixes #1176
2014-02-09 14:00:43 +01:00
Jonas Maaskola 905440d6d1 Resize floating windows by right-clicking decoration 2014-02-05 22:41:26 +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
Tony Crisci 69ce33d06d Snap pointer to resize bar on drag resize
When the user initiates a drag resize, draw the resize bar on the border
of the two involved containers and snap the pointer.

This solution produces cleaner code than the former approach where the
caller obfuscated the click coordinates of the event. This may confuse
someone expecting a true button press event.

Fixes an issue where the resize cursor is not shown when the resize bar
is clicked until the user begins to drag the mouse.

Fixes an issue where focus is not properly updated after the drag is
complete when `focus_follows_mouse' option is set, leaving the pointer
in an unfocused window in some cases.

Fixes an issue where the resize bar may jump a few pixels when the mouse
is first moved.

(Thanks to pbos for suggesting this fix and providing an example
implementation)
2014-01-01 15:18:54 +01:00
jj dbec5eb905 Fix keyboard and mouse resize in nested containers
fixes #1084
fixes #1085
2013-09-26 19:30:07 +02:00
Michael Stapelberg 721fa7bdad Fix scrolling on a tabbed titlebar which contains split cons (Thanks f8l)
fixes #708
2012-12-19 21:40:26 +01:00
Michael Stapelberg 7658109309 Bugfix: remove superfluous #include <xcb/xcb_atom.h> (Thanks pnutzh4x0r)
This fixes the build on CentOS 6.

fixes #889
2012-12-14 21:49:31 +01:00
Michael Stapelberg 9b87b2c8ec Implement smart popup_during_fullscreen mode
With this commit, the default behavior is to display popups while there
is a fullscreen application only if the popup belongs to that
application (as determined by the WM_TRANSIENT_FOR hint which
applications have to set properly).

fixes #663
2012-10-24 20:54:28 +02:00
Deiz f89bbe0746 Focus the relevant workspace when clicking any container. 2012-10-03 00:15:55 +02:00
Deiz e582e19ffd Clicking the root window should try to focus the relevant workspace. 2012-09-23 16:39:35 +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 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 de94f6da1a Introduce splith/splitv layouts, remove orientation
With this commit, the "default" layout is replaced by the splith and
splitv layouts. splith is equivalent to default with orientation
horizontal and splitv is equivalent to default with orientation
vertical.

The "split h" and "split v" commands continue to work as before, they
split the current container and you will end up in a split container
with layout splith (after "split h") or splitv (after "split v").

To change a splith container into a splitv container, use either "layout
splitv" or "layout toggle split". The latter command is used in the
default config as mod+l (previously "layout default"). In case you have
"layout default" in your config file, it is recommended to just replace
it by "layout toggle split", which will work as "layout default" did
before when pressing it once, but toggle between horizontal/vertical
when pressing it repeatedly.

The rationale behind this commit is that it’s cleaner to have all
parameters that influence how windows are rendered in the layout itself
rather than having a special parameter in combination with only one
layout. This enables us to change existing split containers in all cases
without breaking existing features (see ticket #464). Also, users should
feel more confident about whether they are actually splitting or just
changing an existing split container now.

As a nice side-effect, this commit brings back the "layout toggle"
feature we once had in i3 version 3 (see the userguide).

AFAIK, it is safe to use in-place restart to upgrade into versions
after this commit (switching to an older version will break your layout,
though).

Fixes #464
2012-08-04 03:13:24 +02:00
Michael Stapelberg fa6a3d57d2 Only resize when the left/right mouse button is used, not when scrolling (Thanks eeemsi) 2012-04-08 21:04:21 +02:00
Michael Stapelberg 42bbdbdfc1 Prevent changing focus outside a container when scrolling on the decorations
Fixes: #557
2012-04-08 18:33:45 +02:00
Michael Stapelberg 250577da36 Force WM_TAKE_FOCUS event to be sent when clicking
This fixes more problems with Eclipse.
See also commit 1962c30dfb
2012-04-07 16:24:53 +02:00
Simon Kämpe 51e6e48992 Highlight i3bar ws when changing output w/ mouse. 2012-02-15 22:05:01 +00:00
Michael Stapelberg 87b6bf7a54 Bugfix: Make resizing work when pressing floating_modifier + right mouse button on window decorations
Fixes: #583
2011-12-17 13:55:16 +00:00
Michael Stapelberg f6c0a1e161 Bugfix: Make resizing of tiling windows with floating_modifier use absolute coordinates
Fixes: #580
2011-12-17 12:20:27 +00:00
Michael Stapelberg 59283cce93 Bugfix: Fix resizing for (e.g.) v-split containers in h-split containers
Fixes: #562
2011-11-29 20:48:59 +00:00
Michael Stapelberg 1e5cd4b769 Bugfix: Only go to the parent container in resizing if that is actually a split container
(as opposed to a workspace)

This fixes a regression in resizing. We do need testcases for these things.
2011-11-11 19:19:14 +00:00
Michael Stapelberg df095f9d68 Bugfix: Fix tabbed container resizing check (Thanks julien)
Fixes: #534

Turns out that my check was wrong. We actually just need to make sure we are
dealing with the split container.
2011-11-10 19:35:36 +00:00
Michael Stapelberg ed66a30410 mark parameters const 2011-11-10 19:17:36 +00:00
Michael Stapelberg e25991f538 Bugfix: Don’t invoke resizing when clicking on the decoration in a > 1 child split con (Thanks julien)
Fixes: #534
2011-10-27 20:36:55 +01:00
Michael Stapelberg 42d355f2b7 normalize modelines/headers across src/*.c 2011-10-22 23:40:02 +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
Yves Fischer 0c367f9e4c Skip dragging of floating cons in fullscreen mode 2011-09-22 23:10:48 +01:00
Michael Stapelberg 062ce3ef03 Bugfix: Correctly resize when clicking on the border of a stacked con
Runs the same code as for non-stacked / non-tabbed containers, but on the
parent of the container (which is the stacked / tabbed con, since route_click
gets called with the child).
2011-07-23 21:48:14 +02:00
Michael Stapelberg 0bfab98a7f Correctly re-implement scrolling on window decorations
Got lost when refactoring the click handling in 24463718cc

Fixes: #390
2011-05-13 21:58:17 +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 1891a385ad Bugfix: also stop searching for resize cons when reaching a floatingcon (Thanks julien) 2011-03-06 13:35:07 +01:00
Michael Stapelberg 88ab66e742 Bugfix: don’t focus dock clients with new click handling code (Thanks mseed) 2011-03-06 02:06:05 +01:00
Michael Stapelberg 24463718cc refactor the click handling completely
Also re-implements floating modifier on tiling cons.

Fixes: #288 and a lot of headache :)
2011-03-05 20:23:29 +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 8f4b9ddaa4 Fix the choice of the right containers for resizing.
Also fixes #311, which was an assertion failure that uncovered
this problem. Thanks mseed, Merovius.
2011-01-30 18:52:32 +01:00
Michael Stapelberg 3e08ceaff9 bugfix: resizing problem when resizing vertically on the top border (Thanks julien) 2011-01-27 16:26:19 +01:00
Michael Stapelberg 2d05c3a37d Fix dragging floating containers / click handling 2010-12-31 01:38:17 +01:00
Michael Stapelberg 028f7d2ca7 Fix resize handling on click on borders (did not correctly use orientation) 2010-12-28 16:26:42 +01:00
Fernando Tarlá Cardoso Lemos 371ec037b8 Fix click to focus. 2010-11-29 22:09:05 +01:00
Michael Stapelberg ee45c92564 Implement resizing (still buggy)
Committing basic resizing functionality. We need testcases for the bugs and
then eliminate them.
2010-11-29 10:56:16 +01:00
Michael Stapelberg db3002fce0 Implement click on stack/tab decoration to focus 2010-11-26 18:57:15 +01:00
Michael Stapelberg df7788386d re-indent click function 2010-11-26 18:48:27 +01:00
Michael Stapelberg 574e6b51d1 re-implement click to focus 2010-06-28 22:26:23 +02:00
Michael Stapelberg c33d352fd2 floating: re-implement floating_modifier + left/right mouse button to drag/resize 2010-06-28 22:23:32 +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 2c42c0c760 Bugfix: Correctly check bitmask for floating_modifier 2010-03-25 02:53:53 +01:00
Axel Wagner 9cb35383a8 Implement proportional floating-resize. 2010-03-13 13:22:39 +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 ba2dd3a3eb Bugfix: Containers could lose their snap state (Thanks Atsutane)
When being on a different workspace than the one where the snapped
container is, the function to cleanup cols/rows would clean up too
much.
2010-01-01 22:40:50 +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 aa2e0d7d14 Bugfix: Correctly replay pointer if the click handler does not trigger (Thanks merovius) 2009-11-13 20:22:23 +01:00
Michael Stapelberg 0d327b7d17 Fix compilation warning 2009-11-02 23:14:21 +01:00
Michael Stapelberg a817519c0d Bugfix: Prevent a division through zero (Thanks xeen) 2009-10-29 00:33:20 +01:00
Michael Stapelberg da97b89b31 Bugfix: Don’t allow moving/resizing of fullscreen windows (Thanks xeen) 2009-10-13 08:26:35 +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 f38809288a Make number of workspaces dynamic (no longer limited by 10)
Warning: This is not yet thoroughly tested, so be prepared to
encounter some segfaults. Please enable logging and coredumps,
so we can fix bugs quickly.
2009-09-27 14:00:54 +02:00
Michael Stapelberg f4ec7fdfe9 Implement stack-limit for further defining how stack windows should look
Using this command, you can limit the amount of columns or rows for
a stacking container. This allows for better usage of screen estate
when using stacking containers with many clients.

Examples:
  i3-msg "stack-limit cols 2"
You will now have a stack window which has two columns of windows.
2009-09-22 18:07:59 +02:00
Michael Stapelberg d9ca8e8d1a Move handler for clicking to its own file 2009-09-22 18:07:25 +02:00