Commit graph

2454 commits

Author SHA1 Message Date
taiyu 65d71d0a5e put ipc_event_workspace in update_focus 2015-11-02 11:28:51 -08:00
Drew DeVault ca5a2a387c Merge pull request #212 from sce/mouse_warping
Learn mouse_warping
2015-10-29 17:52:16 -04:00
S. Christoffer Eliesen 515ed86f4d container.h: Remove unused. 2015-10-29 19:13:52 +01:00
S. Christoffer Eliesen 5ba47d4a44 input_state: Remove mouse_origin (x&y). Query wlc instead. 2015-10-29 18:02:02 +01:00
S. Christoffer Eliesen 78ca619769 commands: Learn mouse_warping.
Place mouse at center of focused view when changing to a workspace on a
different output, if option is enabled. (This replicates existing i3
option.)

This can be triggered in multiple ways:
A) via `workspace <name>` which changes output
B) via `focus <direction>` which changes output
C) via `focus output <name>` which (obviously) changes output
2015-10-29 17:41:33 +01:00
S. Christoffer Eliesen 4799d07ac1 input_state: Extract 'pointer_position_set' function from handlers. 2015-10-29 16:37:19 +01:00
S. Christoffer Eliesen 865b30f138 container: Move container_under_pointer here from handlers. 2015-10-29 16:37:19 +01:00
Drew DeVault ad1cd0a3bd Merge pull request #211 from sce/fix_get_swayc_in_direction
layout: get_swayc_in_direction: Properly find adjacent outputs.
2015-10-29 11:33:14 -04:00
S. Christoffer Eliesen 3c250e78be layout: get_swayc_in_direction: Properly find adjacent outputs. 2015-10-29 16:20:48 +01:00
Drew DeVault 239f4bd0ba Merge pull request #210 from sce/focus_output
commands: Learn 'focus output <direction|name>'
2015-10-28 15:54:28 -04:00
S. Christoffer Eliesen 5fa8f91655 commands: Learn 'focus output <direction|name>' 2015-10-28 20:06:48 +01:00
S. Christoffer Eliesen fede354a3d layout: Don't reset container size if it's a floating window. 2015-10-28 20:06:48 +01:00
Drew DeVault fa9978ee84 Merge pull request #209 from sce/fix_seamless_mouse
seamless_mouse: Pass workspace to workspace_switch, not output.
2015-10-27 18:34:31 -04:00
S. Christoffer Eliesen fabcf7c678 handlers: Pass workspace to workspace_switch, not output. 2015-10-27 23:22:57 +01:00
Drew DeVault 6cd106d23c Merge pull request #208 from minus7/ipc_subscribe
implemented IPC subscribe for workspace event
2015-10-27 17:19:18 -04:00
minus 9925554ea4 implemented IPC subscribe for workspace event 2015-10-27 21:59:17 +01:00
Drew DeVault 36526e8cb2 Merge pull request #206 from sce/debuglog
commands: Learn 'debuglog'.
2015-10-27 13:51:00 -04:00
S. Christoffer Eliesen 48c5325909 sway.5.txt: Remove 'debuglog' documentation. 2015-10-27 15:36:48 +01:00
S. Christoffer Eliesen 9f02b0bf16 commands: Learn 'debuglog'.
Replicates i3 option. Verbosity level given as command line argument
becomes default log level, and using 'debuglog toggle' switches back and
forth between default and debug (or L_ERROR and debug if default is also
L_DEBUG).
2015-10-27 14:37:44 +01:00
Drew DeVault eb847a1b1c Merge pull request #204 from sce/misc_stuff
Misc stuff
2015-10-25 08:58:34 -04:00
S. Christoffer Eliesen 83ca7d3a5c output: Fix code style. 2015-10-25 13:57:11 +01:00
S. Christoffer Eliesen c49e5340db commands: cmd_move: Fix "move container to workspace _number_ n"
This is an undocumented feature (the word "number" is just ignored
anyway), but it exists to be compatible with i3 config syntax.

Plus some code cleanup at the same time.
2015-10-25 13:19:48 +01:00
S. Christoffer Eliesen 5a70853253 log: Add swayc_log, use at a few key places.
swayc_log works just like sway_log, but appends type and name from given
container to the log output.
2015-10-25 13:14:28 +01:00
S. Christoffer Eliesen c6bb23b7dd sway/output: Create, move code from handlers.c here. 2015-10-25 13:14:23 +01:00
Drew DeVault 010368150b Update set_origin to match wlc changes 2015-10-23 14:29:35 -04:00
Drew DeVault c0f4a17c2a Merge pull request #202 from sce/seamless_mouse_adjustments
Seamless mouse adjustments
2015-10-23 10:48:09 -04:00
S. Christoffer Eliesen c1479701de seamless_mouse: Move pointer only if successfully changed workspace.
If e.g. a window has a popup open then that will lock the current focus,
making a workspace switch denied.

