aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* meson: bump version to 1.12.11.12.1releases/1.12Daniel Eklöf2022-04-27-1/+1
|
* changelog: prepare for 1.12.1Daniel Eklöf2022-04-27-9/+3
|
* Merge branch 'master' into releases/1.12Daniel Eklöf2022-04-27-180/+336
|\
| * changelog: changed behavior of “extend-to-word-boundary”Daniel Eklöf2022-04-27-0/+6
| |
| * selection: find_word_boundary_right: add “stop-on-space-to-word-boundary”Daniel Eklöf2022-04-27-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When true, selection_find_word_boundary_right() behaves as before - it stops as soon as it encounters a character that isn’t of the same *type* as the “initial” character (the last character in the selection). Take this, for example: The Quick Brown Fox The selection will first stop at the end of “the”, then just *before* “quick”, then at the end of “quick”. Then just *before* “brown”, and then at the end of “brown”, and so on. This suits mouse selections pretty good. But when selection_find_word_boundary_right() is used to extend a search match, it’s better to ignore space-to-word character transitions. That is, we want The Quick Brown Fox to first extend to the end of “the”, then immediately to the end of “quick”, then to the end of “brown”, and so on. Setting the ‘stop_to_space_to_word_boundary’ argument to false results in latter behavior. This is now done by search, when executing the “extend-to-word-boundary” and “extend-to-next-whitespace” key bindings.
| * Disable debug loggingDaniel Eklöf2022-04-27-2/+2
| |
| * term: reset sixel options when hard resetting the terminal stateDaniel Eklöf2022-04-26-0/+12
| |
| * config: add ctrl+shift+v and XF86 paste to SEARCH_CLIPBOARD_PASTEDaniel Eklöf2022-04-26-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | We now bind ctrl+v, ctrl+shift+v, ctrl+y and XF86Paste to pasting from the clipboard into the scrollback search buffer. Why all these? Because we can, and because all are common shortcuts for pasting: * ctrl+v: “normal” apps use this by default * ctrl+shift+v: used in terminals (including foot) * ctrl+y: Emacs * XF86Paste: special keyboard key, for pasting
| * search: fix infinite loop when highlighting all matchesDaniel Eklöf2022-04-26-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | find_next() did not always terminate correctly, causing search_matches_next() to never terminate, which finally leads to an infinite loop when rendering the search overlay surface, while finding all matches to highlight. The problem is that find_next(), after having found the initial matching characters, enters a nested while loop that tries to match the rest of the search criteria. This inner while loop did not check if we’ve reached the last cell, and happily continued past it (eventually wrappping around the scrollback buffer). Closes #1047
| * search: assert that the match is *inside* the new viewportDaniel Eklöf2022-04-26-0/+9
| |
| * search: regression: crash when moving viewportDaniel Eklöf2022-04-26-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5c4ddebc3c57724bd89b959a33f5ad0bd97f482b refactored search_update_selection(), specifically, the logic that moves the viewport. It did so by converting the absolute row number (of the match) to scrollback relative coordinates. This way we could ensure the viewport wasn’t moved “too much” (e.g. beyond the scrollback start). However, grid_row_abs_to_sb() and grid_row_sb_to_abs() doesn’t take a partially filled scrollback into account. This means the row (numbers) it returns may refer to *uninitialized* rows. Since: * The match row itself is valid (we *know* it has text on it) * We *subtract* from it, when setting the new viewport (to center the match on the screen). it’s only the *upper* part of the new viewport that may be uninitialized. I.e. we may have adjusted it too much. So, what we need to do is move the viewport forward until its *first* row is initialized. Then we know the rest will be too.
| * changelog: typo: space on the wrong side of the parenthesisDaniel Eklöf2022-04-26-1/+1
| |
| * Merge branch 'sway-sub-surface-damage-workaround'Daniel Eklöf2022-04-26-2/+19
| |\ | | | | | | | | | Closes #1046
| | * changelog: workaround for Sway bug #6960Daniel Eklöf2022-04-26-0/+9
| | |
| | * term: flash: work around Sway sub-surface unmap bugDaniel Eklöf2022-04-26-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unmapping a sub-surface in Sway does not damage the underlying surface. As a result, the OSC-555 escape (“flash”) will leave yellow margins on ~every second frame. Out of sway, river, weston and mutter, only Sway needs this workaround. This is a workaround for https://github.com/swaywm/sway/issues/6960 Closes #1046
| | * search: work around Sway sub-surface unmap bugDaniel Eklöf2022-04-26-1/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unmapping a sub-surface in Sway does not damage the underlying surface. As a result, "committing" a scrollback search will typically leave most of the foot window dimmed. It can be seen when "cancelling" a search as well, but there it's less obvious - only the margins are left dimmed. This is because cancelling a search damaged the current viewport (something that shouldn't be needed). Out of sway, river, weston and mutter, only Sway needs this workaround. This is a workaround for https://github.com/swaywm/sway/issues/6960
| * Merge branch 'search-crashes'Daniel Eklöf2022-04-26-151/+167
| |\ | | | | | | | | | Closes #1036
| | * changelog: search mode not always highlighting all matches correctlyDaniel Eklöf2022-04-26-0/+2
| | |
| | * changelog: crash when extending selection in search modeDaniel Eklöf2022-04-26-0/+2
| | |
| | * search: fix multiple crashesDaniel Eklöf2022-04-25-108/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * When extending the selection to the next word boundary, ensure the row numbers are valid: - use selection_get_end() when retrieving the current end coordinate. This alone fixes a crash where we previously would crash in an out-of-bounds array access in grid->rows[], due to term->selection.coords.end being unbounded. - ensure the new end coordinate is bounded before and after calling selection_find_word_boundary_right(). * When moving the viewport (to ensure a new match is visible), make sure we don’t end up with the match outside the new viewport. Under certain, unusual, circumstances, the moved viewport _still_ did not contain the match. This resulted in assertions triggering later, that assumed the match(es) are *always* visible. It’s fairly easy to trigger this one by running foot with e.g. foot -o scrollback.lines=0 --window-size-chars 25x3 and then hitting enter a couple of times, to fill the scrollback history (which should consist of a single row in the example above), and the do a scrollback search for (part of) the prompt, and keep searching backward until it crashes. This would happen if calculated (new) viewport had to be adjusted (for example, to ensure it didn’t go past the scrollback end). This patch changes the logic used when calculating the new viewport. Instead of calculating the wanted viewport (match is vertically centered) and then trying to adjust it to ensure the new viewport is valid, start with a “safe” new viewport value, and then determine how much we can move it, if at all, to center the match. This is done by using scrollback relative coordinates. In this coordinate system, the new viewport must be >= 0, and < grid->num_lines - term->rows This makes it very easy to limit the amount by which the viewport is adjusted. As a side-effect, we can remove all the old re-adjustment logic. * The match iterator no longer special cases the primary match. This was needed before, when the search iterator did not handle overlapping matches correctly. Now that we do, the iterator is guaranteed to find the primary match, and thus we no longer need to special case it. This fixes a bug where the primary match was returned twice, due to the logic checking if a secondary match is the same as the primary match was flawed... Closes #1036
| | * sixel/terminal: use the new grid and selection APIsDaniel Eklöf2022-04-25-43/+37
| | | | | | | | | | | | | | | | | | | | | Use grid_row_abs_to_sb() instead of manually “rebasing” row numbers. Use selection_get_{start,end}() to retrieve the current selection coordinates.
| | * selection: add start/end coordinate gettersDaniel Eklöf2022-04-25-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | Internally, selection coordinates are *unbounded* (that is, the row numbers may be larger than grid->num_rows) while a selection is ongoing. Only after it has been finalized are the coordinates bounded. This means it isn’t safe to use term->selection.coords.* directly.
| | * grid: add abs-to-sb and sb-to-abs utility functionDaniel Eklöf2022-04-25-0/+33
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These functions convert row numbers between absolute coordinates and “scrollback relative” coordinates. Absolute row numbers can be used to index into the grid->rows[] array. Scrollback relative numbers are ordered with the *oldest* row first, and the *newest* row last. That is, in these coordinates, row 0 is the *first* (oldest) row in the scrollback history, and row N is the *last* (newest) row. Scrollback relative numbers are used when we need to sort things after their age, when determining if something has scrolled out, or when limiting an operation to ensure we don’t go past the scrollback wrap-around.
| * input: assert serial received from compositor is non-zeroDaniel Eklöf2022-04-24-0/+6
| |
| * selection: assert serial is non-zero before copying data to the clipboardDaniel Eklöf2022-04-24-1/+4
| |
| * changelog: scrollback mode freezing, with 100% CPUDaniel Eklöf2022-04-24-0/+2
| |
| * search: matches_next: assert start’s ‘col’ is validDaniel Eklöf2022-04-24-0/+2
| |
| * search: matches_next: stop searching when start.row >= term->rowsDaniel Eklöf2022-04-24-1/+10
| | | | | | | | | | | | | | | | | | As this means the last call to sarch_matches_next() found a match at the bottom of the view, and then set the iter’s *next* start position to a row outside the view. This is fine, but we need to handle it, by immediately stopping the iter.
| * search: matches_next: don’t wrap around grid->num_rowsDaniel Eklöf2022-04-24-2/+6
| | | | | | | | | | | | | | | | | | | | | | When bumping the iter’s start.row, we’re working with view-local coordinates. That is, 0 >= row < term->rows. This means it is wrong to and with grid->num_rows - 1, because a), ‘row’ should **never** be that big. And b), if we do, we’ll just end up in an infinite loop, where the next call to matches_next() just starts over from the beginning again (and eventually hitting the exact same place that got us started).
| * search: maches_next: assert match coordinates are validDaniel Eklöf2022-04-24-0/+9
| | | | | | | | | | * They are within range (i.e. ‘row’ does not exceed term->rows-1) * ‘end’ comes after ‘start’
| * selection: find_word_boundary: assert ‘pos’ is validDaniel Eklöf2022-04-24-0/+10
| |
| * changelog: UI not refreshing when pasting into the scrollback search boxDaniel Eklöf2022-04-24-0/+5
| |
| * render: fix refresh logic of pending csd|search|urlDaniel Eklöf2022-04-24-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our CSDs, the search-box and URL labels are all implemented using sub-surfaces, synchronized with the main grid. This means we *must* commit the main surface as well, when updating one of these sub-surfaces. The logic for doing so in the frame callback was flawed, and only triggered when the main grid was actually dirty. That is, e.g. search box updates that did not also resulted in grid updates (for example - pasting a search criteria that doesn’t match), did not result in a UI refresh. Closes #1040
| * search: fix debug logDaniel Eklöf2022-04-24-1/+2
| | | | | | | | | | This has been broken since the forward/backward search logic was refactored.
| * doc: foot.ini: drop empty line after *show-urls-launch*Daniel Eklöf2022-04-23-1/+0
| |
| * ci: enable -Db_pgo=generate on release buildsDaniel Eklöf2022-04-23-7/+7
| | | | | | | | Hopefully, this’ll catch missing stubs in pgo/pgo.c in the future.
| * changelog: hyperlink lists under their corresponding sub-sectionDaniel Eklöf2022-04-23-23/+25
| |
| * raedme: add a reference to foot-ctlseq(7)Daniel Eklöf2022-04-23-0/+3
| |
| * readme: add OSC 22Daniel Eklöf2022-04-23-0/+1
| |
| * readme: default foot.ini is now installed to /etc/xdg/foot/foot.iniDaniel Eklöf2022-04-23-1/+1
| |
| * changelog: pgo helper binary build fix (missing key-binding stubs)Daniel Eklöf2022-04-22-0/+4
| |
* | changelog: pgo helper binary build fix (missing key-binding stubs)Daniel Eklöf2022-04-22-0/+4
| |
* | Merge branch 'master' into releases/1.12Daniel Eklöf2022-04-22-200/+210
|\|
| * pgo: add missing stubs for key-binding functionsDaniel Eklöf2022-04-22-1/+11
| | | | | | | | | | * key_binding_new_for_term() * key_binding_unref_term()
| * changelog: convert all issue links to reference links in the 1.12.0 releaseDaniel Eklöf2022-04-22-33/+49
| |
| * Revert "changelog: convert all issue links to reference links in the 1.12.0 release"Daniel Eklöf2022-04-22-245/+229
| | | | | | | | | | | | | | This reverts commit 6652a836adb26ef55789bbd23113b158090451fd. We only added the actual links to the 1.12.0 release, meaning all other issue hyperlinks broke.
* | Merge branch 'master' into releases/1.12Daniel Eklöf2022-04-22-229/+256
|\|
| * changelog: convert all issue links to reference links in the 1.12.0 releaseDaniel Eklöf2022-04-22-229/+245
| |
| * changelog: replace all bug refs with markdown hyperlinksDaniel Eklöf2022-04-22-219/+219
| |
| * changelog: add new ‘unreleased’ sectionDaniel Eklöf2022-04-22-0/+11
| |
| * Merge branch 'releases/1.12'Daniel Eklöf2022-04-22-6/+13
| |\ | |/ |/|
* | meson: bump version to 1.12.01.12.0Daniel Eklöf2022-04-22-1/+1
| |
* | changelog: prepare for 1.12.0Daniel Eklöf2022-04-22-5/+12
|/
* meson: add -Dtests=false|true optionDaniel Eklöf2022-04-22-9/+20
| | | | | | | When set to false, no test binaries are neither built, nor executed (with “ninja test”). Closes #919
* doc + meson.build: update information about foot.ini, small cleanupMerlin Büge2022-04-22-36/+34
| | | | | | | | | | | | | | | | | | | - foot.ini.5: mention location of example config file - foot.1: replace outdated (or incomplete) information about the location of the config file with references to foot.ini.5 - foot.1 and foot.ini.5: conform to scdoc specification, thus surround each header with (at least) one blank line. additionally consistently use exactly one line before/after each header (was sometimes two before) - foot.1: some parts of the keybindings had their own section, move into KEYBOARD SHORTCUTS section - foot.1: move EXIT STATUS section to the end where it is commonly found - foot.1: copy information about config file handling from the beginning of foot.ini.5 into the CONFIGURATION section of foot.1 - INSTALL.md: foot.ini is no longer included in the documentation - meson.build: do not bundle foot.ini with documentation anymore, see also https://codeberg.org/dnkl/foot/pulls/1015 Closes #1002
* search: don't modify search.start coord *before* finding next matchDaniel Eklöf2022-04-21-55/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The match logic uses the last start coordinate to determine which end points in the selection to update. This sometimes fails when the start coordinate has been changed by e.g. a key binding - the new start coordinate is incorrectly matched against the old-but-modified start coordinate, causing foot to e.g. *not* upate the selection start coordinate. Example: $ echo 'test\n\test\ntest' Then do a scrollback search for 'test. The first match is found correctly (the last 'test'), but searching for the previous match (ctrl+r) does not select the middle 'test'. Fix by passing the search direction to search_find_next(), and have _it_ calculate the coordinate to start search. There are three possibilities: * forward * backward * "backward", but at the same position The first two are used when searching for next/prev match with ctrl+s and ctrl+r. The last one is used when the search criteria is updated. In this case, we don't want to move to the previous match, *unless* the current match no longer matches.
* url-mode: allow locked modifiers while handling label letter inputDaniel Eklöf2022-04-20-1/+1
| | | | | This fixes an issue where labels couldn’t be activated if e.g. NumLock was enabled.
* changelog: move “re-mapping input” from “changed” to “added”Daniel Eklöf2022-04-20-2/+2
|
* input: codespellDaniel Eklöf2022-04-20-1/+1
|
* input: copy libxkbcommon’s keysym_is_modifier()Daniel Eklöf2022-04-20-11/+13
| | | | | | | | | When determining whether a keysym is a modifier (to skip hiding the pointer when [mouse].hide-when-typing=yes), use the same matching logic xkbcommon does. This function, xkb_keysym_is_modifier() is unfortunately not part of the public API, which is why we copy it instead.
* csi: implement CSI > 4n (reset modifyOtherKeys)Daniel Eklöf2022-04-19-1/+29
|
* wayland: remove selection_override_modmask memberDaniel Eklöf2022-04-19-3/+25
| | | | | This member is no longer valid - we need to use one from the current key-binding set.
* search: add comment to ‘advance_pos()’ macroDaniel Eklöf2022-04-18-0/+2
|
* search: codespell: backards -> backwardsDaniel Eklöf2022-04-18-1/+1
|
* search: rename ‘newline’ -> ‘advance_pos’ macro, reverse return valueDaniel Eklöf2022-04-18-7/+7
|
* search: input: log consumed modifiersDaniel Eklöf2022-04-18-1/+2
|
* search: match iterator: wrap iterator’s row number, when neededDaniel Eklöf2022-04-18-0/+6
|
* search: find_next(): assert start/end coords are validDaniel Eklöf2022-04-18-0/+10
|
* search: find_next(): stop at the exact cell position specified by ‘end’Daniel Eklöf2022-04-18-22/+27
| | | | And not just when reaching end’s row.
* search: find_next(): prefix {start,end}_{row_col} with ‘match’Daniel Eklöf2022-04-18-21/+23
|
* search: find_next(): pass an ‘end’ coord, instead of a row countDaniel Eklöf2022-04-18-5/+31
|
* search: refactor: find_next(): pass start as a ‘coord’ structDaniel Eklöf2022-04-18-17/+16
|
* search: search_update_selection() no longer expects end coordinate to be exclusiveDaniel Eklöf2022-04-17-3/+0
|
* search: match iterator: handle overlapping matchesDaniel Eklöf2022-04-17-2/+2
|
* render: overlay: reset ‘start_col’ after handling the first rowDaniel Eklöf2022-04-17-0/+2
|
* search: match iterator: always return the primary matchDaniel Eklöf2022-04-17-17/+36
| | | | | | | Normally, the primary match is automatically included by the iterator, but if the secondary and primary matches overlap, it is possible we don’t return the _actual_ primary match. This lead to highlighting issues, where part of the primary match wasn’t highlighted correctly.
* search: fix next/prev not updating selection correctly when matches overlapDaniel Eklöf2022-04-17-3/+11
| | | | | When the new match overlapped with the old match, the selection wasn’t updated correctly.
* wayland: refactor: remove ‘struct config’ pointer from wayland structDaniel Eklöf2022-04-17-27/+30
| | | | | | | | | | | | | | The global config doesn’t necessarily reflect the correct configuration to use - we should *always* use the current terminal instance’s conf pointer. * Move selection override modifier mask to the key_binding_set struct * Always warn if XDG activation is unavailable, not just if bell.urgent is set (we no longer have access to this information) * Pass ‘bool presentation_timings’ as a parameter to wayl_init() * Remove ‘presentation_timings’ member from the ‘terminal’ struct Closes #932
* key-binding: NOINLINE a couple of functions, for a minor code size reductionDaniel Eklöf2022-04-17-4/+4
|
* changelog: key binding overrides having no effect with footclientDaniel Eklöf2022-04-17-0/+2
|
* key-binding: new API, for handling sets of key bindingsDaniel Eklöf2022-04-17-381/+732
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, our Wayland seats have been tracking key bindings. This makes sense, since the seat’s keymap determines how the key bindings are resolved. However, tying bindings to the seat/keymap alone isn’t enough, since we also depend on the current configuration (i.e. user settings) when resolving a key binding. This means configurations that doesn’t match the wayland object’s configuration, currently don’t resolve key bindings correctly. This applies to footclients where the user has overridden key bindings on the command line (e.g. --override key-bindings.foo=bar). Thus, to correctly resolve key bindings, each set of key bindings must be tied *both* to a seat/keymap, *and* a configuration. This patch introduces a key-binding manager, with an API to add/remove/lookup, and load/unload keymaps from sets of key bindings. In the API, sets are tied to a seat and terminal instance, since this makes the most sense (we need to instantiate, or incref a set whenever a new terminal instance is created). Internally, the set is tied to a seat and the terminal’s configuration. Sets are *added* when a new seat is added, and when a new terminal instance is created. Since there can only be one instance of each seat, sets are always removed when a seat is removed. Terminals on the other hand can re-use the same configuration (and typically do). Thus, sets ref-count the configuration. In other words, when instantiating a new terminal, we may not have to instantiate a new set of key bindings, but can often be incref:ed instead. Whenever the keymap changes on a seat, all key bindings sets associated with that seat reloads (re-resolves) their key bindings. Closes #931
* meson: install foot.ini to /etc/xdg/foot/foot.iniDaniel Eklöf2022-04-17-1/+5
| | | | Closes #1001
* url-mode: add a key binding that enables “persistent” URL modeDaniel Eklöf2022-04-17-11/+37
| | | | | | | This is an alternative to ‘show-urls-launch’, where we stay in URL mode after activating an URL. Closes #964
* changelog: scrollback search mode highlights all matchesDaniel Eklöf2022-04-17-0/+1
|
* render: overlay: apply weston quirkDaniel Eklöf2022-04-17-0/+2
|
* search: refactor: search_update_selection() takes a ‘struct range’Daniel Eklöf2022-04-16-19/+18
|
* search: break out “find next match” logic to a new functionDaniel Eklöf2022-04-16-113/+101
|
* search/render: initial support for highlighting all visible matchesDaniel Eklöf2022-04-16-11/+117
| | | | | | | | | | | | | | | | | Before this patch, only the currently “selected” match was highlighted (by having the “selected” attribute, and by *not* dimming it, like the rest of the grid during a scrollback search). With this patch, we now highlight matches within the viewport. While searching, only the “primary” match is searched-for, and tracked. Then, when rendering a frame, we find all “secondary” matches as well. “holes” are added to the search-mode overlay by the means of an search-match iterator. The iterator’s text matching logic is *very* similar to what we do when the search criteria has been updated, and we re-search the scrollback. It should be possible to refactor this, and share code.
* render: implement ‘flash’ and search mode’s ‘dimming’ with a sub-surfaceDaniel Eklöf2022-04-16-48/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Search mode and ‘flash’ (OSC-555) both achieves similar visual effects: flash tints the entire window yellow, and search mode dims it (except the search match). But, they do so in completely different ways. Search mode is detected in render_cell(), and the colors are then dimmed there. Flash is implemented by blending a yellow, semi-transparent color on top of the rendered grid. This patch replaces those two implementations with a single one. We add a new sub-surface, called the ‘overlay’. In normal mode, it’s unmapped. When either search mode, or flash, is enabled, we enable it, and fill it with a semi-transparent color. Yellow for ‘flash’, and “black” (i.e. no color) for search mode. The compositor then blends it with the grid. Hopefully on the GPU, meaning it’ll be faster than if we blend in software. There are more performance benefits however. By using a separate surface, we can do much better damage tracking. The normal grid rendering code no longer have to care about neither search mode, nor flash. Thus, we get rid of a couple of ‘if’ statements in render_cell(), which is nice. But more importantly, we can drop full grid repaints in a couple of circumstances: * Entering/exiting search mode * Every frame while flash is active Now, when rendering the search mode overlay, we do want to do some damage tracking, also of the overlay. This, since search mode doesn’t dim the *entire* window. The search match is *not* dimmed. This is implemented by punching a hole in the overlay sub-surface. That is, we make part of it *fully* transparent. The basic idea is to set a clip region that excludes the search match, and then dim the rest of the overlay. It’s slightly more complicated than that however, if we want to reuse the last frame’s overlay buffer (i.e we don’t want to re-render the *entire* overlay every frame). In short, we need to: * Clear (punch hole) in areas that are part of this frame’s search match, but not the last frame’s (since those parts are _already_ cleared). * Dim the areas that were part of the last frame’s search match, but aren’t anymore (the rest of the overlay should already be dimmed). To do this, we save the last frame’s “holes” (as a pixman region). Then, when rendering the next frame, we first calculate the new frame’s “holes” region. The region to clear is “this frame’s holes minus last frame’s holes” The region to dim is “last frame’s holes minus this frames holes”. Finally, we compute the bounding box of all modified cells by taking the union of the two diff regions mentioned above. This allows us to limit the buffer damage sent to the compositor.
* shm: add shm_did_not_use_buffer()Daniel Eklöf2022-04-16-0/+9
| | | | | | | | This allows a caller to return a buffer (obtained with shm_get_buffer()) to the pool, The buffer must not have been used. I.e. it must not have been attached and committed to a wayland surface.
* wayland: optionally disable pointer input on subsurfacesDaniel Eklöf2022-04-16-49/+27
| | | | | | | | | | | | | | | | We have a number of sub-surfaces for which we are *not* interrested in pointer (or touch) input. Up until now, we’ve manually dealt with these, by recognizing these surfaces in all pointer events, and ignoring them. But, lo and behold, there are better ways of doing this. By clearing the subsurface’s input region, the compositor will do this for us - when a pointer is outside a surface’s input region, the event is passed to the next surface underneath it. This is exactly what we want! Do this for all subsurfaces, *except* the CSDs.
* changelog: [csd].hide-when-maximizedDaniel Eklöf2022-04-16-0/+2
|
* config: add [csd].hide-when-maximized=yes|noDaniel Eklöf2022-04-16-2/+19
| | | | | | | When enabled, the CSD titlebar will be hidden when the window is maximized. Closes #1019
* render: take (visible) CSD border size into account when setting initial sizeDaniel Eklöf2022-04-16-0/+5
|
* wayland: add helper functions wayl_win_csd_{titlebar,borders}_visible()Daniel Eklöf2022-04-16-20/+36
|
* wayland: take (visible) border width into account on configure eventsDaniel Eklöf2022-04-16-1/+9
| | | | | | | | | | | When the compositor is asking us to resize ourselves, take our (visible) CSD borders into account. This is similar to how we already take the titlebar size into account. This fixes an issue where the window size “jumps” when the user starts an interactive resize, when csd.border-width > 0. This as been observed in GNOME.
* render: take visible border width into account when setting window geometryDaniel Eklöf2022-04-16-5/+14
| | | | This fixes e.g. window snapping in GNOME.
* fix some small typosMerlin Büge2022-04-13-7/+7
|
* pgo: sync up stub version of slave_spawn()Daniel Eklöf2022-04-12-2/+2
|
* config: config_free(): pass conf struct by pointer, not by-valueDaniel Eklöf2022-04-12-49/+49
|