aboutsummaryrefslogtreecommitdiff
path: root/wayland.h (follow)
Commit message (Collapse)AuthorAgeLines
* term: use logical DPI+scale factor when scaling fontsDaniel Eklöf2020-03-14-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
* 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