1
1
mirror of https://github.com/swaywm/sway synced 2024-11-05 23:20:54 +01:00
Commit Graph

863 Commits

Author SHA1 Message Date
Ian Fan
46cfa8ff56 ipc: remove extraneous values
Removes IPC_EVENT_MODIFIER and IPC_EVENT_INPUT, which were sway-specific and unused
2018-08-01 16:57:15 +01:00
Ian Fan
03eaf444a4 ipc: prevent emitting a workspace::focus event when moving a container to a different workspace or output
When a container is moved from, say, workspace 1 to workspace 2, workspace 2 is focused in order to arrange the windows before focus is moved back to workspace 1, which caused a workspace:focus event from workspace 2 to workspace 1 to be emitted. This commit inhibits that event.
2018-08-01 16:57:15 +01:00
Ian Fan
3edaf2ce2a ipc: add tick event 2018-08-01 16:57:15 +01:00
Ian Fan
6865b8aae9 ipc: add binding event 2018-08-01 16:57:15 +01:00
Ian Fan
317217f2c8 ipc: add window::mark event 2018-08-01 16:57:15 +01:00
Ian Fan
e8b179e313 ipc: add shutdown event 2018-08-01 16:57:14 +01:00
Drew DeVault
cbd0c3ec40
Merge pull request #2367 from emersion/iterator-redesign
Refactor surface iterators
2018-07-30 13:12:22 -04:00
Drew DeVault
6c30b3fcc8
Merge pull request #2381 from frsfnrrg/key-repeat
Implement key repeat for keybindings
2018-07-30 13:10:56 -04:00
Eric Engestrom
52a27f1529 delete references to swaygrab 2018-07-30 16:24:46 +01:00
Eric Engestrom
c6a6faaeae util.h: add missing include
parse_boolean() takes and returns a `bool`
2018-07-30 15:21:52 +01:00
Brian Ashworth
b8efdeae29 Fix title textures on scale change 2018-07-30 01:59:20 -04:00
frsfnrrg
8dbbfa5965 Bindings use advised keyboard repeat parameters
Now 'repeat_delay' and 'repeat_rate' control the initial delay
and rate (per second) of repeated binding invocations.

If the repeat delay is zero, binding repetition is disabled.
When the repeat rate is zero, the binding is repeated exactly
once, assuming no other key events intervene.
2018-07-29 19:15:10 -04:00
frsfnrrg
e33dfbfa75 Implement key repeat for pressed key bindings
Each sway_keyboard is provided with a wayland timer event source.
When a valid keypress binding has been found, a callback to
handle_keyboard_repeat is set. Any key event will either clear
the callback or (if the new key event is a valid keypress binding)
delay the callback again.
2018-07-29 19:15:02 -04:00
emersion
fe0750fec1 Remove output_surface_for_each_surface from header 2018-07-29 14:33:26 +01:00
emersion
8d5cc8625c Completely switch over to new iterators 2018-07-29 14:33:26 +01:00
emersion
e9d674cfd2 wip: redesign output_view_for_each_surface iterator 2018-07-29 14:33:26 +01:00
emersion
a0dd977617 wip: redesign output_layer_for_each_surface iterator 2018-07-29 14:33:26 +01:00
emersion
dbf6dd0dae wip: redesign output_drag_icons_for_each_surface iterator 2018-07-29 14:33:26 +01:00
emersion
d2172bd331 wip: redesign output_unmanaged_for_each_surface iterator 2018-07-29 14:33:26 +01:00
Drew DeVault
1e65439a54 Add virtual keyboard protocol
Ref #2373
2018-07-28 20:47:56 -04:00
Ryan Dwyer
da2a87f6c7 When unfloating, return container to previously focused tiled container
This introduces seat_get_focus_inactive_tiling and updates
`focus mode_toggle` to use it instead, because the previous method
wasn't guaranteed to return a tiling view.
2018-07-28 22:41:04 +10:00
Ryan Dwyer
08cfba2192 Allow containers to float
Things worth noting:

* When a fullscreen view unmaps, the check to unset fullscreen on the
workspace has been moved out of view_unmap and into container_destroy,
because containers can be fullscreen too
* The calls to `container_reap_empty_recursive(workspace)` have been
removed from `container_set_floating`. That function reaps upwards so it
wouldn't do anything. I'm probably the one who originally added it...
* My fix (b14bd1b0b1536039e4f46fe94515c7c44e7afc61) for the tabbed child
crash has a side effect where when you close a floating container, focus
is not given to the tiled container again. I've removed my fix and
removed the call to `send_cursor_motion` from `seat_set_focus_warp`. We
should consider calling it from somewhere earlier in the call stack.
2018-07-28 22:41:04 +10:00
Ryan Dwyer
27a20a4884 Allow containers to be fullscreen 2018-07-26 08:27:07 +10:00
ProgAndy
c7a3a03115 Add xkb_numlock/xkb_capslock commands (#2311) 2018-07-25 17:24:45 +02:00
ProgAndy
2166dbe2e4 Implement setting NumLock and CapsLock status
After setting the keymap, try to enable NumLock and disable CapsLock.
This only works if sway has the xkb master state and controls the keyboard.
Prepare configuration settings for later use as well.
2018-07-25 17:24:45 +02:00
Drew DeVault
53dbe2da4b
Merge pull request #2353 from emersion/render-opaque-overlay
Improve rendering with a fullscreen opaque overlay surface
2018-07-25 08:32:32 -04:00
Drew DeVault
fc718f629a
Merge pull request #2350 from ppascher/xwayland-optional
Added meson option to allow building sway without xwayland support
2018-07-25 08:27:40 -04:00
Pascal Pascher
f95cb9a7c1 reverted includes of "sway/config.h" and replaced with "config.h" from meson build 2018-07-25 13:32:20 +02:00
Pascal Pascher
79a45d4a40 more style fixes, included "sway/config.h" where needed 2018-07-25 12:17:10 +02:00
emersion
0e79b2114c Improve rendering with a fullscreen opaque overlay surface
The rendering code doesn't use the exclusive input surface at all
anymore to decide to skip rendering of shell surfaces. This fixes
a weird situation in which a client requests exclusive input but
isn't an overlay layer surface.

The renderer also renders all overlay surfaces in this situation,
not just one. This simplifies the code and fixes rendering when
there are more than one overlay surfaces (e.g. for a virtual
keyboard to type the lockscreen password).
2018-07-25 08:55:41 +01:00
Brian Ashworth
dca02944ce Implement floating_modifier <mod> [inverse|normal] 2018-07-24 18:41:08 -04:00
Pascal Pascher
2bf893248a style fixes, exclude sway/desctop/xwayland.c when enable_xwayland: false 2018-07-24 23:37:41 +02:00
Pascal Pascher
24ad1c3983 Added meson option "enable_xwayland" (default: true) to enable/disable xwayland support 2018-07-24 22:16:06 +02:00
Drew DeVault
817d37c950
Merge pull request #2165 from swaywm/pid-workspaces
Implement pid->workspace tracking
2018-07-24 14:44:01 -04:00
Ryan Dwyer
e02a6718c2
Merge branch 'master' into mouse-bindings 2018-07-24 19:23:04 +10:00
frsfnrrg
94dd8823a0 Invoke mouse bindings
The mouse binding logic is inspired/copied from the
keyboard binding logic; we store a sorted list of the
currently pressed buttons, and trigger a binding when
the currently pressed (or just recently pressed, in
the case of a release binding) buttons, as well as
modifiers/container region, match those of a given
binding.

As the code to execute a binding is not very keyboard
specific, keyboard_execute_command is renamed to
seat_execute_command and moved to where the other
binding handling functions are. The call to
transaction_commit_dirty has been lifted out.
2018-07-23 21:38:29 -04:00
Brian Ashworth
d56d62c1c0 Remove unneeded const 2018-07-23 21:33:17 -04:00
Brian Ashworth
863914ec95 Switch to using a function to parse booleans 2018-07-23 21:33:17 -04:00
frsfnrrg
754372c3de Parse mouse binding options
First, the existing sway_binding structure is given an
enumerated type code. As all flags to bindsym/bindcode
are boolean, a single uint32 is used to hold all flags.
The _BORDER, _CONTENTS, _TITLEBAR flags, when active,
indicate in which part of a container the binding can
trigger; to localize complexity, they do not overlap
with the command line arguments, which center around
_TITLEBAR being set by default.

The keyboard handling code is adjusted for this change,
as is binding_key_compare; note that BINDING_LOCKED
is *not* part of the key portion of the binding.

Next, list of mouse bindings is introduced and cleaned up.

Finally, the binding command parsing code is extended
to handle the case where bindsym is used to describe
a mouse binding rather than a keysym binding; the
difference between the two may be detected as late as
when the first key/button is parsed, or as early as
the first flag.  As bindings can have multiple
keycodes/keysyms/buttons, mixed keysym/button sequences
are prohibited.
2018-07-23 21:14:22 -04:00
Drew DeVault
f4b882475e Merge branch 'master' into pid-workspaces 2018-07-23 20:31:11 -04:00
Ryan Dwyer
12e90fa600 Store scratchpad list in sway_root instead of server 2018-07-23 08:24:32 +10:00
Ryan Dwyer
81e8f31cc6 Implement scratchpad
Implements the following commands:

* move scratchpad
* scratchpad show
* [criteria] scratchpad show

Also fixes these:

* Fix memory leak when executing command with criteria
(use `list_free(views)` instead of `free(views)`)
* Fix crash when running `move to` with no further arguments
2018-07-23 08:24:32 +10:00
emersion
238c8afc74 Handle set_{title,app_id} for xdg-shell and zxdg-shell-v6
This allows to update the title even if the view doesn't commit.
This is useful e.g. when a terminal sets its toplevel title to
the currently running command and when the view isn't visible.
2018-07-22 22:20:07 +01:00
Ryan Dwyer
011d1ebfa4 Consider view's min/max sizes when resizing 2018-07-22 23:10:19 +10:00
Ryan Dwyer
9df660ee31 Store last button and use it when views request to move or resize 2018-07-22 23:10:19 +10:00
Ryan Dwyer
6767d8a593 Prevent re-uploading the same cursor image multiple times 2018-07-22 23:10:19 +10:00
Ryan Dwyer
0c87bff5d1 Replace static handle_end_operation with seat_end_mouse_operation 2018-07-22 23:10:19 +10:00
Ryan Dwyer
ff445cc855 Implement xdg shell request_move and request_resize events
Also does a few other related things:

* Now uses enum wlr_edges instead of our own enum resize_edge
* Now uses wlr_xcursor_get_resize_name and removes our own
find_resize_edge_name
* Renames drag to move for consistency
2018-07-22 23:10:19 +10:00
Ryan Dwyer
9fbe13b9be Implement floating_modifier and mouse operations for floating views
This implements the following:

* `floating_modifier` configuration directive
* Drag a floating window by its title bar
* Hold mod + drag a floating window from anywhere
* Resize a floating view by dragging the border
* Resize a floating view by holding mod and right clicking anywhere on
the view
* Resize a floating view and keep aspect ratio by holding shift while
resizing using either method
* Mouse cursor turns into resize when hovering floating border or corner
2018-07-22 23:10:19 +10:00
Brian Ashworth
bc7d332109 Reset outputs on reload 2018-07-20 22:17:20 -04:00