So don't move the mouse pointer in such cases.
2015-10-23 16:35:48 +02:00
S. Christoffer Eliesen 1f08106b0a handlers: Don't switch output when mouse button is pressed.
(E.g. if the user is using a scrollbar at the edge of the screen then
switching workspace would cancel the scroll.)
2015-10-23 16:35:48 +02:00
Drew DeVault 988a0bd67e Merge pull request #201 from sce/cmd_results
Replace cmd_status with cmd_results struct
2015-10-23 10:34:38 -04:00
S. Christoffer Eliesen 362413bd50 commands: cmd_results->input is duplicated/freed. 2015-10-23 13:03:14 +02:00
S. Christoffer Eliesen 88a2ddbe83 commands: Code formatting. 2015-10-23 12:55:48 +02:00
S. Christoffer Eliesen 187f0ab1c4 commands: Allow 'floating_modifier' & 'focus_follows_mouse' at runtime. 2015-10-23 12:45:46 +02:00
S. Christoffer Eliesen af30a1b67c ipc,commands,config: Replace cmd_status enum with cmd_results struct.
In i3 the ipc reply will contain a human readable error message, and
this patch replicates that behaviour.

However, that error message is also useful for logging, which this
patch takes advantage of.

E.g. instead of logging errors directly in commands.c/checkargs, it is
fed back to the caller which eventually ends up logging everything with
maximum context available (config.c/read_config).

So instead of logging e.g. "Error on line 'exit'" it will now log:
"Error on line 'exit': Can't execute from config."
2015-10-22 23:36:24 +02:00
S. Christoffer Eliesen 544c6c412a ipc: Return correct status in ipc reply. 2015-10-22 23:36:24 +02:00
Drew DeVault 8a57c48dff Merge pull request #200 from sce/fix_seamless_transitions
handlers: Fix swapped top/bottom for seamless transitions.
2015-10-22 17:14:10 -04:00
S. Christoffer Eliesen b093a5d16f handlers: Fix swapped top/bottom for seamless transitions. 2015-10-22 23:07:27 +02:00
Drew DeVault 2c100105bf Move pointer during seamless transitions 2015-10-22 16:44:29 -04:00
Drew DeVault 15d0739f73 Merge pull request #199 from sce/mouse_cross_output_edge_simple
Switch to adjacent output when hitting output edge.
2015-10-21 19:44:23 -04:00
S. Christoffer Eliesen edf33aad29 config: Add "seamless_mouse" to decide if pointer crosses output edges. 2015-10-22 01:39:12 +02:00
S. Christoffer Eliesen fc1bacf034 Switch to adjacent output when hitting output edge.
(Currently, after switching output the relative position of the mouse
stays the same.)
2015-10-22 01:18:51 +02:00
Drew DeVault 3e2579b22c Merge pull request #197 from sce/configure_outputs_during_reload_
Configure outputs during reload
2015-10-21 18:24:07 -04:00
S. Christoffer Eliesen 9b271573a9 commands: Allow changing resolution outside config load. 2015-10-22 00:16:10 +02:00
S. Christoffer Eliesen 4fea92ef0c config: Don't try to apply bad output resolution. 2015-10-21 23:59:01 +02:00
S. Christoffer Eliesen ca862a5bd4 config: Apply output config also during config reload. 2015-10-21 23:24:06 +02:00
S. Christoffer Eliesen 6eb8da0e14 commands,container: Tweak debug output to better reflect reality. 2015-10-21 22:22:01 +02:00
Drew DeVault aef3191022 Merge pull request #196 from sce/catch_empty_command
commands: Gracefully handle empty commands.
2015-10-19 13:52:49 -04:00
S. Christoffer Eliesen e3837ba634 commands: Gracefully handle empty commands.
Before this patch sway would proceed into find_handler which would cause
a crash trying to parse a NULL string.

This could be triggered via e.g. `i3-msg -s $(sway --get-socketpath)`.
2015-10-19 19:45:35 +02:00
Drew DeVault 83c23f274c Merge pull request #195 from sce/get_socketpath
main: Implement --get-socketpath switch.
2015-10-18 14:25:57 -04:00
Drew DeVault ee9b9414b9 Merge pull request #194 from sce/ignore_no_startup_id
Ignore exec switch "--no-startup-id".
2015-10-18 14:03:48 -04:00
S. Christoffer Eliesen 3be11a08e6 main: Implement --get-socketpath switch. 2015-10-18 19:53:56 +02:00