aboutsummaryrefslogtreecommitdiff
path: root/wayland.h (follow)
Commit message (Collapse)AuthorAgeLines
* conf: bindings: allow several mappings for the same actionDaniel Eklöf2020-07-15-1/+1
| | | | | If the bindings has different pipe command associated with them, treat them as different actions.
* input: wip: initial support for piping scrollback/view to external toolsDaniel Eklöf2020-07-15-1/+1
|
* input: parse_key_binding: free key-codes list if 'bindings' is NULLDaniel Eklöf2020-07-15-0/+1
|
* conf: add definitions for pipe-{scrollback,view} bindingsDaniel Eklöf2020-07-15-0/+2
|
* wayland: read XCURSOR_{THEME,SIZE} in reload_xcursor themeDaniel Eklöf2020-07-10-5/+0
|
* seat: use separate 'enter' serials for keyboard and mouseDaniel Eklöf2020-07-09-1/+2
|
* multi-seat: improve handling of multiple (mouse) pointersDaniel Eklöf2020-07-09-2/+2
| | | | | | | | * xcursor always set for all pointers * xcursor sometimes not updated when it should be * mouse grabbed state wasn't per seat, but global (i.e. "does at least one seat enable mouse grabbing") * selection enabled state wasn't per seat
* xcursor: trigger theme reload in pointer-enter eventDaniel Eklöf2020-07-08-0/+3
| | | | | | | | | | | | | | | | Previously, we triggered a theme reload on output changes. This is completely wrong. We may get a new output with a scale different from the output the pointer is actually on. Now, we store the current scale along with the theme. We then trigger a call to reload the xcursor theme *every* time the pointer enters a surface. When it does, we use the current scale factor of the terminal that owns that surface. If the terminal covers multiple outputs, with different scale factors, we'll use the largest scale factor. This may not be 100% correct. But to fix that, we'd need to track which regions of a surface are mapped on which outputs. Too complicated I say.
* multi-seat: enable xcursor theme support againDaniel Eklöf2020-07-08-1/+3
|
* wip: multi-seat supportDaniel Eklöf2020-07-08-138/+146
| | | | | Compiles and runs, but mouse, clipboard and other things have been disabled.
* wayland: use xdg_output's description if there's no 'model'Daniel Eklöf2020-06-25-1/+6
|
* wayland: handle outputs disappearingDaniel Eklöf2020-04-27-0/+1
| | | | | | | | | That is, deal with monitors being unplugged. At least on Sway 1.4, surfaces are not unmapped before the output is removed. Thus, in addition to free:ing the monitor resources, we also need to update all terminals that are mapped on this output - remove the output from their "mapped on" list.
* render: use output's subpixel mode when rasterizing glyphsDaniel Eklöf2020-04-20-0/+1
|
* input: slow trackpad scrolling now eventually scroll a lineDaniel Eklöf2020-04-10-0/+1
| | | | | | | | | | | | | | | Before, we converted each axis event's scroll amount to an integer and scrolled that many lines. However, axis events are speed sensitive - very slow scrolling will result in events with a scroll amount that is < 1.0. For us, this meant we never scrolled a single line. You could slow scroll all day if you wanted, and still we would never scroll a single line. Fix this by aggregating the scroll amount from axis events until the scroll amount is > 1.0, and then scroll.
* search: replace hard-coded key bindings with "user configurable" onesDaniel Eklöf2020-03-18-12/+43
| | | | | | | | They aren't really user configurable. At least not yet. However, with this, we now handle raw key codes just like the normal key bindings. Meaning, e.g. ctrl+g, ctrl+a, ctrl+e etc now works while searching with e.g. a russian layout.
* input: bind key bindings to raw key codes tooDaniel Eklöf2020-03-18-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Before, when looking for a matching user key binding, we only matched *symbols*. This means that the physical keys that generate a specific key binding is layout dependent. What's worse, it may not even be possible to generate the key binding at all. Russian is one such layout, where all the "normal" (us) symbols are replaced. By using raw key codes, we can get around this - the key code has a direct mapping to the physical key. However, matching raw key codes **only** doesn't always make sense either. For now, match **both** symbols _and_ key codes. Symbols take precedence. TODO: we might have to make this configurable _per binding_. Note: 'search' mode still uses mostly hardcoded shortcuts that still have this problem (i.e. ctrl+g doesn't work with a russian layout).
* wayland: store display FD in wayland structDaniel Eklöf2020-03-15-0/+3
| | | | | | | | This way we: * Don't have to call wl_display_get_fd() all the time * No longer call fdm_del_no_close() even though the FD hasn't been added to the FDM.
* Merge branch 'scale-fonts-using-logical-dpi-plus-scale-factor'Daniel Eklöf2020-03-13-6/+31
|\
| * term: use logical DPI+scale factor when scaling fontsDaniel Eklöf2020-03-11-6/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes an issue where the fonts were rendered too small when the output had fractional scaling. For integral scaling, using the logical (scaled) DPI multiplied with the scaling factor results in the same final DPI value as if we had used the physical DPI. But for fractional scaling, this works around the fact that the compositor downscales the surface after we've rendered it. Closes #5
* | config: mouse-bindings: verify button isn't already mappedDaniel Eklöf2020-03-12-0/+1
| | | | | | | | | | | | | | | | | | A button may only be mapped to a single action. Detect when the user tried to map the same button to multiple actions and error out. To clear a binding (for example, to free up a button from the default bindings), one can set the action it is bound to to `NONE` (e.g. `primary-paste=NONE`).
* | config/input: implement mouse bindingsDaniel Eklöf2020-03-12-0/+6
| | | | | | | | | | | | | | | | | | | | * New config section, "mouse-bindings", where bindings are defined on the form "action=BTN_<name> * pointer_button() handler now scans the bindings list instead of hardcoding primary-paste to BTN_MIDDLE. * The implementation handles single- double- and triple clicks in the bindings, but there is currently no way to define anything but a single-click binding in the configuration.
* | bindings: add minimize/maximize/fullscreen actionsDaniel Eklöf2020-03-12-0/+3
| | | | | | | | These actions are by default not bound to anything.
* | search: add support for user configurable key bindingsDaniel Eklöf2020-03-08-0/+1
| | | | | | | | No default bindings defined yet, though.
* | input: convert the rest of the normal key bindings to configurable bindingsDaniel Eklöf2020-03-08-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New actions defined and implemented: * scrollback up/down * font size up/down/reset * spawn terminal Break out key combo parsing to a new function, parse_key_binding_for_action(). This function parses a string containing one or more space separated key combo definitions on the form (mod1+mod2+...+key), where key is a XKB key name (e.g. KP_Add). Convert all hardcoded key bindings to configuration based bindings. These still cannot actually be configured by the user, but at least lives in the conf struct.
* | wip: initial framework for dealing with key/mouse bindings in different modesDaniel Eklöf2020-03-08-0/+16
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds initial support for defining key and mouse bindings that are applied in different terminal modes/states. For example, there are two arrays dealing with key and mouse bindings in the "normal" mode. Most bindings will go here. There's also an array for "search" mode. These bindings will be used when the user has started a scrollback search. In the future, there may be a model selection mode as well. Or maybe "search" and "modal selection" will be combined into a single "keyboard" mode. We'll see. Since the keyboard bindings depend on the current XKB keymap, translation from the user specified key combination string cannot be done when loading the configuration, but must be done when we've received a keymap from the wayland server. We should explore if it's possible to load some kind of default keymap just to be able to verify the validity of the key combination strings at configuration load time, to be able to reject the configuration at startup. A couple of key bindings have been added as proof of concept. Mouse bindings aren't handled at all yet, and is likely to be re-written. For example, we can probably translate the configuration strings at configuration load time.
* csd: initial implementation of minimize/maximize/close buttonsDaniel Eklöf2020-03-02-2/+5
|
* config: make CSD user configurableDaniel Eklöf2020-03-02-9/+0
| | | | | | | | | | | | | | The user can now configure the following: * Whether to prefer CSDs or SSDs. But note that this is only a hint to the compositor - it may deny our request. Furthermore, not all compositors implement the decoration manager protocol, meaning CSDs will be used regardless of the user configuration (GNOME/mutter being the most prominent one). * Title bar size and color, including transparency * Border size and color, including transparency Also drop support for rendering the CSDs inside the main surface.
* render: csd: split up positioning from renderingDaniel Eklöf2020-02-29-0/+9
|
* input: cleanupDaniel Eklöf2020-02-29-2/+2
|
* input: csd: add a small delay before initiating a moveDaniel Eklöf2020-02-29-0/+3
| | | | | This ensures the user has time to double-click to toggle the maximized state.
* wayland: remove all usages of wayl_terminal_from_surface()Daniel Eklöf2020-02-29-3/+0
| | | | Use the 'user data' pointer from the wayland surface instead.
* input: handle CSD border corners correctlyDaniel Eklöf2020-02-29-0/+1
| | | | That is, change to correct cursor, and do resize correctly.
* wayland: once again switch to positioning CSDs outside the main surfaceDaniel Eklöf2020-02-26-1/+1
|
* wayland: document what FOOT_CSD_OUTSIDE doesDaniel Eklöf2020-02-26-0/+5
|
* wayland: switch back to positioning CSDs inside the main surfaceDaniel Eklöf2020-02-26-1/+1
|
* wayland: track window maximized stateDaniel Eklöf2020-02-26-0/+2
|
* csd: don't draw CSDs in fullscreen modeDaniel Eklöf2020-02-26-0/+2
|
* csd: position CSD sub-surfaces *outside* the main windowDaniel Eklöf2020-02-26-1/+2
| | | | | | | | | | | | | | | For now, this behavior is controlled with an ifdef. At least kwin seems very buggy when the decorations are positioned like this (but normally you'd use server-side decorations with kwin anyway). This commit also changes 'use_csd' to be a tri-state variable; when instantiating a window it is set to 'unknown'. If there's no decoration manager available (e.g. weston), we immediately set it to 'yes' (use CSDs). Otherwise, we wait for the decoration manager callback to indicate whether we should use CSDs or not.
* render: make CSD border and title size globally accessibleDaniel Eklöf2020-02-25-0/+3
|
* csd: wip: something to get started...Daniel Eklöf2020-02-23-0/+7
|
* render: throttle xcursor updatesDaniel Eklöf2020-01-04-3/+3
| | | | | | | | | | | | | | | | | | | | | | | With a bad behaving client (e.g. 'less' with mouse support enabled), we can end up with a *lot* of xcursor updates (so much, that we flooded the wayland socket before we implemented a blocking wayl_flush()). Since there's little point in updating the cursor more than once per frame interval, use frame callbacks to throttle the updates. This works more or lesslike normal terminal refreshes: render_xcursor_set() stores the last terminal (window) that had (and updated) the cursor. The renderer's FDM hook checks if we have such a pending terminal set, and if so, tries to refresh the cursor. This is done by first checking if we're already waiting for a callback from a previous cursor update, and if so we do nothing; the callback will update the cursor for the next frame. If we're *not* already waiting for a callback, we update the cursor immediately.
* wayland: wl_display_flush() never blocksDaniel Eklöf2020-01-04-0/+1
| | | | | | | | | | | | | | | | | | | Since it doesn't block, we need to detect EAGAIN failures and ensure we actually flush everything. If we don't, we sooner or later end up in a wayland client library call that aborts due to the socket buffer being full. Ideally, we'd simply enable POLLOUT in the FDM. However, we cannot write *anything* to the wayland socket until we've actually managed to send everything. This means enabling POLLOUT in the FDM wont work since we may (*will*) end up trying to write more data to it before we've flushed it. So, add a wrapper function, wayl_flush(), that acts as a blocking variant of wl_display_flush(), by detecting EAGAIN failiures and calling poll() itself, on the wayland socket only, until all data has been sent.
* wayland: don't use wl_display_dispatch()Daniel Eklöf2020-01-03-0/+2
| | | | | | | | | | | | | | | | | | | | | | wl_display_dispatch() calls poll(), which is unnecessary since we already know the FD is readable. Use the more lower level wl_display_read_events() + wl_display_dispatch_pending(). These require wl_display_prepare_read() to have been called. The idea is to call wl_display_prepare_read() **before** calling poll(). Thus, we do this more or less last in wayl_init(), and at the **end** of the FDM handler. However, having taking this lock also means we no longer can call wl_display_roundtrip() directly (it will hang). So, add a wrapper, wayl_roundtrip(), that cancels the read intent, does the roundtrip, and then re-acquires the read intent.
* render: refresh: ensure window has been configuredDaniel Eklöf2020-01-03-0/+1
|
* wayland: window: apply all configure changes after acking the eventDaniel Eklöf2020-01-03-0/+6
|
* wayland: remove wayl_terminal_from_xdg_{surface,toplevel}Daniel Eklöf2020-01-03-4/+0
|
* wayland: window now keeps pointer to owning terminal, not waylandDaniel Eklöf2020-01-03-2/+2
|
* wayland: rename focused/moused to kbd_focus/mouse_focusDaniel Eklöf2020-01-02-2/+2
|
* wayland: only bind to 'presentation' interface if -p,--presentation-timingsDaniel Eklöf2019-12-31-1/+3
|
* wayland: optionally use the presentation time protocol to measure input lagDaniel Eklöf2019-12-31-1/+6
| | | | | | | | | | | | | | | | | | | This adds a flag, -p,--presentation-timings, that enables input lag measuring using the presentation time Wayland protocol. When enabled, we store a timestamp when we *send* a key to the slave. Then, when we commit a frame for rendering to the compositor, we request presentation feedback. We also store a timestamp for when the frame was committed. The 'presented' callback then looks at the input and commit timestamps, and compares it with the presented timestamp. The delay is logged at INFO when the delay was less than one frame interval, at WARN when it was one frame interval, and at ERR when it was two or more frame intervals. We also update statistic counters that we log when foot is shut down.
* wayland: include more output (monitor) details in the log outputDaniel Eklöf2019-12-05-0/+4
|
* fcft: use fcft instead of local copy of font.c/font.hDaniel Eklöf2019-12-01-1/+2
|
* wayland: track current xcursor, and don't update if sameDaniel Eklöf2019-11-30-0/+1
| | | | | | | | | | | | | | | We may have many windows open, which tries to update/change the xcursor at various points. Track which cursor is currently loaded, regardless of which window it was set by. If someone tries to load that very same xcursor again, simply skip it. One example is when we've moused over a window that does *not* have keyboard focus, and then the user clicks, or by some other mean gives that window keyboard focus. In many cases it will then try to set the same cursor again (most of the times, the cursor is the same regardless of keyboard focus, but not always).
* terminal: use the 'text' xcursor pointer whenever selection is possibleDaniel Eklöf2019-11-28-2/+1
|
* wayland: calculate output PPI (pixels-per-inch)Daniel Eklöf2019-11-26-0/+3
|
* terminal: call user-defined callback when destroying terminalDaniel Eklöf2019-11-01-1/+0
| | | | main uses this to get the exit code of the terminal.
* wayland: wayl_win_destroy(): unmap windows before destroyingDaniel Eklöf2019-11-01-0/+2
| | | | | | | | | This will trigger e.d. keyboard_leave() and wl_pointer_leave() events, which ensures there aren't any references to the destroyed window from the global wayland struct. Call wl_display_roundtrip() to trigger those events *before* we destroy the window.
* wayland: temporary: track last terminal's exit valueDaniel Eklöf2019-10-30-0/+1
|
* wayland: track multiple terminalsDaniel Eklöf2019-10-30-2/+1
| | | | | The wayland 'term' member is gone and replaced by a list, 'terms'. This list contains all currently running terminal (windows).
* wayland: move reload_cursor_theme() and update_cursor_surface() to waylandDaniel Eklöf2019-10-27-0/+4
|
* wayland: implement wayl_init()Daniel Eklöf2019-10-27-2/+4
| | | | Wayland instantiation is now done by the wayland backend, not in main.
* term: wayland struct is now not a part of the terminal structDaniel Eklöf2019-10-27-1/+0
| | | | | | We do however need access to it, so provide a pointer. The difference is that now we can have a *single* wayland instance, but multiple terminal instances.
* wayland: pull in sys/time.h, for 'struct timeval'Daniel Eklöf2019-10-27-0/+2
|
* wayland: change all wayland callbacks to take a wayland pointerDaniel Eklöf2019-10-27-3/+28
| | | | | Instead of passing the terminal to the wayland callbacks, pass a 'struct wayland' pointer.
* wayland: add back-pointer to terminalDaniel Eklöf2019-10-27-0/+4
| | | | | This can, in the future, be extended to e.g. a list, to support multiple windows.
* kbd: move into waylandDaniel Eklöf2019-10-27-4/+34
|
* wayland: move clipboard/primary structs into the wayland structDaniel Eklöf2019-10-27-0/+18
| | | | These are application global and very wayland specific
* wayland: implement wayl_win_destroy()Daniel Eklöf2019-10-27-0/+4
|
* wayland: implement wayl_destroy()Daniel Eklöf2019-10-27-0/+7
|
* wayland: move wayland struct definitions to a separate fileDaniel Eklöf2019-10-27-0/+74