├── .clang-format ├── .editorconfig ├── .gitattributes ├── .github └── workflows │ ├── build.yml │ ├── irc.yml │ └── labwc.github.io.yml ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── NEWS.md ├── README.md ├── data ├── labwc-portals.conf ├── labwc-symbolic.svg ├── labwc.desktop └── labwc.svg ├── docs ├── README ├── autostart ├── environment ├── labwc-actions.5.scd ├── labwc-config.5.scd ├── labwc-menu.5.scd ├── labwc-theme.5.scd ├── labwc.1.scd ├── menu.xml ├── meson.build ├── rc.xml ├── rc.xml.all ├── shutdown ├── themerc └── xinitrc ├── include ├── action.h ├── buffer.h ├── common │ ├── array.h │ ├── border.h │ ├── box.h │ ├── buf.h │ ├── dir.h │ ├── direction.h │ ├── fd-util.h │ ├── file-helpers.h │ ├── font.h │ ├── grab-file.h │ ├── graphic-helpers.h │ ├── list.h │ ├── macros.h │ ├── match.h │ ├── mem.h │ ├── nodename.h │ ├── parse-bool.h │ ├── parse-double.h │ ├── scaled-font-buffer.h │ ├── scaled-scene-buffer.h │ ├── scene-helpers.h │ ├── set.h │ ├── spawn.h │ ├── string-helpers.h │ └── surface-helpers.h ├── config │ ├── default-bindings.h │ ├── keybind.h │ ├── libinput.h │ ├── mousebind.h │ ├── rcxml.h │ ├── session.h │ ├── tablet-tool.h │ ├── tablet.h │ └── touch.h ├── debug.h ├── decorations.h ├── dnd.h ├── edges.h ├── icon-loader.h ├── idle.h ├── img │ ├── img-png.h │ ├── img-svg.h │ ├── img-xbm.h │ └── img-xpm.h ├── input │ ├── cursor.h │ ├── gestures.h │ ├── ime.h │ ├── input.h │ ├── key-state.h │ ├── keyboard.h │ ├── tablet-pad.h │ ├── tablet-tool.h │ ├── tablet.h │ └── touch.h ├── labwc.h ├── layers.h ├── magnifier.h ├── menu │ └── menu.h ├── meson.build ├── node.h ├── osd.h ├── output-state.h ├── output-virtual.h ├── overlay.h ├── placement.h ├── protocols │ ├── cosmic-workspaces-internal.h │ └── cosmic-workspaces.h ├── regions.h ├── resistance.h ├── resize-indicator.h ├── resize-outlines.h ├── session-lock.h ├── snap-constraints.h ├── snap.h ├── ssd-internal.h ├── ssd.h ├── theme.h ├── view-impl-common.h ├── view.h ├── window-rules.h ├── workspaces.h └── xwayland.h ├── meson.build ├── meson_options.txt ├── po ├── LINGUAS ├── POTFILES.in ├── ar.po ├── cs.po ├── da.po ├── de.po ├── el.po ├── es.po ├── et.po ├── eu.po ├── fa.po ├── fi.po ├── fr.po ├── gl.po ├── hu.po ├── id.po ├── it.po ├── ja.po ├── ka.po ├── ko.po ├── labwc.pot ├── lt.po ├── meson.build ├── nl.po ├── pa.po ├── pl.po ├── pt.po ├── pt_BR.po ├── ru.po ├── sv.po ├── tr.po ├── uk.po └── zh_CN.po ├── protocols ├── cosmic-workspace-unstable-v1.xml ├── meson.build ├── wlr-input-inhibitor-unstable-v1.xml ├── wlr-layer-shell-unstable-v1.xml └── wlr-output-power-management-unstable-v1.xml ├── scripts ├── .gitignore ├── README.md ├── check ├── checkpatch.pl ├── ci │ ├── autostart │ ├── ci_autostart.sh │ └── smoke-test.sh ├── find-banned.sh └── helper │ ├── .gitignore │ ├── Makefile │ └── find-idents.c ├── src ├── action.c ├── buffer.c ├── common │ ├── box.c │ ├── buf.c │ ├── dir.c │ ├── direction.c │ ├── fd-util.c │ ├── file-helpers.c │ ├── font.c │ ├── grab-file.c │ ├── graphic-helpers.c │ ├── match.c │ ├── mem.c │ ├── meson.build │ ├── nodename.c │ ├── parse-bool.c │ ├── parse-double.c │ ├── scaled-font-buffer.c │ ├── scaled-scene-buffer.c │ ├── scene-helpers.c │ ├── set.c │ ├── spawn.c │ ├── string-helpers.c │ └── surface-helpers.c ├── config │ ├── keybind.c │ ├── libinput.c │ ├── meson.build │ ├── mousebind.c │ ├── rcxml.c │ ├── session.c │ ├── tablet-tool.c │ ├── tablet.c │ └── touch.c ├── debug.c ├── decorations │ ├── kde-deco.c │ ├── meson.build │ └── xdg-deco.c ├── desktop.c ├── dnd.c ├── edges.c ├── foreign.c ├── icon-loader.c ├── idle.c ├── img │ ├── gen-color-table.pl │ ├── img-png.c │ ├── img-svg.c │ ├── img-xbm.c │ ├── img-xpm.c │ ├── meson.build │ ├── rgb.txt │ └── xpm-color-table.h ├── input │ ├── cursor.c │ ├── gestures.c │ ├── ime.c │ ├── input.c │ ├── key-state.c │ ├── keyboard.c │ ├── meson.build │ ├── tablet-pad.c │ ├── tablet-tool.c │ ├── tablet.c │ └── touch.c ├── interactive.c ├── layers.c ├── magnifier.c ├── main.c ├── menu │ ├── menu.c │ └── meson.build ├── meson.build ├── node.c ├── osd-field.c ├── osd.c ├── output-state.c ├── output-virtual.c ├── output.c ├── overlay.c ├── placement.c ├── protocols │ ├── cosmic_workspaces │ │ ├── cosmic-workspaces.c │ │ ├── meson.build │ │ ├── output.c │ │ └── transactions.c │ └── meson.build ├── regions.c ├── resistance.c ├── resize-outlines.c ├── seat.c ├── server.c ├── session-lock.c ├── snap-constraints.c ├── snap.c ├── ssd │ ├── meson.build │ ├── resize-indicator.c │ ├── ssd-border.c │ ├── ssd-extents.c │ ├── ssd-part.c │ ├── ssd-shadow.c │ ├── ssd-titlebar.c │ └── ssd.c ├── tearing.c ├── theme.c ├── view-impl-common.c ├── view.c ├── window-rules.c ├── workspaces.c ├── xdg-popup.c ├── xdg.c ├── xwayland-unmanaged.c └── xwayland.c ├── subprojects ├── .gitignore ├── libsfdo.wrap └── wlroots.wrap └── t ├── .gitignore ├── buf-simple.c └── meson.build /.clang-format: -------------------------------------------------------------------------------- 1 | # Note: this is an VERY rough approximation of labwc's coding style (see 2 | # CONTRIBUTING.md) and is intended only as a hint for IDE formatting 3 | # aids. DO NOT rely on clang-format or your IDE for correct formatting; 4 | # always check the result manually (and run ./scripts/check)! 5 | # 6 | # Some notable things that clang-format gets wrong: 7 | # - no support for double-indenting before an opening brace 8 | # - does not always round continuation indent/alignment to tab stops 9 | 10 | BasedOnStyle: LLVM 11 | UseTab: Always 12 | IndentWidth: 8 13 | ContinuationIndentWidth: 8 14 | AlignAfterOpenBracket: DontAlign 15 | AlwaysBreakAfterDefinitionReturnType: true 16 | BreakBeforeBinaryOperators: NonAssignment 17 | BreakBeforeBraces: Linux 18 | IndentCaseLabels: false 19 | SpaceBeforeParens: ControlStatementsExceptControlMacros 20 | ForEachMacros: ['for_each_view', 21 | 'wl_array_for_each', 22 | 'wl_list_for_each', 23 | 'wl_list_for_each_reverse', 24 | 'wl_list_for_each_reverse_safe', 25 | 'wl_list_for_each_safe'] 26 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.{c,h,scd}] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | indent_style = tab 9 | indent_size = 8 10 | max_line_length = 80 11 | 12 | [*.{xml,build,md}] 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.md] 17 | max_line_length = 80 18 | 19 | [COMMIT_EDITMSG] 20 | max_line_length = 74 21 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Exclude checkpatch.pl from language stats 2 | # https://github.com/github/linguist/blob/master/docs/overrides.md 3 | scripts/checkpatch.pl linguist-vendored 4 | -------------------------------------------------------------------------------- /.github/workflows/labwc.github.io.yml: -------------------------------------------------------------------------------- 1 | # Triggers a rebuild and deploy of labwc.github.io when man pages change 2 | # 3 | # https://stackoverflow.com/a/65514259 4 | 5 | name: "labwc.github.io" 6 | 7 | on: 8 | push: 9 | branches: 10 | - 'master' 11 | - 'v0.5_disabled' 12 | paths: 13 | - 'docs/*.scd' 14 | 15 | jobs: 16 | notify: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: labwc.github.io 20 | env: 21 | GITHUB_TOKEN: ${{ secrets.WEB_DEPLOY_TOKEN }} 22 | run: | 23 | gh api repos/labwc/labwc.github.io/dispatches \ 24 | --raw-field event_type=rebuild 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # VS Code cache 2 | .cache 3 | 4 | # vim swap files 5 | *.swp 6 | *.swo 7 | 8 | # Qt Creator settings 9 | *.user 10 | -------------------------------------------------------------------------------- /data/labwc-portals.conf: -------------------------------------------------------------------------------- 1 | [preferred] 2 | default=wlr;* 3 | org.freedesktop.impl.portal.Inhibit=none 4 | -------------------------------------------------------------------------------- /data/labwc-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /data/labwc.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=labwc 3 | Comment=A wayland stacking compositor 4 | Exec=labwc 5 | Icon=labwc 6 | Type=Application 7 | DesktopNames=labwc;wlroots 8 | -------------------------------------------------------------------------------- /data/labwc.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /docs/README: -------------------------------------------------------------------------------- 1 | Config layout for ~/.config/labwc/ 2 | - autostart 3 | - environment 4 | - menu.xml 5 | - rc.xml 6 | - shutdown 7 | - themerc-override 8 | - xinitrc 9 | 10 | See `man labwc-config and `man labwc-theme` for further details. 11 | 12 | -------------------------------------------------------------------------------- /docs/autostart: -------------------------------------------------------------------------------- 1 | # Example autostart file 2 | 3 | # Set background color. 4 | swaybg -c '#113344' >/dev/null 2>&1 & 5 | 6 | # Configure output directives such as mode, position, scale and transform. 7 | # Use wlr-randr to get your output names 8 | # Example ~/.config/kanshi/config below: 9 | # profile { 10 | # output HDMI-A-1 position 1366,0 11 | # output eDP-1 position 0,0 12 | # } 13 | kanshi >/dev/null 2>&1 & 14 | 15 | # Launch a panel such as yambar or waybar. 16 | waybar >/dev/null 2>&1 & 17 | 18 | # Enable notifications. Typically GNOME/KDE application notifications go 19 | # through the org.freedesktop.Notifications D-Bus API and require a client such 20 | # as mako to function correctly. Thunderbird is an example of this. 21 | mako >/dev/null 2>&1 & 22 | 23 | # Lock screen after 5 minutes; turn off display after another 5 minutes. 24 | # 25 | # Note that in the context of idle system power management, it is *NOT* a good 26 | # idea to turn off displays by 'disabling outputs' for example by 27 | # `wlr-randr --output --off` because this re-arranges views 28 | # (since a837fef). Instead use a wlr-output-power-management client such as 29 | # https://git.sr.ht/~leon_plickat/wlopm 30 | swayidle -w \ 31 | timeout 300 'swaylock -f -c 000000' \ 32 | timeout 600 'wlopm --off \*' \ 33 | resume 'wlopm --on \*' \ 34 | before-sleep 'swaylock -f -c 000000' >/dev/null 2>&1 & 35 | -------------------------------------------------------------------------------- /docs/environment: -------------------------------------------------------------------------------- 1 | ## 2 | ## Example ~/.config/labwc/environment file. 3 | ## Uncomment lines starting with one '#' to suit your needs. 4 | ## 5 | 6 | ## 7 | ## Use the XKB_DEFAULT_LAYOUT variable to set the keyboard layout. For example 8 | ## to start with Swedish keyboard layout set it to 'se'. If you are unsure what 9 | ## your country code is, refer to the layout section of: 10 | ## /usr/share/X11/xkb/rules/evdev.lst 11 | ## 12 | ## Multiple keyboard layouts can be set by comma-separating the country codes. 13 | ## If a variant layout is needed, the syntax is layout(variant) 14 | ## If multiple layouts are used, specify the toggle-keybind using 15 | ## XKB_DEFAULT_OPTIONS as show below. 16 | ## 17 | ## For further details, see xkeyboard-config(7) 18 | ## 19 | 20 | # XKB_DEFAULT_LAYOUT=se 21 | # XKB_DEFAULT_LAYOUT=se,us(intl) 22 | # XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle 23 | # XKB_DEFAULT_OPTIONS=grp:shift_caps_toggle 24 | 25 | ## 26 | ## Force Mozilla software like Firefox and Thunderbird to use wayland backend. 27 | ## Firefox (>= v121) enables Wayland by default, but this note is included here 28 | ## for those on non-rolling distributions. 29 | ## 30 | 31 | # MOZ_ENABLE_WAYLAND=1 32 | 33 | ## 34 | ## Set cursor theme and size. Find system icons themes with: 35 | ## `find /usr/share/icons/ -type d -name "cursors"` 36 | ## 37 | 38 | # XCURSOR_THEME=breeze_cursors 39 | # XCURSOR_THEME=capitaine-cursors 40 | # XCURSOR_SIZE=24 41 | 42 | ## 43 | ## Disable hardware cursors. Most users would not want to do this, but if you 44 | ## are experiencing issues with disappearing cursors, this might fix it. 45 | ## 46 | 47 | # WLR_NO_HARDWARE_CURSORS=1 48 | 49 | ## 50 | ## In order for labwc to work out of the box, the environment variable below 51 | ## is set to "1" by default to avoid menus with incorrect offset and blank 52 | ## windows with Java applications such as JetBrains and Intellij Idea. 53 | ## See https://github.com/swaywm/sway/issues/595 54 | ## labwc will not override any already set environment variables, so if you for 55 | ## some reason do not want this, then just set it to "0" (not recommended, but 56 | ## mentioned here for completeness). 57 | ## 58 | 59 | # _JAVA_AWT_WM_NONREPARENTING=0 60 | 61 | ## 62 | ## This allows xdg-desktop-portal-wlr to function (e.g. for screen-recording). 63 | ## It is automatically set to "labwc:wlroots" by labwc though, so it is only 64 | ## included here for completeness. Again, labwc will not over-write an 65 | ## already set environment variable, so if you need it set to something else, 66 | ## then uncomment and adjust. 67 | ## 68 | 69 | # XDG_CURRENT_DESKTOP=labwc:wlroots 70 | 71 | ## 72 | ## This causes a virtual output to be created automatically whenever there 73 | ## are no outputs around. This helps for cases like wayvnc so there is always 74 | ## an output available to connect to. The name can be chosen freely but there 75 | ## must be no duplicate output names, for this reason using VIRTUAL-x or a 76 | ## physical connector name like HDMI-A-1 is not recommended as wlroots may 77 | ## want to create outputs with those names later on which would then fail. 78 | ## 79 | ## Using an output name that starts with NOOP- has the additional benefit 80 | ## that wayvnc will detect it being a virtual output and allow clients to 81 | ## resize the output to match the client resolution. 82 | ## 83 | 84 | # LABWC_FALLBACK_OUTPUT=NOOP-fallback 85 | 86 | -------------------------------------------------------------------------------- /docs/menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 55 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /docs/meson.build: -------------------------------------------------------------------------------- 1 | scdoc = find_program('scdoc', required: get_option('man-pages')) 2 | 3 | if scdoc.found() 4 | sections = [ 5 | '.1', 6 | '-actions.5', 7 | '-config.5', 8 | '-menu.5', 9 | '-theme.5', 10 | ] 11 | foreach s : sections 12 | markdown = 'labwc' + s + '.scd' 13 | manpage = 'labwc' + s 14 | custom_target( 15 | manpage, 16 | input: markdown, 17 | output: manpage, 18 | command: scdoc, 19 | feed: true, 20 | capture: true, 21 | install: true, 22 | install_dir: join_paths(get_option('mandir'), 'man' + s.split('.')[-1]) 23 | ) 24 | endforeach 25 | endif 26 | 27 | install_data( 28 | [ 29 | 'autostart', 30 | 'environment', 31 | 'menu.xml', 32 | 'README', 33 | 'shutdown', 34 | 'themerc', 35 | 'rc.xml', 36 | 'rc.xml.all' 37 | ], 38 | install_dir: get_option('datadir') / 'doc' / meson.project_name() 39 | ) 40 | -------------------------------------------------------------------------------- /docs/rc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 8 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /docs/shutdown: -------------------------------------------------------------------------------- 1 | # Example shutdown file 2 | 3 | # This file is executed as a shell script when labwc is preparing to terminate itself. 4 | # For further details see labwc-config(5). 5 | -------------------------------------------------------------------------------- /docs/xinitrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## This file is run every time labwc launches Xwayland. 4 | ## 5 | ## In the default configuration, Xwayland will be launched lazily, and will 6 | ## terminate after several seconds when no X11 clients are connected. Thus, 7 | ## this script may run repeatedly throughout a single labwc session. 8 | 9 | # Configure the X resource database if a file is provided 10 | # 11 | # NOTE: when Xwayland is launched lazily, an X11 client that triggers its 12 | # launch may attempt to read the resource database before this command can be 13 | # run. In that case, it is recommended to make a symlink to .Xdefaults: 14 | # 15 | # ln -s .Xresources "${HOME}/.Xdefaults" 16 | # 17 | # With this link in place, X11 applications will fall back to reading 18 | # the .Xdefaults file directly when no resource database can be read from the 19 | # server's root window properties. 20 | # 21 | # Invoking xrdb is still useful to pre-load the resource database for 22 | # subsequent clients, because any additional clients launched while the X 23 | # server remains alive will be able to query the database without resorting to 24 | # filesystem access. 25 | 26 | if [ -r "${HOME}/.Xresources" ] && command -v xrdb >/dev/null 2>&1; then 27 | xrdb -merge "${HOME}/.Xresources" 28 | fi 29 | -------------------------------------------------------------------------------- /include/action.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_ACTION_H 3 | #define LABWC_ACTION_H 4 | 5 | #include 6 | #include 7 | 8 | struct view; 9 | struct server; 10 | struct cursor_context; 11 | 12 | struct action { 13 | struct wl_list link; /* 14 | * struct keybinding.actions 15 | * struct mousebinding.actions 16 | * struct menuitem.actions 17 | */ 18 | 19 | uint32_t type; /* enum action_type */ 20 | struct wl_list args; /* struct action_arg.link */ 21 | }; 22 | 23 | struct action *action_create(const char *action_name); 24 | 25 | bool action_is_valid(struct action *action); 26 | 27 | void action_arg_add_str(struct action *action, const char *key, const char *value); 28 | void action_arg_add_actionlist(struct action *action, const char *key); 29 | void action_arg_add_querylist(struct action *action, const char *key); 30 | 31 | struct wl_list *action_get_actionlist(struct action *action, const char *key); 32 | struct wl_list *action_get_querylist(struct action *action, const char *key); 33 | 34 | void action_arg_from_xml_node(struct action *action, const char *nodename, const char *content); 35 | 36 | bool actions_contain_toggle_keybinds(struct wl_list *action_list); 37 | 38 | /** 39 | * actions_run() - Run actions. 40 | * @activator: Target view to apply actions (e.g. Maximize, Focus etc.). 41 | * NULL is allowed, in which case the focused/hovered view is used. 42 | * @ctx: Set for action invocations via mousebindings. Used to get the 43 | * direction of resize or the position of the window menu button for ShowMenu 44 | * action. 45 | */ 46 | void actions_run(struct view *activator, struct server *server, 47 | struct wl_list *actions, struct cursor_context *ctx); 48 | 49 | void action_free(struct action *action); 50 | void action_list_free(struct wl_list *action_list); 51 | 52 | #endif /* LABWC_ACTION_H */ 53 | -------------------------------------------------------------------------------- /include/common/array.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_ARRAY_H 3 | #define LABWC_ARRAY_H 4 | #include 5 | #include 6 | #include 7 | 8 | /* 9 | * Wayland's wl_array API is a bit sparse consisting only of 10 | * - init 11 | * - release 12 | * - add 13 | * - copy 14 | * - for_each 15 | * 16 | * The purpose of this header is the gather any generic wl_array helpers we 17 | * create. 18 | * 19 | * We take the liberty of using the wl_ suffix here to make it look a bit 20 | * prettier. If Wayland extend the API in future, we will sort the clash then. 21 | */ 22 | 23 | /** 24 | * wl_array_len() - return length of wl_array 25 | * @array: wl_array for which to calculate length 26 | * Note: The pointer type might not be 'char' but this is the approach that 27 | * wl_array_for_each() takes, so we align with their style. 28 | */ 29 | static inline size_t 30 | wl_array_len(struct wl_array *array) 31 | { 32 | return array->size / sizeof(const char *); 33 | } 34 | 35 | /** 36 | * Iterates in reverse over an array. 37 | * @pos: pointer that each array element will be assigned to 38 | * @array: wl_array to iterate over 39 | */ 40 | #define wl_array_for_each_reverse(pos, array) \ 41 | for (pos = !(array)->data ? NULL \ 42 | : (void *)((const char *)(array)->data + (array)->size - sizeof(pos)); \ 43 | pos && (const char *)pos >= (const char *)(array)->data; \ 44 | (pos)--) 45 | 46 | /** 47 | * array_add() - add item to wl_array and exit on allocation error 48 | * @_arr: wl_array to add the item to 49 | * @_val: the item to add to the array 50 | * 51 | * Let us illustrate the function of this macro by an example: 52 | * 53 | * uint32_t value = 5; 54 | * array_add(array, value); 55 | * 56 | * ...is the equivalent of the code below which is how you would 57 | * otherwise use the wl_array API: 58 | * 59 | * uint32_t *elm = wl_array_add(array, sizeof(uint32_t)); 60 | * if (!elm) { 61 | * perror("failed to allocate memory"); 62 | * exit(EXIT_FAILURE); 63 | * } 64 | * *elm = value; 65 | */ 66 | #define array_add(_arr, _val) do { \ 67 | __typeof__(_val) *_entry = wl_array_add( \ 68 | (_arr), sizeof(__typeof__(_val))); \ 69 | if (!_entry) { \ 70 | perror("Failed to allocate memory"); \ 71 | exit(EXIT_FAILURE); \ 72 | } \ 73 | *_entry = (_val); \ 74 | } while (0) 75 | 76 | #endif /* LABWC_ARRAY_H */ 77 | -------------------------------------------------------------------------------- /include/common/border.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_BORDER_H 3 | #define LABWC_BORDER_H 4 | 5 | struct border { 6 | int top; 7 | int right; 8 | int bottom; 9 | int left; 10 | }; 11 | 12 | #endif /* LABWC_BORDER_H */ 13 | -------------------------------------------------------------------------------- /include/common/box.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_BOX_H 3 | #define LABWC_BOX_H 4 | 5 | #include 6 | 7 | bool box_contains(struct wlr_box *box_super, struct wlr_box *box_sub); 8 | 9 | bool box_intersects(struct wlr_box *box_a, struct wlr_box *box_b); 10 | 11 | /* Returns the bounding box of 2 boxes */ 12 | void box_union(struct wlr_box *box_dest, struct wlr_box *box_a, 13 | struct wlr_box *box_b); 14 | 15 | /* 16 | * Fits and centers a content box (width & height) within a bounding box 17 | * (max_width & max_height). The content box is downscaled if necessary 18 | * (preserving aspect ratio) but not upscaled. 19 | * 20 | * The returned x & y coordinates are the centered content position 21 | * relative to the top-left corner of the bounding box. 22 | */ 23 | struct wlr_box box_fit_within(int width, int height, int max_width, 24 | int max_height); 25 | 26 | #endif /* LABWC_BOX_H */ 27 | -------------------------------------------------------------------------------- /include/common/buf.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | * Very simple C string buffer implementation 4 | * 5 | * Copyright Johan Malm 2020 6 | */ 7 | 8 | #ifndef LABWC_BUF_H 9 | #define LABWC_BUF_H 10 | 11 | struct buf { 12 | /** 13 | * Pointer to underlying string buffer. If alloc != 0, then 14 | * this was allocated via malloc(). 15 | */ 16 | char *data; 17 | /** 18 | * Allocated length of buf. If zero, data was not allocated 19 | * (either NULL or literal empty string). 20 | */ 21 | int alloc; 22 | /** 23 | * Length of string contents (not including terminating NUL). 24 | * Currently this must be zero if alloc is zero (i.e. non-empty 25 | * literal strings are not allowed). 26 | */ 27 | int len; 28 | }; 29 | 30 | /** Value used to initialize a struct buf to an empty string */ 31 | #define BUF_INIT ((struct buf){.data = ""}) 32 | 33 | /** 34 | * buf_expand_tilde - expand ~ in buffer 35 | * @s: buffer 36 | */ 37 | void buf_expand_tilde(struct buf *s); 38 | 39 | /** 40 | * buf_expand_shell_variables - expand $foo and ${foo} in buffer 41 | * @s: buffer 42 | * Note: $$ is not handled 43 | */ 44 | void buf_expand_shell_variables(struct buf *s); 45 | 46 | /** 47 | * buf_add_fmt - add format string to C string buffer 48 | * @s: buffer 49 | * @fmt: format string to be added 50 | */ 51 | void buf_add_fmt(struct buf *s, const char *fmt, ...); 52 | 53 | /** 54 | * buf_add - add data to C string buffer 55 | * @s: buffer 56 | * @data: data to be added 57 | */ 58 | void buf_add(struct buf *s, const char *data); 59 | 60 | /** 61 | * buf_add_char - add single char to C string buffer 62 | * @s: buffer 63 | * @data: char to be added 64 | */ 65 | void buf_add_char(struct buf *s, char data); 66 | 67 | /** 68 | * buf_clear - clear the buffer, internal allocations are preserved 69 | * @s: buffer 70 | * 71 | * The buffer will be set to a NUL-terminated empty string. 72 | * 73 | * This is the appropriate function to call to re-use the buffer 74 | * in a loop or similar situations as it reuses the existing heap 75 | * allocation. 76 | */ 77 | void buf_clear(struct buf *s); 78 | 79 | /** 80 | * buf_reset - reset the buffer, internal allocations are free'd 81 | * @s: buffer 82 | * 83 | * The buffer will be re-initialized to BUF_INIT (empty string). 84 | * 85 | * Inside a loop, consider using buf_clear() instead, as it allows 86 | * reusing the existing heap allocation. buf_reset() should still be 87 | * called after exiting the loop. 88 | */ 89 | void buf_reset(struct buf *s); 90 | 91 | /** 92 | * buf_move - move the contents of src to dst, freeing any previous 93 | * allocation of dst and resetting src to BUF_INIT. 94 | * 95 | * dst must either have been initialized with BUF_INIT 96 | * or zeroed out (e.g. created by znew() or on the stack 97 | * with something like struct buf foo = {0}). 98 | */ 99 | void buf_move(struct buf *dst, struct buf *src); 100 | 101 | #endif /* LABWC_BUF_H */ 102 | -------------------------------------------------------------------------------- /include/common/dir.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_DIR_H 3 | #define LABWC_DIR_H 4 | 5 | #include 6 | 7 | struct path { 8 | char *string; 9 | struct wl_list link; 10 | }; 11 | 12 | struct wl_list *paths_get_prev(struct wl_list *elm); 13 | struct wl_list *paths_get_next(struct wl_list *elm); 14 | 15 | void paths_config_create(struct wl_list *paths, const char *filename); 16 | void paths_theme_create(struct wl_list *paths, const char *theme_name, 17 | const char *filename); 18 | void paths_destroy(struct wl_list *paths); 19 | 20 | #endif /* LABWC_DIR_H */ 21 | -------------------------------------------------------------------------------- /include/common/direction.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_DIRECTION_H 3 | #define LABWC_DIRECTION_H 4 | 5 | #include "view.h" 6 | 7 | enum wlr_direction direction_from_view_edge(enum view_edge edge); 8 | enum wlr_direction direction_get_opposite(enum wlr_direction direction); 9 | 10 | #endif /* LABWC_DIRECTION_H */ 11 | -------------------------------------------------------------------------------- /include/common/fd-util.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_FD_UTIL_H 3 | #define LABWC_FD_UTIL_H 4 | 5 | void increase_nofile_limit(void); 6 | void restore_nofile_limit(void); 7 | 8 | #endif /* LABWC_FD_UTIL_H */ 9 | -------------------------------------------------------------------------------- /include/common/file-helpers.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_FILE_HELPERS_H 3 | #define LABWC_FILE_HELPERS_H 4 | #include 5 | 6 | /** 7 | * file_exists() - Test if file exists. 8 | * @filename: Name of file to test. 9 | */ 10 | bool file_exists(const char *filename); 11 | 12 | #endif /* LABWC_FILE_HELPERS_H */ 13 | -------------------------------------------------------------------------------- /include/common/font.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_FONT_H 3 | #define LABWC_FONT_H 4 | 5 | struct lab_data_buffer; 6 | 7 | enum font_slant { 8 | FONT_SLANT_NORMAL = 0, 9 | FONT_SLANT_ITALIC, 10 | FONT_SLANT_OBLIQUE 11 | }; 12 | 13 | enum font_weight { 14 | FONT_WEIGHT_NORMAL = 0, 15 | FONT_WEIGHT_BOLD 16 | }; 17 | 18 | struct font { 19 | char *name; 20 | int size; 21 | enum font_slant slant; 22 | enum font_weight weight; 23 | }; 24 | 25 | struct _PangoFontDescription *font_to_pango_desc(struct font *font); 26 | 27 | /** 28 | * font_height - get font vertical extents 29 | * @font: description of font including family name and size 30 | */ 31 | int font_height(struct font *font); 32 | 33 | /** 34 | * font_width - get font horizontal extents 35 | * @font: description of font including family name and size 36 | */ 37 | int font_width(struct font *font, const char *string); 38 | 39 | /** 40 | * font_buffer_create - Create ARGB8888 lab_data_buffer using pango 41 | * @buffer: buffer pointer 42 | * @max_width: max allowable width; will be ellipsized if longer 43 | * @text: text to be generated as texture 44 | * @font: font description 45 | * @color: foreground color in rgba format 46 | * @bg_color: background color in rgba format 47 | * @arrow: arrow (utf8) character to show or NULL for none 48 | */ 49 | void font_buffer_create(struct lab_data_buffer **buffer, int max_width, 50 | const char *text, struct font *font, const float *color, 51 | const float *bg_color, const char *arrow, double scale); 52 | 53 | /** 54 | * font_finish - free some font related resources 55 | * Note: use on exit 56 | */ 57 | void font_finish(void); 58 | 59 | #endif /* LABWC_FONT_H */ 60 | -------------------------------------------------------------------------------- /include/common/grab-file.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | * Read file into memory 4 | * 5 | * Copyright Johan Malm 2020 6 | */ 7 | 8 | #ifndef LABWC_GRAB_FILE_H 9 | #define LABWC_GRAB_FILE_H 10 | 11 | #include "common/buf.h" 12 | 13 | /** 14 | * grab_file - read file into memory buffer 15 | * @filename: file to read 16 | * Free returned buffer with buf_reset(). 17 | */ 18 | struct buf grab_file(const char *filename); 19 | 20 | #endif /* LABWC_GRAB_FILE_H */ 21 | -------------------------------------------------------------------------------- /include/common/graphic-helpers.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_GRAPHIC_HELPERS_H 3 | #define LABWC_GRAPHIC_HELPERS_H 4 | 5 | #include 6 | #include 7 | 8 | struct wlr_scene_tree; 9 | struct wlr_scene_rect; 10 | struct wlr_fbox; 11 | 12 | struct multi_rect { 13 | struct wlr_scene_tree *tree; 14 | int line_width; /* read-only */ 15 | 16 | /* Private */ 17 | struct wlr_scene_rect *top[3]; 18 | struct wlr_scene_rect *bottom[3]; 19 | struct wlr_scene_rect *left[3]; 20 | struct wlr_scene_rect *right[3]; 21 | struct wl_listener destroy; 22 | }; 23 | 24 | /** 25 | * Create a new multi_rect. 26 | * A multi_rect consists of 3 nested rectangular outlines. 27 | * Each of the rectangular outlines is using the same @line_width 28 | * but its own color based on the @colors argument. 29 | * 30 | * The multi-rect can be positioned by positioning multi_rect->tree->node. 31 | * 32 | * It can be destroyed by destroying its tree node (or one of its 33 | * parent nodes). Once the tree node has been destroyed the struct 34 | * will be free'd automatically. 35 | */ 36 | struct multi_rect *multi_rect_create(struct wlr_scene_tree *parent, 37 | float *colors[3], int line_width); 38 | 39 | void multi_rect_set_size(struct multi_rect *rect, int width, int height); 40 | 41 | /** 42 | * Sets the cairo color. 43 | * Splits a float[4] single color array into its own arguments 44 | */ 45 | void set_cairo_color(cairo_t *cairo, const float *color); 46 | 47 | /* Draws a border with a specified line width */ 48 | void draw_cairo_border(cairo_t *cairo, struct wlr_fbox fbox, double line_width); 49 | 50 | struct lab_data_buffer; 51 | 52 | struct surface_context { 53 | bool is_duplicate; 54 | cairo_surface_t *surface; 55 | }; 56 | 57 | struct surface_context get_cairo_surface_from_lab_data_buffer( 58 | struct lab_data_buffer *buffer); 59 | 60 | #endif /* LABWC_GRAPHIC_HELPERS_H */ 61 | -------------------------------------------------------------------------------- /include/common/list.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_LIST_H 3 | #define LABWC_LIST_H 4 | #include 5 | 6 | /** 7 | * wl_list_append() - add a new element to the end of a list 8 | * @list: list head to add it before 9 | * @elm: new element to be added (link of the containing struct to be precise) 10 | * 11 | * Note: In labwc, most lists are queues where we want to add new elements to 12 | * the end of the list. As wl_list_insert() adds elements at the front of the 13 | * list (like a stack) - without this helper-function - we have to use 14 | * wl_list_insert(list.prev, element) which is verbose and not intuitive to 15 | * anyone new to this API. 16 | */ 17 | static inline void 18 | wl_list_append(struct wl_list *list, struct wl_list *elm) 19 | { 20 | wl_list_insert(list->prev, elm); 21 | } 22 | 23 | #endif /* LABWC_LIST_H */ 24 | -------------------------------------------------------------------------------- /include/common/macros.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_MACROS_H 3 | #define LABWC_MACROS_H 4 | 5 | #include 6 | 7 | /** 8 | * ARRAY_SIZE() - Get the number of elements in array. 9 | * @arr: array to be sized 10 | * 11 | * This does not work on pointers. 12 | * 13 | * Recent versions of GCC and clang support -Werror=sizeof-pointer-div 14 | * and thus avoids using constructs such as: 15 | * 16 | * #define same_type(a, b) (__builtin_types_compatible_p(typeof(a), typeof(b)) == 1) 17 | * #define ARRAY_SIZE(a) ({ static_assert(!same_type(a, &(a)[0])); sizeof(a) / sizeof(a[0]); }) 18 | */ 19 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) 20 | 21 | /** 22 | * CONNECT_SIGNAL() - Connect a signal handler function to a wl_signal. 23 | * 24 | * @param src Signal emitter (struct containing wl_signal) 25 | * @param dest Signal receiver (struct containing wl_listener) 26 | * @param name Signal name 27 | * 28 | * This assumes that the common pattern is followed where: 29 | * - the wl_signal is (*src).events. 30 | * - the wl_listener is (*dest). 31 | * - the signal handler function is named handle_ 32 | */ 33 | #define CONNECT_SIGNAL(src, dest, name) \ 34 | (dest)->name.notify = handle_##name; \ 35 | wl_signal_add(&(src)->events.name, &(dest)->name) 36 | 37 | /** 38 | * MIN() - Minimum of two values. 39 | * 40 | * @note Arguments may be evaluated twice. 41 | */ 42 | #ifndef MIN 43 | #define MIN(a, b) (((a) < (b)) ? (a) : (b)) 44 | #endif 45 | 46 | /** 47 | * MAX() - Maximum of two values. 48 | * 49 | * @note Arguments may be evaluated twice. 50 | */ 51 | #ifndef MAX 52 | #define MAX(a, b) (((a) > (b)) ? (a) : (b)) 53 | #endif 54 | 55 | /** 56 | * BOUNDED_INT() - Returns true if an integer is not INT_MAX or INT_MIN 57 | * 58 | * @param val Value to test (integer) 59 | */ 60 | #ifndef BOUNDED_INT 61 | #define BOUNDED_INT(a) ((a) < INT_MAX && (a) > INT_MIN) 62 | #endif 63 | 64 | #endif /* LABWC_MACROS_H */ 65 | -------------------------------------------------------------------------------- /include/common/match.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_MATCH_H 3 | #define LABWC_MATCH_H 4 | 5 | #include 6 | 7 | /** 8 | * match_glob() - Pattern match using '*' wildcards and '?' jokers. 9 | * @pattern: Pattern to match against. 10 | * @string: String to search. 11 | * Note: Comparison case-insensitive. 12 | */ 13 | bool match_glob(const char *pattern, const char *string); 14 | 15 | #endif /* LABWC_MATCH_H */ 16 | -------------------------------------------------------------------------------- /include/common/mem.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_MEM_H 3 | #define LABWC_MEM_H 4 | 5 | #include 6 | 7 | /* 8 | * As defined in busybox, weston, etc. 9 | * Allocates zero-filled memory; calls exit() on error. 10 | * Returns NULL only if (size == 0). 11 | */ 12 | void *xzalloc(size_t size); 13 | 14 | /* 15 | * Type-safe macros in the style of C++ new/new[]. 16 | * Both allocate zero-filled memory for object(s) the same size as 17 | * , which may be either a type name or value expression. 18 | * 19 | * znew() allocates space for one object. 20 | * znew_n() allocates space for an array of objects. 21 | * 22 | * Examples: 23 | * struct wlr_box *box = znew(*box); 24 | * char *buf = znew_n(char, 80); 25 | */ 26 | #define znew(expr) ((__typeof__(expr) *)xzalloc(sizeof(expr))) 27 | #define znew_n(expr, n) ((__typeof__(expr) *)xzalloc((n) * sizeof(expr))) 28 | 29 | /* 30 | * As defined in FreeBSD. 31 | * Like realloc(), but calls exit() on error. 32 | * Returns NULL only if (size == 0). 33 | * Does NOT zero-fill memory. 34 | */ 35 | void *xrealloc(void *ptr, size_t size); 36 | 37 | /* malloc() is a specific case of realloc() */ 38 | #define xmalloc(size) xrealloc(NULL, (size)) 39 | 40 | /* 41 | * As defined in FreeBSD. 42 | * Allocates a copy of ; calls exit() on error. 43 | * Requires (str != NULL) and never returns NULL. 44 | */ 45 | char *xstrdup(const char *str); 46 | 47 | /* 48 | * Frees memory pointed to by and sets to NULL. 49 | * Does nothing if is already NULL. 50 | */ 51 | #define zfree(ptr) do { \ 52 | free(ptr); (ptr) = NULL; \ 53 | } while (0) 54 | 55 | #endif /* LABWC_MEM_H */ 56 | -------------------------------------------------------------------------------- /include/common/nodename.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_NODENAME_H 3 | #define LABWC_NODENAME_H 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | /** 10 | * nodename - give xml node an ascii name 11 | * @node: xml-node 12 | * @buf: buffer to receive the name 13 | * @len: size of buffer 14 | * 15 | * For example, the xml structure would return the 16 | * name c.b.a 17 | */ 18 | char *nodename(xmlNode * node, char *buf, int len); 19 | 20 | #endif /* LABWC_NODENAME_H */ 21 | -------------------------------------------------------------------------------- /include/common/parse-bool.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_PARSE_BOOL_H 3 | #define LABWC_PARSE_BOOL_H 4 | #include 5 | #include "view.h" 6 | 7 | /** 8 | * parse_three_state() - Parse boolean value of string as a three-state enum. 9 | * @string: String to interpret. This check is case-insensitive. 10 | * 11 | * Return: LAB_STATE_DISABLED for false; LAB_STATE_ENABLED for true; 12 | * LAB_STATE_UNSPECIFIED for non-boolean 13 | */ 14 | enum three_state parse_three_state(const char *str); 15 | 16 | /** 17 | * parse_bool() - Parse boolean value of string. 18 | * @string: String to interpret. This check is case-insensitive. 19 | * @default_value: Default value to use if string is not a recognised boolean. 20 | * Use -1 to avoid setting a default value. 21 | * 22 | * Return: 0 for false; 1 for true; -1 for non-boolean 23 | */ 24 | int parse_bool(const char *str, int default_value); 25 | 26 | /** 27 | * set_bool() - Parse boolean text and set variable iff text is valid boolean 28 | * @string: Boolean text to interpret. 29 | * @variable: Variable to set. 30 | */ 31 | void set_bool(const char *str, bool *variable); 32 | void set_bool_as_int(const char *str, int *variable); 33 | 34 | #endif /* LABWC_PARSE_BOOL_H */ 35 | -------------------------------------------------------------------------------- /include/common/parse-double.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_PARSE_DOUBLE_H 3 | #define LABWC_PARSE_DOUBLE_H 4 | #include 5 | #include 6 | 7 | /** 8 | * set_double() - Parse double-precision value of string. 9 | * @str: String to parse 10 | * @val: Storage for parsed value 11 | * 12 | * Return: true if string was parsed, false if not 13 | * 14 | * NOTE: If this function returns false, the value at *val will be untouched. 15 | */ 16 | bool set_double(const char *str, double *val); 17 | 18 | static inline bool 19 | set_float(const char *str, float *val) 20 | { 21 | assert(val); 22 | 23 | double d; 24 | if (set_double(str, &d)) { 25 | *val = d; 26 | return true; 27 | } 28 | 29 | return false; 30 | } 31 | 32 | #endif /* LABWC_PARSE_DOUBLE_H */ 33 | -------------------------------------------------------------------------------- /include/common/scaled-font-buffer.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_SCALED_FONT_BUFFER_H 3 | #define LABWC_SCALED_FONT_BUFFER_H 4 | 5 | #include "common/font.h" 6 | 7 | struct wlr_scene_tree; 8 | struct wlr_scene_buffer; 9 | struct scaled_scene_buffer; 10 | 11 | struct scaled_font_buffer { 12 | struct wlr_scene_buffer *scene_buffer; 13 | int width; /* unscaled, read only */ 14 | int height; /* unscaled, read only */ 15 | 16 | /* Private */ 17 | char *text; 18 | int max_width; 19 | float color[4]; 20 | float bg_color[4]; 21 | char *arrow; 22 | struct font font; 23 | struct scaled_scene_buffer *scaled_buffer; 24 | }; 25 | 26 | /** 27 | * Create an auto scaling font buffer, providing a wlr_scene_buffer node for 28 | * display. It gets destroyed automatically when the backing scaled_scene_buffer 29 | * is being destroyed which in turn happens automatically when the backing 30 | * wlr_scene_buffer (or one of its parents) is being destroyed. 31 | * 32 | * To actually show some text, scaled_font_buffer_update() has to be called. 33 | * 34 | */ 35 | struct scaled_font_buffer *scaled_font_buffer_create(struct wlr_scene_tree *parent); 36 | 37 | /** 38 | * Update an existing auto scaling font buffer. 39 | * 40 | * No steps are taken to detect if its actually required to render a new buffer. 41 | * This should be done by the caller to prevent useless recreation of the same 42 | * buffer in case nothing actually changed. 43 | * 44 | * Some basic checks could be something like 45 | * - truncated = buffer->width == max_width 46 | * - text_changed = strcmp(old_text, new_text) 47 | * - font and color the same 48 | */ 49 | void scaled_font_buffer_update(struct scaled_font_buffer *self, const char *text, 50 | int max_width, struct font *font, const float *color, 51 | const float *bg_color, const char *arrow); 52 | 53 | /** 54 | * Update the max width of an existing auto scaling font buffer 55 | * and force a new render. 56 | * 57 | * No steps are taken to detect if its actually required to render a new buffer. 58 | */ 59 | void scaled_font_buffer_set_max_width(struct scaled_font_buffer *self, int max_width); 60 | 61 | #endif /* LABWC_SCALED_FONT_BUFFER_H */ 62 | -------------------------------------------------------------------------------- /include/common/scene-helpers.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_SCENE_HELPERS_H 3 | #define LABWC_SCENE_HELPERS_H 4 | 5 | #include 6 | 7 | struct wlr_scene_node; 8 | struct wlr_surface; 9 | struct wlr_scene_output; 10 | struct wlr_output_state; 11 | 12 | struct wlr_surface *lab_wlr_surface_from_node(struct wlr_scene_node *node); 13 | 14 | /** 15 | * lab_get_prev_node - return previous (sibling) node 16 | * @node: node to find the previous node from 17 | * Return NULL if previous link is list-head which means node is bottom-most 18 | */ 19 | struct wlr_scene_node *lab_wlr_scene_get_prev_node(struct wlr_scene_node *node); 20 | 21 | /* A variant of wlr_scene_output_commit() that respects wlr_output->pending */ 22 | bool lab_wlr_scene_output_commit(struct wlr_scene_output *scene_output, 23 | struct wlr_output_state *output_state); 24 | 25 | #endif /* LABWC_SCENE_HELPERS_H */ 26 | -------------------------------------------------------------------------------- /include/common/set.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_SET_H 3 | #define LABWC_SET_H 4 | 5 | #include 6 | #include 7 | 8 | #define LAB_SET_MAX_SIZE 16 9 | 10 | struct lab_set { 11 | uint32_t values[LAB_SET_MAX_SIZE]; 12 | int size; 13 | }; 14 | 15 | bool lab_set_contains(struct lab_set *set, uint32_t value); 16 | void lab_set_add(struct lab_set *set, uint32_t value); 17 | void lab_set_remove(struct lab_set *set, uint32_t value); 18 | 19 | #endif /* LABWC_SET_H */ 20 | -------------------------------------------------------------------------------- /include/common/spawn.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_SPAWN_H 3 | #define LABWC_SPAWN_H 4 | 5 | #include 6 | 7 | /** 8 | * spawn_primary_client - execute asynchronously 9 | * @command: command to be executed 10 | */ 11 | pid_t spawn_primary_client(const char *command); 12 | 13 | /** 14 | * spawn_async_no_shell - execute asynchronously 15 | * @command: command to be executed 16 | */ 17 | void spawn_async_no_shell(char const *command); 18 | 19 | /** 20 | * spawn_piped - execute asyncronously 21 | * @command: command to be executed 22 | * @pipe_fd: set to the read end of a pipe 23 | * connected to stdout of the command 24 | * 25 | * Notes: 26 | * The returned pid_t has to be waited for to 27 | * not produce zombies and the pipe_fd has to 28 | * be closed. spawn_piped_close() can be used 29 | * to ensure both. 30 | */ 31 | pid_t spawn_piped(const char *command, int *pipe_fd); 32 | 33 | /** 34 | * spawn_piped_close - clean up a previous 35 | * spawn_piped() process 36 | * @pid: will be waitpid()'d for 37 | * @pipe_fd: will be close()'d 38 | */ 39 | void spawn_piped_close(pid_t pid, int pipe_fd); 40 | 41 | #endif /* LABWC_SPAWN_H */ 42 | -------------------------------------------------------------------------------- /include/common/string-helpers.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_STRING_HELPERS_H 3 | #define LABWC_STRING_HELPERS_H 4 | #include 5 | 6 | /** 7 | * string_null_or_empty() - Check if string is NULL or empty 8 | * @s: string to check 9 | */ 10 | bool string_null_or_empty(const char *s); 11 | 12 | /** 13 | * trim_last_field() - Trim last field of string splitting on provided delim 14 | * @buf: string to trim 15 | * @delim: delimitator 16 | * 17 | * Example: With delim='_' and buf="foo_bar_baz" the return value is "foo_bar" 18 | */ 19 | void trim_last_field(char *buf, char delim); 20 | 21 | /** 22 | * string_strip - strip white space left and right 23 | * Note: this function does a left skip, so the returning pointer cannot be 24 | * used to free any allocated memory 25 | */ 26 | char *string_strip(char *s); 27 | 28 | /** 29 | * string_truncate_at_pattern - remove pattern and everything after it 30 | * @buf: pointer to buffer 31 | * @pattern: string to remove 32 | */ 33 | void string_truncate_at_pattern(char *buf, const char *pattern); 34 | 35 | /** 36 | * strdup_printf - allocate and write to buffer in printf format 37 | * @fmt: printf-style format. 38 | * 39 | * Similar to the standard C sprintf() function but safer as it calculates the 40 | * maximum space required and allocates memory to hold the output. 41 | * The user must free the returned string. 42 | * Returns NULL on error. 43 | */ 44 | char *strdup_printf(const char *fmt, ...); 45 | 46 | /** 47 | * str_join - format and join an array of strings with a separator 48 | * @parts: NULL-terminated array of string parts to be joined 49 | * @fmt: printf-style format string applied to each part 50 | * @sep: separator inserted between parts when joining 51 | * 52 | * A new string is allocated to hold the joined result. The user must free the 53 | * returned string. Returns NULL on error. 54 | * 55 | * Each part of the array is converted via the equivalent of sprintf(output, 56 | * fmt, part), so fmt should include a single "%s" format specification. If fmt 57 | * is NULL, a default "%s" will be used to copy each part verbatim. 58 | * 59 | * The separator is arbitrary. When the separator is NULL, a single space will 60 | * be used. 61 | */ 62 | char *str_join(const char *const parts[], 63 | const char *restrict fmt, const char *restrict sep); 64 | 65 | /** 66 | * str_endswith - indicate whether a string ends with a given suffix 67 | * @string: string to test 68 | * @suffix: suffix to expect in string 69 | * 70 | * If suffix is "" or NULL, this method always returns true; otherwise, this 71 | * method returns true if and only if the full suffix exists at the end of the 72 | * string. 73 | */ 74 | bool str_endswith(const char *const string, const char *const suffix); 75 | 76 | #endif /* LABWC_STRING_HELPERS_H */ 77 | -------------------------------------------------------------------------------- /include/common/surface-helpers.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_SURFACE_HELPERS_H 3 | #define LABWC_SURFACE_HELPERS_H 4 | 5 | struct wlr_surface; 6 | struct wlr_layer_surface_v1; 7 | 8 | /** 9 | * subsurface_parent_layer() - Get wlr_layer_surface from layer-subsurface 10 | * @wlr_surface: The wlr_surface of the wlr_subsurface for which to get the 11 | * layer-surface. 12 | */ 13 | struct wlr_layer_surface_v1 *subsurface_parent_layer( 14 | struct wlr_surface *wlr_surface); 15 | 16 | #endif /* LABWC_SURFACE_HELPERS_H */ 17 | -------------------------------------------------------------------------------- /include/config/keybind.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_KEYBIND_H 3 | #define LABWC_KEYBIND_H 4 | 5 | #include 6 | #include 7 | 8 | #define MAX_KEYSYMS 32 9 | #define MAX_KEYCODES 16 10 | 11 | struct server; 12 | 13 | struct keybind { 14 | uint32_t modifiers; 15 | xkb_keysym_t *keysyms; 16 | size_t keysyms_len; 17 | bool use_syms_only; 18 | xkb_keycode_t keycodes[MAX_KEYCODES]; 19 | size_t keycodes_len; 20 | int keycodes_layout; 21 | bool allow_when_locked; 22 | struct wl_list actions; /* struct action.link */ 23 | struct wl_list link; /* struct rcxml.keybinds */ 24 | bool on_release; 25 | }; 26 | 27 | /** 28 | * keybind_create - parse keybind and add to linked list 29 | * @keybind: key combination 30 | */ 31 | struct keybind *keybind_create(const char *keybind); 32 | 33 | /** 34 | * parse_modifier - parse a string containing a single modifier name (e.g. "S") 35 | * into the represented modifier value. returns 0 for invalid modifier names. 36 | * @symname: modifier name 37 | */ 38 | uint32_t parse_modifier(const char *symname); 39 | 40 | bool keybind_the_same(struct keybind *a, struct keybind *b); 41 | 42 | void keybind_update_keycodes(struct server *server); 43 | #endif /* LABWC_KEYBIND_H */ 44 | -------------------------------------------------------------------------------- /include/config/libinput.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_LIBINPUT_H 3 | #define LABWC_LIBINPUT_H 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | enum lab_libinput_device_type { 10 | LAB_LIBINPUT_DEVICE_NONE = 0, 11 | LAB_LIBINPUT_DEVICE_DEFAULT, 12 | LAB_LIBINPUT_DEVICE_TOUCH, 13 | LAB_LIBINPUT_DEVICE_TOUCHPAD, 14 | LAB_LIBINPUT_DEVICE_NON_TOUCH, 15 | }; 16 | 17 | struct libinput_category { 18 | enum lab_libinput_device_type type; 19 | char *name; 20 | struct wl_list link; 21 | float pointer_speed; 22 | int natural_scroll; 23 | int left_handed; 24 | enum libinput_config_tap_state tap; 25 | enum libinput_config_tap_button_map tap_button_map; 26 | int tap_and_drag; /* -1 or libinput_config_drag_state */ 27 | int drag_lock; /* -1 or libinput_config_drag_lock_state */ 28 | int accel_profile; /* -1 or libinput_config_accel_profile */ 29 | int middle_emu; /* -1 or libinput_config_middle_emulation_state */ 30 | int dwt; /* -1 or libinput_config_dwt_state */ 31 | int click_method; /* -1 or libinput_config_click_method */ 32 | int send_events_mode; /* -1 or libinput_config_send_events_mode */ 33 | bool have_calibration_matrix; 34 | double scroll_factor; 35 | float calibration_matrix[6]; 36 | }; 37 | 38 | enum lab_libinput_device_type get_device_type(const char *s); 39 | struct libinput_category *libinput_category_create(void); 40 | struct libinput_category *libinput_category_get_default(void); 41 | 42 | #endif /* LABWC_LIBINPUT_H */ 43 | -------------------------------------------------------------------------------- /include/config/mousebind.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_MOUSEBIND_H 3 | #define LABWC_MOUSEBIND_H 4 | 5 | #include 6 | #include "ssd.h" 7 | #include "config/keybind.h" 8 | 9 | enum mouse_event { 10 | MOUSE_ACTION_NONE = 0, 11 | MOUSE_ACTION_DOUBLECLICK, 12 | MOUSE_ACTION_CLICK, 13 | MOUSE_ACTION_PRESS, 14 | MOUSE_ACTION_RELEASE, 15 | MOUSE_ACTION_DRAG, 16 | MOUSE_ACTION_SCROLL, 17 | }; 18 | 19 | enum direction { 20 | LAB_DIRECTION_INVALID = 0, 21 | LAB_DIRECTION_LEFT, 22 | LAB_DIRECTION_RIGHT, 23 | LAB_DIRECTION_UP, 24 | LAB_DIRECTION_DOWN, 25 | }; 26 | 27 | struct mousebind { 28 | enum ssd_part_type context; 29 | 30 | /* ex: BTN_LEFT, BTN_RIGHT from linux/input_event_codes.h */ 31 | uint32_t button; 32 | 33 | /* scroll direction; considered instead of button for scroll events */ 34 | enum direction direction; 35 | 36 | /* ex: WLR_MODIFIER_SHIFT | WLR_MODIFIER_LOGO */ 37 | uint32_t modifiers; 38 | 39 | /* ex: doubleclick, press, drag */ 40 | enum mouse_event mouse_event; 41 | struct wl_list actions; /* struct action.link */ 42 | 43 | struct wl_list link; /* struct rcxml.mousebinds */ 44 | bool pressed_in_context; /* used in click events */ 45 | }; 46 | 47 | enum mouse_event mousebind_event_from_str(const char *str); 48 | uint32_t mousebind_button_from_str(const char *str, uint32_t *modifiers); 49 | enum direction mousebind_direction_from_str(const char *str, uint32_t *modifiers); 50 | struct mousebind *mousebind_create(const char *context); 51 | bool mousebind_the_same(struct mousebind *a, struct mousebind *b); 52 | 53 | #endif /* LABWC_MOUSEBIND_H */ 54 | -------------------------------------------------------------------------------- /include/config/session.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_SESSION_H 3 | #define LABWC_SESSION_H 4 | 5 | struct server; 6 | 7 | /** 8 | * session_run_script - run a named session script (or, in merge-config mode, 9 | * all named session scripts) from the XDG path. 10 | */ 11 | void session_run_script(const char *script); 12 | 13 | /** 14 | * session_environment_init - set environment variables based on = 15 | * pairs in `${XDG_CONFIG_DIRS:-/etc/xdg}/labwc/environment` with user override 16 | * in `${XDG_CONFIG_HOME:-$HOME/.config}` 17 | */ 18 | void session_environment_init(void); 19 | 20 | /** 21 | * session_autostart_init - run autostart file as shell script 22 | * Note: Same as `sh ~/.config/labwc/autostart` (or equivalent XDG config dir) 23 | */ 24 | void session_autostart_init(struct server *server); 25 | 26 | /** 27 | * session_shutdown - run session shutdown file as shell script 28 | * Note: Same as `sh ~/.config/labwc/shutdown` (or equivalent XDG config dir) 29 | */ 30 | void session_shutdown(struct server *server); 31 | 32 | #endif /* LABWC_SESSION_H */ 33 | -------------------------------------------------------------------------------- /include/config/tablet-tool.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_TABLET_TOOL_CONFIG_H 3 | #define LABWC_TABLET_TOOL_CONFIG_H 4 | 5 | #include 6 | 7 | enum motion { 8 | LAB_TABLET_MOTION_ABSOLUTE = 0, 9 | LAB_TABLET_MOTION_RELATIVE, 10 | }; 11 | 12 | enum motion tablet_parse_motion(const char *name); 13 | 14 | #endif /* LABWC_TABLET_TOOL_CONFIG_H */ 15 | -------------------------------------------------------------------------------- /include/config/tablet.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_TABLET_CONFIG_H 3 | #define LABWC_TABLET_CONFIG_H 4 | 5 | #include 6 | 7 | enum rotation { 8 | LAB_ROTATE_NONE = 0, 9 | LAB_ROTATE_90, 10 | LAB_ROTATE_180, 11 | LAB_ROTATE_270, 12 | }; 13 | 14 | #define BUTTON_MAP_MAX 16 15 | struct button_map_entry { 16 | uint32_t from; 17 | uint32_t to; 18 | }; 19 | 20 | double tablet_get_dbl_if_positive(const char *content, const char *name); 21 | enum rotation tablet_parse_rotation(int value); 22 | uint32_t tablet_button_from_str(const char *button); 23 | void tablet_button_mapping_add(uint32_t from, uint32_t to); 24 | void tablet_load_default_button_mappings(void); 25 | uint32_t tablet_get_mapped_button(uint32_t src_button); 26 | 27 | #endif /* LABWC_TABLET_CONFIG_H */ 28 | -------------------------------------------------------------------------------- /include/config/touch.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_TOUCH_CONFIG_H 3 | #define LABWC_TOUCH_CONFIG_H 4 | 5 | #include 6 | #include 7 | 8 | struct touch_config_entry { 9 | char *device_name; 10 | char *output_name; 11 | bool force_mouse_emulation; 12 | 13 | struct wl_list link; /* struct rcxml.touch_configs */ 14 | }; 15 | 16 | struct touch_config_entry *touch_find_config_for_device(char *device_name); 17 | 18 | #endif /* LABWC_TOUCH_CONFIG_H */ 19 | -------------------------------------------------------------------------------- /include/debug.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_DEBUG_H 3 | #define LABWC_DEBUG_H 4 | 5 | struct server; 6 | 7 | void debug_dump_scene(struct server *server); 8 | 9 | #endif /* LABWC_DEBUG_H */ 10 | -------------------------------------------------------------------------------- /include/decorations.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_DECORATIONS_H 3 | #define LABWC_DECORATIONS_H 4 | 5 | struct server; 6 | struct view; 7 | struct wlr_surface; 8 | 9 | void kde_server_decoration_init(struct server *server); 10 | void xdg_server_decoration_init(struct server *server); 11 | 12 | void kde_server_decoration_update_default(void); 13 | void kde_server_decoration_set_view(struct view *view, struct wlr_surface *surface); 14 | 15 | #endif /* LABWC_DECORATIONS_H */ 16 | -------------------------------------------------------------------------------- /include/dnd.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_DND_H 3 | #define LABWC_DND_H 4 | 5 | #include 6 | 7 | struct seat; 8 | 9 | void dnd_init(struct seat *seat); 10 | void dnd_icons_show(struct seat *seat, bool show); 11 | void dnd_icons_move(struct seat *seat, double x, double y); 12 | void dnd_finish(struct seat *seat); 13 | 14 | #endif /* LABWC_DND_H */ 15 | -------------------------------------------------------------------------------- /include/icon-loader.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_ICON_LOADER_H 3 | #define LABWC_ICON_LOADER_H 4 | 5 | struct server; 6 | 7 | void icon_loader_init(struct server *server); 8 | void icon_loader_finish(struct server *server); 9 | struct lab_data_buffer *icon_loader_lookup(struct server *server, 10 | const char *app_id, int size, float scale); 11 | 12 | #endif /* LABWC_ICON_LOADER_H */ 13 | -------------------------------------------------------------------------------- /include/idle.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_IDLE_H 3 | #define LABWC_IDLE_H 4 | 5 | struct wl_display; 6 | struct wlr_seat; 7 | 8 | void idle_manager_create(struct wl_display *display, struct wlr_seat *wlr_seat); 9 | void idle_manager_notify_activity(struct wlr_seat *seat); 10 | 11 | #endif /* LABWC_IDLE_H */ 12 | -------------------------------------------------------------------------------- /include/img/img-png.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_IMG_PNG_H 3 | #define LABWC_IMG_PNG_H 4 | 5 | struct lab_data_buffer; 6 | 7 | void img_png_load(const char *filename, struct lab_data_buffer **buffer, 8 | int size, float scale); 9 | 10 | #endif /* LABWC_IMG_PNG_H */ 11 | -------------------------------------------------------------------------------- /include/img/img-svg.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_IMG_SVG_H 3 | #define LABWC_IMG_SVG_H 4 | 5 | struct lab_data_buffer; 6 | 7 | void img_svg_load(const char *filename, struct lab_data_buffer **buffer, 8 | int size, float scale); 9 | 10 | #endif /* LABWC_IMG_SVG_H */ 11 | -------------------------------------------------------------------------------- /include/img/img-xbm.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_IMG_XBM_H 3 | #define LABWC_IMG_XBM_H 4 | 5 | struct lab_data_buffer; 6 | 7 | /** 8 | * img_xbm_from_bitmap() - create button from monochrome bitmap 9 | * @bitmap: bitmap data array in hexadecimal xbm format 10 | * @buffer: cairo-surface-buffer to create 11 | * @rgba: color 12 | * 13 | * Example bitmap: char button[6] = { 0x3f, 0x3f, 0x21, 0x21, 0x21, 0x3f }; 14 | */ 15 | void img_xbm_from_bitmap(const char *bitmap, struct lab_data_buffer **buffer, 16 | float *rgba); 17 | 18 | /* img_xbm_load - Convert xbm file to buffer with cairo surface */ 19 | void img_xbm_load(const char *filename, struct lab_data_buffer **buffer, 20 | float *rgba); 21 | 22 | #endif /* LABWC_IMG_XBM_H */ 23 | -------------------------------------------------------------------------------- /include/img/img-xpm.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_IMG_XPM_H 3 | #define LABWC_IMG_XPM_H 4 | 5 | struct lab_data_buffer; 6 | 7 | void img_xpm_load(const char *filename, struct lab_data_buffer **buffer, 8 | int size, float scale); 9 | 10 | #endif /* LABWC_IMG_XPM_H */ 11 | -------------------------------------------------------------------------------- /include/input/gestures.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_GESTURES_H 3 | #define LABWC_GESTURES_H 4 | 5 | struct seat; 6 | 7 | void gestures_init(struct seat *seat); 8 | void gestures_finish(struct seat *seat); 9 | 10 | #endif /* LABWC_GESTURES_H */ 11 | -------------------------------------------------------------------------------- /include/input/ime.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | 3 | #ifndef LABWC_IME_H 4 | #define LABWC_IME_H 5 | 6 | #include 7 | #include 8 | #include "labwc.h" 9 | 10 | struct keyboard; 11 | 12 | /* 13 | * The relay structure manages the relationship between text-inputs and 14 | * input-method on a given seat. Multiple text-inputs may be bound to a relay, 15 | * but at most one will be "active" (communicating with input-method) at a time. 16 | * At most one input-method may be bound to the seat. When an input-method and 17 | * an active text-input is present, the relay passes messages between them. 18 | */ 19 | struct input_method_relay { 20 | struct seat *seat; 21 | struct wl_list text_inputs; /* struct text_input.link */ 22 | struct wlr_input_method_v2 *input_method; 23 | struct wlr_surface *focused_surface; 24 | /* 25 | * Text-input which is enabled by the client and communicating with 26 | * input-method. 27 | * This must be NULL if input-method is not present. 28 | * Its client must be the same as that of focused_surface. 29 | */ 30 | struct text_input *active_text_input; 31 | 32 | struct wl_list popups; /* input_method_popup.link */ 33 | struct wlr_scene_tree *popup_tree; 34 | 35 | struct wl_listener new_text_input; 36 | struct wl_listener new_input_method; 37 | 38 | struct wl_listener input_method_commit; 39 | struct wl_listener input_method_grab_keyboard; 40 | struct wl_listener input_method_destroy; 41 | struct wl_listener input_method_new_popup_surface; 42 | 43 | struct wl_listener keyboard_grab_destroy; 44 | struct wl_listener focused_surface_destroy; 45 | }; 46 | 47 | struct input_method_popup { 48 | struct wlr_input_popup_surface_v2 *popup_surface; 49 | struct wlr_scene_tree *tree; 50 | struct input_method_relay *relay; 51 | struct wl_list link; /* input_method_relay.popups */ 52 | 53 | struct wl_listener destroy; 54 | struct wl_listener commit; 55 | }; 56 | 57 | struct text_input { 58 | struct input_method_relay *relay; 59 | struct wlr_text_input_v3 *input; 60 | struct wl_list link; 61 | 62 | struct wl_listener enable; 63 | struct wl_listener commit; 64 | struct wl_listener disable; 65 | struct wl_listener destroy; 66 | }; 67 | 68 | /* 69 | * Forward key event to keyboard grab of the seat from the keyboard 70 | * if the keyboard grab exists. 71 | * Returns true if the key event was forwarded. 72 | */ 73 | bool input_method_keyboard_grab_forward_key(struct keyboard *keyboard, 74 | struct wlr_keyboard_key_event *event); 75 | 76 | /* 77 | * Forward modifier state to keyboard grab of the seat from the keyboard 78 | * if the keyboard grab exists. 79 | * Returns true if the modifier state was forwarded. 80 | */ 81 | bool input_method_keyboard_grab_forward_modifiers(struct keyboard *keyboard); 82 | 83 | struct input_method_relay *input_method_relay_create(struct seat *seat); 84 | 85 | void input_method_relay_finish(struct input_method_relay *relay); 86 | 87 | /* Updates currently focused surface. Surface must belong to the same seat. */ 88 | void input_method_relay_set_focus(struct input_method_relay *relay, 89 | struct wlr_surface *surface); 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /include/input/input.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_INPUT_H 3 | #define LABWC_INPUT_H 4 | 5 | struct seat; 6 | 7 | void input_handlers_init(struct seat *seat); 8 | void input_handlers_finish(struct seat *seat); 9 | 10 | #endif /* LABWC_INPUT_H */ 11 | -------------------------------------------------------------------------------- /include/input/key-state.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_KEY_STATE_H 3 | #define LABWC_KEY_STATE_H 4 | 5 | #include 6 | #include 7 | 8 | /* 9 | * All keycodes in these functions are (Linux) libinput evdev scancodes which is 10 | * what 'wlr_keyboard' uses (e.g. 'seat->keyboard_group->keyboard->keycodes'). 11 | * Note: These keycodes are different to XKB scancodes by a value of 8. 12 | */ 13 | 14 | /** 15 | * key_state_pressed_sent_keycodes - generate array of pressed+sent keys 16 | * Note: The array is generated by subtracting any bound keys from _all_ pressed 17 | * keys (because bound keys were not forwarded to clients). 18 | */ 19 | uint32_t *key_state_pressed_sent_keycodes(void); 20 | int key_state_nr_pressed_sent_keycodes(void); 21 | 22 | void key_state_set_pressed(uint32_t keycode, bool is_pressed, bool is_modifier); 23 | void key_state_store_pressed_key_as_bound(uint32_t keycode); 24 | bool key_state_corresponding_press_event_was_bound(uint32_t keycode); 25 | void key_state_bound_key_remove(uint32_t keycode); 26 | int key_state_nr_bound_keys(void); 27 | int key_state_nr_pressed_keys(void); 28 | 29 | #endif /* LABWC_KEY_STATE_H */ 30 | -------------------------------------------------------------------------------- /include/input/keyboard.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_KEYBOARD_H 3 | #define LABWC_KEYBOARD_H 4 | 5 | #include 6 | #include 7 | 8 | struct seat; 9 | struct keyboard; 10 | struct wlr_keyboard; 11 | 12 | void keyboard_reset_current_keybind(void); 13 | void keyboard_configure(struct seat *seat, struct wlr_keyboard *kb, 14 | bool is_virtual); 15 | 16 | void keyboard_group_init(struct seat *seat); 17 | void keyboard_group_finish(struct seat *seat); 18 | 19 | void keyboard_setup_handlers(struct keyboard *keyboard); 20 | void keyboard_set_numlock(struct wlr_keyboard *keyboard); 21 | void keyboard_update_layout(struct seat *seat, xkb_layout_index_t layout); 22 | void keyboard_cancel_keybind_repeat(struct keyboard *keyboard); 23 | bool keyboard_any_modifiers_pressed(struct wlr_keyboard *keyboard); 24 | 25 | #endif /* LABWC_KEYBOARD_H */ 26 | -------------------------------------------------------------------------------- /include/input/tablet-pad.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_TABLET_PAD_H 3 | #define LABWC_TABLET_PAD_H 4 | 5 | #include 6 | #include 7 | 8 | struct seat; 9 | struct wlr_device; 10 | struct wlr_input_device; 11 | 12 | #define LAB_BTN_PAD 0x0 13 | #define LAB_BTN_PAD2 0x1 14 | #define LAB_BTN_PAD3 0x2 15 | #define LAB_BTN_PAD4 0x3 16 | #define LAB_BTN_PAD5 0x4 17 | #define LAB_BTN_PAD6 0x5 18 | #define LAB_BTN_PAD7 0x6 19 | #define LAB_BTN_PAD8 0x7 20 | #define LAB_BTN_PAD9 0x8 21 | 22 | struct drawing_tablet_pad { 23 | struct wlr_input_device *wlr_input_device; 24 | struct seat *seat; 25 | struct wlr_tablet_pad *pad; 26 | struct wlr_tablet_v2_tablet_pad *pad_v2; 27 | struct drawing_tablet *tablet; 28 | struct wlr_surface *current_surface; 29 | struct { 30 | struct wl_listener current_surface_destroy; 31 | struct wl_listener button; 32 | struct wl_listener ring; 33 | struct wl_listener strip; 34 | struct wl_listener destroy; 35 | } handlers; 36 | struct wl_list link; /* seat.tablet_pads */ 37 | }; 38 | 39 | void tablet_pad_create(struct seat *seat, struct wlr_input_device *wlr_input_device); 40 | void tablet_pad_attach_tablet(struct seat *seat); 41 | void tablet_pad_enter_surface(struct seat *seat, struct wlr_surface *wlr_surface); 42 | 43 | #endif /* LABWC_TABLET_PAD_H */ 44 | -------------------------------------------------------------------------------- /include/input/tablet-tool.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_TABLET_TOOL_H 3 | #define LABWC_TABLET_TOOL_H 4 | 5 | #include 6 | #include 7 | 8 | struct seat; 9 | 10 | struct drawing_tablet_tool { 11 | struct seat *seat; 12 | struct wlr_tablet_v2_tablet_tool *tool_v2; 13 | struct { 14 | struct wl_listener set_cursor; 15 | struct wl_listener destroy; 16 | } handlers; 17 | struct wl_list link; /* seat.tablet_tools */ 18 | }; 19 | 20 | void tablet_tool_create(struct seat *seat, 21 | struct wlr_tablet_tool *wlr_tablet_tool); 22 | bool tablet_tool_has_focused_surface(struct seat *seat); 23 | 24 | #endif /* LABWC_TABLET_TOOL_H */ 25 | -------------------------------------------------------------------------------- /include/input/tablet.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_TABLET_H 3 | #define LABWC_TABLET_H 4 | 5 | #include 6 | #include 7 | 8 | struct seat; 9 | struct wlr_device; 10 | struct wlr_input_device; 11 | 12 | struct drawing_tablet { 13 | struct wlr_input_device *wlr_input_device; 14 | struct seat *seat; 15 | struct wlr_tablet *tablet; 16 | struct wlr_tablet_v2_tablet *tablet_v2; 17 | enum motion motion_mode; 18 | double x, y, dx, dy; 19 | double distance; 20 | double pressure; 21 | double tilt_x, tilt_y; 22 | double rotation; 23 | double slider; 24 | double wheel_delta; 25 | struct { 26 | struct wl_listener destroy; 27 | } handlers; 28 | struct wl_list link; /* seat.tablets */ 29 | }; 30 | 31 | void tablet_init(struct seat *seat); 32 | void tablet_finish(struct seat *seat); 33 | void tablet_create(struct seat *seat, struct wlr_input_device *wlr_input_device); 34 | 35 | #endif /* LABWC_TABLET_H */ 36 | -------------------------------------------------------------------------------- /include/input/touch.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_TOUCH_H 3 | #define LABWC_TOUCH_H 4 | 5 | struct seat; 6 | 7 | void touch_init(struct seat *seat); 8 | void touch_finish(struct seat *seat); 9 | 10 | #endif /* LABWC_TOUCH_H */ 11 | -------------------------------------------------------------------------------- /include/layers.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_LAYERS_H 3 | #define LABWC_LAYERS_H 4 | #include 5 | #include 6 | 7 | struct server; 8 | struct output; 9 | struct seat; 10 | 11 | struct lab_layer_surface { 12 | struct wlr_scene_layer_surface_v1 *scene_layer_surface; 13 | struct server *server; 14 | 15 | bool mapped; 16 | 17 | struct wl_listener map; 18 | struct wl_listener unmap; 19 | struct wl_listener surface_commit; 20 | struct wl_listener output_destroy; 21 | struct wl_listener node_destroy; 22 | struct wl_listener new_popup; 23 | }; 24 | 25 | struct lab_layer_popup { 26 | struct wlr_xdg_popup *wlr_popup; 27 | struct wlr_scene_tree *scene_tree; 28 | 29 | /* To simplify moving popup nodes from the bottom to the top layer */ 30 | struct wlr_box output_toplevel_sx_box; 31 | 32 | struct wl_listener commit; 33 | struct wl_listener destroy; 34 | struct wl_listener new_popup; 35 | struct wl_listener reposition; 36 | }; 37 | 38 | void layers_init(struct server *server); 39 | 40 | void layers_arrange(struct output *output); 41 | void layer_try_set_focus(struct seat *seat, 42 | struct wlr_layer_surface_v1 *layer_surface); 43 | 44 | #endif /* LABWC_LAYERS_H */ 45 | -------------------------------------------------------------------------------- /include/magnifier.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_MAGNIFIER_H 3 | #define LABWC_MAGNIFIER_H 4 | 5 | #include 6 | 7 | struct server; 8 | struct output; 9 | struct wlr_buffer; 10 | struct wlr_box; 11 | 12 | enum magnify_dir { 13 | MAGNIFY_INCREASE, 14 | MAGNIFY_DECREASE 15 | }; 16 | 17 | void magnify_toggle(struct server *server); 18 | void magnify_set_scale(struct server *server, enum magnify_dir dir); 19 | bool output_wants_magnification(struct output *output); 20 | void magnify(struct output *output, struct wlr_buffer *output_buffer, 21 | struct wlr_box *damage); 22 | bool is_magnify_on(void); 23 | void magnify_reset(void); 24 | 25 | #endif /* LABWC_MAGNIFIER_H */ 26 | -------------------------------------------------------------------------------- /include/meson.build: -------------------------------------------------------------------------------- 1 | configure_file(output: 'config.h', configuration: conf_data) 2 | -------------------------------------------------------------------------------- /include/node.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_NODE_DESCRIPTOR_H 3 | #define LABWC_NODE_DESCRIPTOR_H 4 | #include 5 | 6 | struct view; 7 | struct lab_layer_surface; 8 | struct lab_layer_popup; 9 | struct menuitem; 10 | struct ssd_button; 11 | 12 | enum node_descriptor_type { 13 | LAB_NODE_DESC_NODE = 0, 14 | LAB_NODE_DESC_VIEW, 15 | LAB_NODE_DESC_XDG_POPUP, 16 | LAB_NODE_DESC_LAYER_SURFACE, 17 | LAB_NODE_DESC_LAYER_POPUP, 18 | LAB_NODE_DESC_SESSION_LOCK_SURFACE, 19 | LAB_NODE_DESC_IME_POPUP, 20 | LAB_NODE_DESC_MENUITEM, 21 | LAB_NODE_DESC_TREE, 22 | LAB_NODE_DESC_SSD_BUTTON, 23 | }; 24 | 25 | struct node_descriptor { 26 | enum node_descriptor_type type; 27 | void *data; 28 | struct wl_listener destroy; 29 | }; 30 | 31 | /** 32 | * node_descriptor_create - create node descriptor for wlr_scene_node user_data 33 | * 34 | * The node_descriptor will be destroyed automatically 35 | * once the scene_node it is attached to is destroyed. 36 | * 37 | * @scene_node: wlr_scene_node to attached node_descriptor to 38 | * @type: node descriptor type 39 | * @data: struct to point to as follows: 40 | * - LAB_NODE_DESC_VIEW struct view 41 | * - LAB_NODE_DESC_XDG_POPUP struct view 42 | * - LAB_NODE_DESC_LAYER_SURFACE struct lab_layer_surface 43 | * - LAB_NODE_DESC_LAYER_POPUP struct lab_layer_popup 44 | * - LAB_NODE_DESC_MENUITEM struct menuitem 45 | * - LAB_NODE_DESC_SSD_BUTTON struct ssd_button 46 | */ 47 | void node_descriptor_create(struct wlr_scene_node *scene_node, 48 | enum node_descriptor_type type, void *data); 49 | 50 | /** 51 | * node_view_from_node - return view struct from node 52 | * @wlr_scene_node: wlr_scene_node from which to return data 53 | */ 54 | struct view *node_view_from_node(struct wlr_scene_node *wlr_scene_node); 55 | 56 | /** 57 | * node_lab_surface_from_node - return lab_layer_surface struct from node 58 | * @wlr_scene_node: wlr_scene_node from which to return data 59 | */ 60 | struct lab_layer_surface *node_layer_surface_from_node( 61 | struct wlr_scene_node *wlr_scene_node); 62 | 63 | /** 64 | * node_layer_popup_from_node - return lab_layer_popup struct from node 65 | * @wlr_scene_node: wlr_scene_node from which to return data 66 | */ 67 | struct lab_layer_popup *node_layer_popup_from_node( 68 | struct wlr_scene_node *wlr_scene_node); 69 | 70 | /** 71 | * node_menuitem_from_node - return menuitem struct from node 72 | * @wlr_scene_node: wlr_scene_node from which to return data 73 | */ 74 | struct menuitem *node_menuitem_from_node( 75 | struct wlr_scene_node *wlr_scene_node); 76 | 77 | /** 78 | * node_ssd_button_from_node - return ssd_button struct from node 79 | * @wlr_scene_node: wlr_scene_node from which to return data 80 | */ 81 | struct ssd_button *node_ssd_button_from_node( 82 | struct wlr_scene_node *wlr_scene_node); 83 | 84 | #endif /* LABWC_NODE_DESCRIPTOR_H */ 85 | -------------------------------------------------------------------------------- /include/osd.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_OSD_H 3 | #define LABWC_OSD_H 4 | 5 | #include 6 | #include 7 | 8 | /* TODO: add field with keyboard layout? */ 9 | enum window_switcher_field_content { 10 | LAB_FIELD_NONE = 0, 11 | LAB_FIELD_TYPE, 12 | LAB_FIELD_TYPE_SHORT, 13 | LAB_FIELD_IDENTIFIER, 14 | LAB_FIELD_TRIMMED_IDENTIFIER, 15 | LAB_FIELD_TITLE, 16 | LAB_FIELD_TITLE_SHORT, 17 | LAB_FIELD_WORKSPACE, 18 | LAB_FIELD_WORKSPACE_SHORT, 19 | LAB_FIELD_WIN_STATE, 20 | LAB_FIELD_WIN_STATE_ALL, 21 | LAB_FIELD_OUTPUT, 22 | LAB_FIELD_OUTPUT_SHORT, 23 | LAB_FIELD_CUSTOM, 24 | 25 | LAB_FIELD_COUNT 26 | }; 27 | 28 | struct window_switcher_field { 29 | enum window_switcher_field_content content; 30 | int width; 31 | char *format; 32 | struct wl_list link; /* struct rcxml.window_switcher.fields */ 33 | }; 34 | 35 | struct buf; 36 | struct view; 37 | struct server; 38 | 39 | /* Updates onscreen display 'alt-tab' buffer */ 40 | void osd_update(struct server *server); 41 | 42 | /* Closes the OSD */ 43 | void osd_finish(struct server *server); 44 | 45 | /* Moves preview views back into their original stacking order and state */ 46 | void osd_preview_restore(struct server *server); 47 | 48 | /* Notify OSD about a destroying view */ 49 | void osd_on_view_destroy(struct view *view); 50 | 51 | /* Used by osd.c internally to render window switcher fields */ 52 | void osd_field_get_content(struct window_switcher_field *field, 53 | struct buf *buf, struct view *view); 54 | 55 | /* Used by rcxml.c when parsing the config */ 56 | struct window_switcher_field *osd_field_create(void); 57 | void osd_field_arg_from_xml_node(struct window_switcher_field *field, 58 | const char *nodename, const char *content); 59 | bool osd_field_validate(struct window_switcher_field *field); 60 | void osd_field_free(struct window_switcher_field *field); 61 | 62 | #endif // LABWC_OSD_H 63 | -------------------------------------------------------------------------------- /include/output-state.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_OUTPUT_STATE_H 3 | #define LABWC_OUTPUT_STATE_H 4 | 5 | #include 6 | 7 | struct output; 8 | 9 | void output_state_init(struct output *output); 10 | 11 | bool output_state_commit(struct output *output); 12 | 13 | #endif // LABWC_OUTPUT_STATE_H 14 | -------------------------------------------------------------------------------- /include/output-virtual.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_OUTPUT_VIRTUAL_H 3 | #define LABWC_OUTPUT_VIRTUAL_H 4 | 5 | struct server; 6 | struct wlr_output; 7 | 8 | void output_virtual_add(struct server *server, const char *output_name, 9 | struct wlr_output **store_wlr_output); 10 | void output_virtual_remove(struct server *server, const char *output_name); 11 | void output_virtual_update_fallback(struct server *server); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /include/overlay.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_OVERLAY_H 3 | #define LABWC_OVERLAY_H 4 | 5 | #include 6 | #include "common/graphic-helpers.h" 7 | #include "regions.h" 8 | #include "view.h" 9 | 10 | struct overlay_rect { 11 | struct wlr_scene_tree *tree; 12 | 13 | bool bg_enabled; 14 | struct wlr_scene_rect *bg_rect; 15 | 16 | bool border_enabled; 17 | struct multi_rect *border_rect; 18 | }; 19 | 20 | struct overlay { 21 | struct overlay_rect region_rect, edge_rect; 22 | 23 | /* Represents currently shown or delayed overlay */ 24 | struct { 25 | /* Region overlay */ 26 | struct region *region; 27 | 28 | /* Snap-to-edge overlay */ 29 | enum view_edge edge; 30 | struct output *output; 31 | } active; 32 | 33 | /* For delayed snap-to-edge overlay */ 34 | struct wl_event_source *timer; 35 | }; 36 | 37 | void overlay_reconfigure(struct seat *seat); 38 | /* Calls overlay_hide() internally if there's no overlay to show */ 39 | void overlay_update(struct seat *seat); 40 | /* This function must be called when server->grabbed_view is destroyed */ 41 | void overlay_hide(struct seat *seat); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /include/placement.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_PLACEMENT_H 3 | #define LABWC_PLACEMENT_H 4 | 5 | #include 6 | #include 7 | #include "view.h" 8 | 9 | bool placement_find_best(struct view *view, struct wlr_box *geometry); 10 | 11 | #endif /* LABWC_PLACEMENT_H */ 12 | -------------------------------------------------------------------------------- /include/protocols/cosmic-workspaces-internal.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_PROTOCOLS_COSMIC_WORKSPACES_INTERNAL_H 3 | #define LABWC_PROTOCOLS_COSMIC_WORKSPACES_INTERNAL_H 4 | 5 | struct lab_cosmic_workspace; 6 | struct lab_cosmic_workspace_group; 7 | struct lab_cosmic_workspace_manager; 8 | 9 | enum pending_change { 10 | /* group events */ 11 | CW_PENDING_WS_CREATE = 1 << 0, 12 | 13 | /* ws events*/ 14 | CW_PENDING_WS_ACTIVATE = 1 << 1, 15 | CW_PENDING_WS_DEACTIVATE = 1 << 2, 16 | CW_PENDING_WS_REMOVE = 1 << 3, 17 | }; 18 | 19 | struct transaction { 20 | uint32_t change; 21 | struct wl_list link; 22 | }; 23 | 24 | struct transaction_workspace { 25 | struct transaction base; 26 | struct lab_cosmic_workspace *workspace; 27 | }; 28 | 29 | struct transaction_group { 30 | struct transaction base; 31 | struct lab_cosmic_workspace_group *group; 32 | char *new_workspace_name; 33 | }; 34 | 35 | struct session_context { 36 | int ref_count; 37 | struct wl_list transactions; 38 | }; 39 | 40 | struct wl_resource_addon { 41 | struct session_context *ctx; 42 | void *data; 43 | }; 44 | 45 | struct wl_resource_addon *resource_addon_create(struct session_context *ctx); 46 | 47 | void transaction_add_workspace_ev(struct lab_cosmic_workspace *ws, 48 | struct wl_resource *resource, enum pending_change change); 49 | 50 | void transaction_add_workspace_group_ev(struct lab_cosmic_workspace_group *group, 51 | struct wl_resource *resource, enum pending_change change, 52 | const char *new_workspace_name); 53 | 54 | void resource_addon_destroy(struct wl_resource_addon *addon); 55 | 56 | void group_output_send_initial_state(struct lab_cosmic_workspace_group *group, 57 | struct wl_resource *group_resource); 58 | 59 | void manager_schedule_done_event(struct lab_cosmic_workspace_manager *manager); 60 | 61 | #endif /* LABWC_PROTOCOLS_COSMIC_WORKSPACES_INTERNAL_H */ 62 | -------------------------------------------------------------------------------- /include/protocols/cosmic-workspaces.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_PROTOCOLS_COSMIC_WORKSPACES_H 3 | #define LABWC_PROTOCOLS_COSMIC_WORKSPACES_H 4 | 5 | #include 6 | #include 7 | 8 | struct wlr_output; 9 | 10 | struct lab_cosmic_workspace_manager { 11 | struct wl_global *global; 12 | struct wl_list groups; 13 | uint32_t caps; 14 | struct wl_event_source *idle_source; 15 | struct wl_event_loop *event_loop; 16 | 17 | struct { 18 | struct wl_listener display_destroy; 19 | } on; 20 | 21 | struct wl_list resources; 22 | }; 23 | 24 | struct lab_cosmic_workspace_group { 25 | struct lab_cosmic_workspace_manager *manager; 26 | struct wl_list workspaces; 27 | struct wl_array capabilities; 28 | struct { 29 | struct wl_signal create_workspace; 30 | struct wl_signal destroy; 31 | } events; 32 | 33 | struct wl_list link; 34 | struct wl_list outputs; 35 | struct wl_list resources; 36 | }; 37 | 38 | struct lab_cosmic_workspace { 39 | struct lab_cosmic_workspace_group *group; 40 | char *name; 41 | struct wl_array coordinates; 42 | struct wl_array capabilities; 43 | uint32_t state; /* enum lab_cosmic_workspace_state */ 44 | uint32_t state_pending; /* enum lab_cosmic_workspace_state */ 45 | 46 | struct { 47 | struct wl_signal activate; 48 | struct wl_signal deactivate; 49 | struct wl_signal remove; 50 | struct wl_signal destroy; 51 | } events; 52 | 53 | struct wl_list link; 54 | struct wl_list resources; 55 | }; 56 | 57 | enum lab_cosmic_workspace_caps { 58 | CW_CAP_NONE = 0, 59 | CW_CAP_GRP_ALL = 0x000000ff, 60 | CW_CAP_WS_ALL = 0x0000ff00, 61 | 62 | /* group caps */ 63 | CW_CAP_GRP_WS_CREATE = 1 << 0, 64 | 65 | /* workspace caps */ 66 | CW_CAP_WS_ACTIVATE = 1 << 8, 67 | CW_CAP_WS_DEACTIVATE = 1 << 9, 68 | CW_CAP_WS_REMOVE = 1 << 10, 69 | }; 70 | 71 | struct lab_cosmic_workspace_manager *lab_cosmic_workspace_manager_create( 72 | struct wl_display *display, uint32_t caps, uint32_t version); 73 | 74 | struct lab_cosmic_workspace_group *lab_cosmic_workspace_group_create( 75 | struct lab_cosmic_workspace_manager *manager); 76 | 77 | void lab_cosmic_workspace_group_output_enter( 78 | struct lab_cosmic_workspace_group *group, struct wlr_output *output); 79 | 80 | void lab_cosmic_workspace_group_output_leave( 81 | 82 | struct lab_cosmic_workspace_group *group, struct wlr_output *output); 83 | void lab_cosmic_workspace_group_destroy(struct lab_cosmic_workspace_group *group); 84 | 85 | struct lab_cosmic_workspace *lab_cosmic_workspace_create(struct lab_cosmic_workspace_group *group); 86 | void lab_cosmic_workspace_set_name(struct lab_cosmic_workspace *workspace, const char *name); 87 | void lab_cosmic_workspace_set_active(struct lab_cosmic_workspace *workspace, bool enabled); 88 | void lab_cosmic_workspace_set_urgent(struct lab_cosmic_workspace *workspace, bool enabled); 89 | void lab_cosmic_workspace_set_hidden(struct lab_cosmic_workspace *workspace, bool enabled); 90 | void lab_cosmic_workspace_set_coordinates(struct lab_cosmic_workspace *workspace, 91 | struct wl_array *coordinates); 92 | void lab_cosmic_workspace_destroy(struct lab_cosmic_workspace *workspace); 93 | 94 | #endif /* LABWC_PROTOCOLS_COSMIC_WORKSPACES_H */ 95 | -------------------------------------------------------------------------------- /include/regions.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_REGIONS_H 3 | #define LABWC_REGIONS_H 4 | 5 | #include 6 | 7 | struct seat; 8 | struct view; 9 | struct server; 10 | struct output; 11 | struct wl_list; 12 | struct wlr_box; 13 | struct multi_rect; 14 | 15 | /* Double use: rcxml.c for config and output.c for usage */ 16 | struct region { 17 | struct wl_list link; /* struct rcxml.regions, struct output.regions */ 18 | struct output *output; 19 | char *name; 20 | struct wlr_box geo; 21 | struct wlr_box percentage; 22 | struct { 23 | int x; 24 | int y; 25 | } center; 26 | }; 27 | 28 | /* Returns true if we should show the region overlay or snap to region */ 29 | bool regions_should_snap(struct server *server); 30 | 31 | /** 32 | * regions_reconfigure*() - re-initializes all regions from struct rc. 33 | * 34 | * - all views are evacuated from the given output (or all of them) 35 | * - all output local regions are destroyed 36 | * - new output local regions are created from struct rc 37 | * - the region geometry is re-calculated 38 | */ 39 | void regions_reconfigure(struct server *server); 40 | void regions_reconfigure_output(struct output *output); 41 | 42 | /* re-calculate the geometry based on usable area */ 43 | void regions_update_geometry(struct output *output); 44 | 45 | /** 46 | * Mark all views which are currently region-tiled to the given output as 47 | * evacuated. This means that the view->tiled_region pointer is reset to 48 | * NULL but view->tiled_region_evacuate is set to a copy of the region name. 49 | * 50 | * The next time desktop_arrange_all_views() causes a call to 51 | * view_apply_region_geometry() it will try to find a new output and then 52 | * search for a region with the same name. If found, view->tiled_region will 53 | * be set to the new region and view->tiled_region_evacuate will be free'd. 54 | * 55 | * If no region with the old name is found (e.g. the user deleted or renamed 56 | * the region in rc.xml and caused a Reconfigure) the view will be reset to 57 | * non-tiled state and view->tiled_region_evacuate will be free'd. 58 | */ 59 | void regions_evacuate_output(struct output *output); 60 | 61 | /* Free all regions in given wl_list pointer */ 62 | void regions_destroy(struct seat *seat, struct wl_list *regions); 63 | 64 | /* Get output local region from cursor or name, may be NULL */ 65 | struct region *regions_from_cursor(struct server *server); 66 | struct region *regions_from_name(const char *region_name, struct output *output); 67 | 68 | #endif /* LABWC_REGIONS_H */ 69 | -------------------------------------------------------------------------------- /include/resistance.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_RESISTANCE_H 3 | #define LABWC_RESISTANCE_H 4 | #include "labwc.h" 5 | 6 | /** 7 | * resistance_unsnap_apply() - Apply resistance when dragging a 8 | * maximized/tiled window. Returns true when the view needs to be un-tiled. 9 | */ 10 | bool resistance_unsnap_apply(struct view *view, int *x, int *y); 11 | void resistance_move_apply(struct view *view, int *x, int *y); 12 | void resistance_resize_apply(struct view *view, struct wlr_box *new_view_geo); 13 | 14 | #endif /* LABWC_RESISTANCE_H */ 15 | -------------------------------------------------------------------------------- /include/resize-indicator.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_RESIZE_INDICATOR_H 3 | #define LABWC_RESIZE_INDICATOR_H 4 | 5 | struct server; 6 | struct view; 7 | 8 | enum resize_indicator_mode { 9 | LAB_RESIZE_INDICATOR_NEVER = 0, 10 | LAB_RESIZE_INDICATOR_ALWAYS, 11 | LAB_RESIZE_INDICATOR_NON_PIXEL 12 | }; 13 | 14 | void resize_indicator_reconfigure(struct server *server); 15 | void resize_indicator_show(struct view *view); 16 | void resize_indicator_update(struct view *view); 17 | void resize_indicator_hide(struct view *view); 18 | 19 | #endif /* LABWC_RESIZE_INDICATOR_H */ 20 | -------------------------------------------------------------------------------- /include/resize-outlines.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_RESIZE_OUTLINES_H 3 | #define LABWC_RESIZE_OUTLINES_H 4 | 5 | #include 6 | 7 | struct view; 8 | 9 | void resize_outlines_update(struct view *view, struct wlr_box new_geo); 10 | void resize_outlines_finish(struct view *view); 11 | bool resize_outlines_enabled(struct view *view); 12 | 13 | #endif /* LABWC_RESIZE_OUTLINES_H */ 14 | -------------------------------------------------------------------------------- /include/session-lock.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_SESSION_LOCK_H 3 | #define LABWC_SESSION_LOCK_H 4 | 5 | #include 6 | 7 | struct output; 8 | struct server; 9 | 10 | struct session_lock_manager { 11 | struct server *server; 12 | struct wlr_session_lock_manager_v1 *wlr_manager; 13 | /* View re-focused on unlock */ 14 | struct view *last_active_view; 15 | struct wlr_surface *focused; 16 | /* 17 | * When not locked: lock=NULL, locked=false 18 | * When locked: lock=non-NULL, locked=true 19 | * When lock is destroyed without being unlocked: lock=NULL, locked=true 20 | */ 21 | struct wlr_session_lock_v1 *lock; 22 | bool locked; 23 | 24 | struct wl_list lock_outputs; 25 | 26 | struct wl_listener new_lock; 27 | struct wl_listener destroy; 28 | 29 | struct wl_listener lock_new_surface; 30 | struct wl_listener lock_unlock; 31 | struct wl_listener lock_destroy; 32 | }; 33 | 34 | void session_lock_init(struct server *server); 35 | void session_lock_output_create(struct session_lock_manager *manager, struct output *output); 36 | void session_lock_update_for_layout_change(struct server *server); 37 | 38 | #endif /* LABWC_SESSION_LOCK_H */ 39 | -------------------------------------------------------------------------------- /include/snap-constraints.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_SNAP_CONSTRAINTS_H 3 | #define LABWC_SNAP_CONSTRAINTS_H 4 | 5 | #include "common/border.h" 6 | #include "view.h" 7 | 8 | struct wlr_box; 9 | 10 | void snap_constraints_set(struct view *view, 11 | enum view_edge direction, struct wlr_box geom); 12 | 13 | void snap_constraints_invalidate(struct view *view); 14 | 15 | void snap_constraints_update(struct view *view); 16 | 17 | struct wlr_box snap_constraints_effective(struct view *view, 18 | enum view_edge direction); 19 | 20 | #endif /* LABWC_SNAP_CONSTRAINTS_H */ 21 | -------------------------------------------------------------------------------- /include/snap.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_SNAP_H 3 | #define LABWC_SNAP_H 4 | 5 | #include "common/border.h" 6 | #include "view.h" 7 | 8 | struct wlr_box; 9 | 10 | void snap_move_to_edge(struct view *view, 11 | enum view_edge direction, bool snap_to_windows, int *dx, int *dy); 12 | 13 | void snap_grow_to_next_edge(struct view *view, 14 | enum view_edge direction, struct wlr_box *geo); 15 | 16 | void snap_shrink_to_next_edge(struct view *view, 17 | enum view_edge direction, struct wlr_box *geo); 18 | 19 | void snap_invalidate_edge_cache(struct view *view); 20 | void snap_update_cache_geometry(struct view *view); 21 | 22 | #endif /* LABWC_SNAP_H */ 23 | -------------------------------------------------------------------------------- /include/view-impl-common.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_VIEW_IMPL_COMMON_H 3 | #define LABWC_VIEW_IMPL_COMMON_H 4 | /* 5 | * Common code for view->impl functions 6 | * 7 | * Please note: only xdg-shell-toplevel-view and xwayland-view view_impl 8 | * functions should call these functions. 9 | */ 10 | 11 | struct view; 12 | 13 | void view_impl_move_to_front(struct view *view); 14 | void view_impl_move_to_back(struct view *view); 15 | void view_impl_map(struct view *view); 16 | void view_impl_unmap(struct view *view); 17 | 18 | /* 19 | * Updates view geometry at commit based on current position/size, 20 | * pending move/resize, and committed surface size. The computed 21 | * position may not match pending.x/y exactly in some cases. 22 | */ 23 | void view_impl_apply_geometry(struct view *view, int w, int h); 24 | 25 | #endif /* LABWC_VIEW_IMPL_COMMON_H */ 26 | -------------------------------------------------------------------------------- /include/window-rules.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_WINDOW_RULES_H 3 | #define LABWC_WINDOW_RULES_H 4 | 5 | #include 6 | #include 7 | 8 | enum window_rule_event { 9 | LAB_WINDOW_RULE_EVENT_ON_FIRST_MAP = 0, 10 | }; 11 | 12 | enum property { 13 | LAB_PROP_UNSPECIFIED = 0, 14 | LAB_PROP_UNSET, 15 | LAB_PROP_FALSE, 16 | LAB_PROP_TRUE, 17 | }; 18 | 19 | /* 20 | * 'identifier' represents: 21 | * - 'app_id' for native Wayland windows 22 | * - 'WM_CLASS' for XWayland clients 23 | */ 24 | struct window_rule { 25 | char *identifier; 26 | char *title; 27 | int window_type; 28 | char *sandbox_engine; 29 | char *sandbox_app_id; 30 | bool match_once; 31 | 32 | enum window_rule_event event; 33 | struct wl_list actions; 34 | 35 | enum property server_decoration; 36 | enum property skip_taskbar; 37 | enum property skip_window_switcher; 38 | enum property ignore_focus_request; 39 | enum property ignore_configure_request; 40 | enum property fixed_position; 41 | 42 | struct wl_list link; /* struct rcxml.window_rules */ 43 | }; 44 | 45 | struct view; 46 | 47 | void window_rules_apply(struct view *view, enum window_rule_event event); 48 | enum property window_rules_get_property(struct view *view, const char *property); 49 | 50 | #endif /* LABWC_WINDOW_RULES_H */ 51 | -------------------------------------------------------------------------------- /include/workspaces.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_WORKSPACES_H 3 | #define LABWC_WORKSPACES_H 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | struct seat; 10 | struct server; 11 | struct wlr_scene_tree; 12 | 13 | /* Double use: as config in config/rcxml.c and as instance in workspaces.c */ 14 | struct workspace { 15 | struct wl_list link; /* 16 | * struct server.workspaces 17 | * struct rcxml.workspace_config.workspaces 18 | */ 19 | struct server *server; 20 | 21 | char *name; 22 | struct wlr_scene_tree *tree; 23 | 24 | struct lab_cosmic_workspace *cosmic_workspace; 25 | struct { 26 | struct wl_listener activate; 27 | struct wl_listener deactivate; 28 | struct wl_listener remove; 29 | } on; 30 | }; 31 | 32 | void workspaces_init(struct server *server); 33 | void workspaces_switch_to(struct workspace *target, bool update_focus); 34 | void workspaces_destroy(struct server *server); 35 | void workspaces_osd_hide(struct seat *seat); 36 | struct workspace *workspaces_find(struct workspace *anchor, const char *name, 37 | bool wrap); 38 | void workspaces_reconfigure(struct server *server); 39 | 40 | #endif /* LABWC_WORKSPACES_H */ 41 | -------------------------------------------------------------------------------- /include/xwayland.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | #ifndef LABWC_XWAYLAND_H 3 | #define LABWC_XWAYLAND_H 4 | #include "config.h" 5 | 6 | #if HAVE_XWAYLAND 7 | #include 8 | #include 9 | #include 10 | #include "common/macros.h" 11 | #include "view.h" 12 | 13 | struct wlr_compositor; 14 | struct wlr_output; 15 | struct wlr_output_layout; 16 | 17 | static const char * const atom_names[] = { 18 | "_NET_WM_WINDOW_TYPE_DESKTOP", 19 | "_NET_WM_WINDOW_TYPE_DOCK", 20 | "_NET_WM_WINDOW_TYPE_TOOLBAR", 21 | "_NET_WM_WINDOW_TYPE_MENU", 22 | "_NET_WM_WINDOW_TYPE_UTILITY", 23 | "_NET_WM_WINDOW_TYPE_SPLASH", 24 | "_NET_WM_WINDOW_TYPE_DIALOG", 25 | "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU", 26 | "_NET_WM_WINDOW_TYPE_POPUP_MENU", 27 | "_NET_WM_WINDOW_TYPE_TOOLTIP", 28 | "_NET_WM_WINDOW_TYPE_NOTIFICATION", 29 | "_NET_WM_WINDOW_TYPE_COMBO", 30 | "_NET_WM_WINDOW_TYPE_DND", 31 | "_NET_WM_WINDOW_TYPE_NORMAL", 32 | }; 33 | 34 | static_assert( 35 | ARRAY_SIZE(atom_names) == WINDOW_TYPE_LEN, 36 | "Xwayland atoms out of sync"); 37 | 38 | extern xcb_atom_t atoms[WINDOW_TYPE_LEN]; 39 | 40 | struct xwayland_unmanaged { 41 | struct server *server; 42 | struct wlr_xwayland_surface *xwayland_surface; 43 | struct wlr_scene_node *node; 44 | struct wl_list link; 45 | 46 | struct mappable mappable; 47 | 48 | struct wl_listener associate; 49 | struct wl_listener dissociate; 50 | struct wl_listener request_activate; 51 | struct wl_listener request_configure; 52 | /* struct wl_listener request_fullscreen; */ 53 | struct wl_listener set_geometry; 54 | struct wl_listener destroy; 55 | struct wl_listener set_override_redirect; 56 | }; 57 | 58 | struct xwayland_view { 59 | struct view base; 60 | struct wlr_xwayland_surface *xwayland_surface; 61 | 62 | /* Events unique to XWayland views */ 63 | struct wl_listener associate; 64 | struct wl_listener dissociate; 65 | struct wl_listener request_activate; 66 | struct wl_listener request_configure; 67 | struct wl_listener set_class; 68 | struct wl_listener set_decorations; 69 | struct wl_listener set_override_redirect; 70 | struct wl_listener set_strut_partial; 71 | struct wl_listener set_window_type; 72 | struct wl_listener map_request; 73 | 74 | /* Not (yet) implemented */ 75 | /* struct wl_listener set_role; */ 76 | /* struct wl_listener set_hints; */ 77 | }; 78 | 79 | void xwayland_unmanaged_create(struct server *server, 80 | struct wlr_xwayland_surface *xsurface, bool mapped); 81 | 82 | void xwayland_view_create(struct server *server, 83 | struct wlr_xwayland_surface *xsurface, bool mapped); 84 | 85 | void xwayland_adjust_stacking_order(struct server *server); 86 | 87 | struct wlr_xwayland_surface *xwayland_surface_from_view(struct view *view); 88 | 89 | void xwayland_server_init(struct server *server, 90 | struct wlr_compositor *compositor); 91 | void xwayland_server_finish(struct server *server); 92 | 93 | void xwayland_adjust_usable_area(struct view *view, 94 | struct wlr_output_layout *layout, struct wlr_output *output, 95 | struct wlr_box *usable); 96 | 97 | void xwayland_update_workarea(struct server *server); 98 | 99 | void xwayland_reset_cursor(struct server *server); 100 | 101 | #endif /* HAVE_XWAYLAND */ 102 | #endif /* LABWC_XWAYLAND_H */ 103 | -------------------------------------------------------------------------------- /meson_options.txt: -------------------------------------------------------------------------------- 1 | option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages') 2 | option('xwayland', type: 'feature', value: 'auto', description: 'Enable support for X11 applications') 3 | option('svg', type: 'feature', value: 'enabled', description: 'Enable svg window buttons') 4 | option('icon', type: 'feature', value: 'enabled', description: 'Enable window icons') 5 | option('nls', type: 'feature', value: 'auto', description: 'Enable native language support') 6 | option('static_analyzer', type: 'feature', value: 'disabled', description: 'Run gcc static analyzer') 7 | option('test', type: 'feature', value: 'disabled', description: 'Run tests') 8 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | ar cs da de el es et eu fa fi fr gl hu id it ja ka ko lt nl pa pl pt pt_BR ru sv tr uk zh_CN 2 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | src/menu/menu.c 2 | src/config/rcxml.c 3 | -------------------------------------------------------------------------------- /po/ar.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2024 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-09-23 20:01+0000\n" 12 | "Last-Translator: Abdullah Albaroty \n" 13 | "Language-Team: Arabic \n" 15 | "Language: ar\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " 20 | "&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n" 21 | "X-Generator: Weblate 4.2.1\n" 22 | 23 | #: src/menu/menu.c:1017 24 | msgid "Go there..." 25 | msgstr "اذهب هناك..." 26 | 27 | #: src/menu/menu.c:1037 28 | msgid "Reconfigure" 29 | msgstr "إعادة تهيئة" 30 | 31 | #: src/menu/menu.c:1039 32 | msgid "Exit" 33 | msgstr "أخرج" 34 | 35 | #: src/menu/menu.c:1055 36 | msgid "Minimize" 37 | msgstr "صغّر" 38 | 39 | #: src/menu/menu.c:1057 40 | msgid "Maximize" 41 | msgstr "كبّر" 42 | 43 | #: src/menu/menu.c:1059 44 | msgid "Fullscreen" 45 | msgstr "ملء الشاشة" 46 | 47 | #: src/menu/menu.c:1061 48 | msgid "Roll Up/Down" 49 | msgstr "طي/إلغاء طي" 50 | 51 | #: src/menu/menu.c:1063 52 | msgid "Decorations" 53 | msgstr "إخف الإطار" 54 | 55 | #: src/menu/menu.c:1065 56 | msgid "Always on Top" 57 | msgstr "دائمًا في القمة" 58 | 59 | #: src/menu/menu.c:1070 60 | msgid "Move Left" 61 | msgstr "أنقل يسارا" 62 | 63 | #: src/menu/menu.c:1077 64 | msgid "Move Right" 65 | msgstr "أنقل يمينا" 66 | 67 | #: src/menu/menu.c:1082 68 | msgid "Always on Visible Workspace" 69 | msgstr "أظهر في مساحات العمل دائما" 70 | 71 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 72 | msgid "Workspace" 73 | msgstr "مساحة عمل" 74 | 75 | #: src/menu/menu.c:1088 76 | msgid "Close" 77 | msgstr "غلق" 78 | -------------------------------------------------------------------------------- /po/cs.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2024 3 | # This file is distributed under the same license as the labwc package. 4 | # zenobit , 2024. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-03-02 02:00+0100\n" 12 | "Last-Translator: zenobit \n" 13 | "Language-Team: Czech \n" 14 | "Language: cs\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: src/menu/menu.c:1017 20 | msgid "Go there..." 21 | msgstr "" 22 | 23 | #: src/menu/menu.c:1037 24 | msgid "Reconfigure" 25 | msgstr "Překonfigurovat" 26 | 27 | #: src/menu/menu.c:1039 28 | msgid "Exit" 29 | msgstr "Odejít" 30 | 31 | #: src/menu/menu.c:1055 32 | msgid "Minimize" 33 | msgstr "Minimalizovat" 34 | 35 | #: src/menu/menu.c:1057 36 | msgid "Maximize" 37 | msgstr "Maximalizovat" 38 | 39 | #: src/menu/menu.c:1059 40 | msgid "Fullscreen" 41 | msgstr "Na celou obrazovku" 42 | 43 | #: src/menu/menu.c:1061 44 | msgid "Roll Up/Down" 45 | msgstr "Rolovat nahoru/dolů" 46 | 47 | #: src/menu/menu.c:1063 48 | msgid "Decorations" 49 | msgstr "Dekorace" 50 | 51 | #: src/menu/menu.c:1065 52 | msgid "Always on Top" 53 | msgstr "Vždy nahoře" 54 | 55 | #: src/menu/menu.c:1070 56 | msgid "Move Left" 57 | msgstr "Posunout doleva" 58 | 59 | #: src/menu/menu.c:1077 60 | msgid "Move Right" 61 | msgstr "Posunout doprava" 62 | 63 | #: src/menu/menu.c:1082 64 | msgid "Always on Visible Workspace" 65 | msgstr "Vždy na viditelné Pracovní Ploše" 66 | 67 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 68 | msgid "Workspace" 69 | msgstr "Pracovní Plocha" 70 | 71 | #: src/menu/menu.c:1088 72 | msgid "Close" 73 | msgstr "Zavřít" 74 | -------------------------------------------------------------------------------- /po/da.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2024 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-10-27 12:24+0000\n" 12 | "Last-Translator: Peter Jespersen \n" 13 | "Language-Team: Danish \n" 15 | "Language: da\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 20 | "X-Generator: Weblate 4.2.1\n" 21 | 22 | #: src/menu/menu.c:1017 23 | msgid "Go there..." 24 | msgstr "Gå derhen..." 25 | 26 | #: src/menu/menu.c:1037 27 | msgid "Reconfigure" 28 | msgstr "Genindstil" 29 | 30 | #: src/menu/menu.c:1039 31 | msgid "Exit" 32 | msgstr "Afslut" 33 | 34 | #: src/menu/menu.c:1055 35 | msgid "Minimize" 36 | msgstr "Minimer" 37 | 38 | #: src/menu/menu.c:1057 39 | msgid "Maximize" 40 | msgstr "Maksimer" 41 | 42 | #: src/menu/menu.c:1059 43 | msgid "Fullscreen" 44 | msgstr "Fuldskærm" 45 | 46 | #: src/menu/menu.c:1061 47 | msgid "Roll Up/Down" 48 | msgstr "Rul Op/Ned" 49 | 50 | #: src/menu/menu.c:1063 51 | msgid "Decorations" 52 | msgstr "Dekorationer" 53 | 54 | #: src/menu/menu.c:1065 55 | msgid "Always on Top" 56 | msgstr "Altid øverst" 57 | 58 | #: src/menu/menu.c:1070 59 | msgid "Move Left" 60 | msgstr "Flyt til venstre" 61 | 62 | #: src/menu/menu.c:1077 63 | msgid "Move Right" 64 | msgstr "Flyt til højre" 65 | 66 | #: src/menu/menu.c:1082 67 | msgid "Always on Visible Workspace" 68 | msgstr "Altid på synlig arbejdsplads" 69 | 70 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 71 | msgid "Workspace" 72 | msgstr "Arbejdsplads" 73 | 74 | #: src/menu/menu.c:1088 75 | msgid "Close" 76 | msgstr "Luk" 77 | -------------------------------------------------------------------------------- /po/de.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2022 3 | # This file is distributed under the same license as the labwc package. 4 | # Consolatis , 2022. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-06-23 13:42+0000\n" 12 | "Last-Translator: Standreas \n" 13 | "Language-Team: German \n" 14 | "Language: de\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 19 | "X-Generator: Weblate 4.2.1\n" 20 | 21 | #: src/menu/menu.c:1017 22 | msgid "Go there..." 23 | msgstr "" 24 | 25 | #: src/menu/menu.c:1037 26 | msgid "Reconfigure" 27 | msgstr "Rekonfigurieren" 28 | 29 | #: src/menu/menu.c:1039 30 | msgid "Exit" 31 | msgstr "Beenden" 32 | 33 | #: src/menu/menu.c:1055 34 | msgid "Minimize" 35 | msgstr "Minimieren" 36 | 37 | #: src/menu/menu.c:1057 38 | msgid "Maximize" 39 | msgstr "Maximieren" 40 | 41 | #: src/menu/menu.c:1059 42 | msgid "Fullscreen" 43 | msgstr "Vollbild" 44 | 45 | #: src/menu/menu.c:1061 46 | msgid "Roll Up/Down" 47 | msgstr "Hoch/Runterrollen" 48 | 49 | #: src/menu/menu.c:1063 50 | msgid "Decorations" 51 | msgstr "Dekorationen" 52 | 53 | #: src/menu/menu.c:1065 54 | msgid "Always on Top" 55 | msgstr "Immer im Vordergrund" 56 | 57 | #: src/menu/menu.c:1070 58 | msgid "Move Left" 59 | msgstr "nach links" 60 | 61 | #: src/menu/menu.c:1077 62 | msgid "Move Right" 63 | msgstr "nach rechts" 64 | 65 | #: src/menu/menu.c:1082 66 | msgid "Always on Visible Workspace" 67 | msgstr "Immer auf aktiver Arbeitsfläche" 68 | 69 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 70 | msgid "Workspace" 71 | msgstr "Arbeitsfläche" 72 | 73 | #: src/menu/menu.c:1088 74 | msgid "Close" 75 | msgstr "Schließen" 76 | -------------------------------------------------------------------------------- /po/el.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2024 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-09-25 20:01+0000\n" 12 | "Last-Translator: Giannis Antypas \n" 13 | "Language-Team: Greek \n" 15 | "Language: el\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 20 | "X-Generator: Weblate 4.2.1\n" 21 | 22 | #: src/menu/menu.c:1017 23 | msgid "Go there..." 24 | msgstr "Πήγαινε εκεί..." 25 | 26 | #: src/menu/menu.c:1037 27 | msgid "Reconfigure" 28 | msgstr "Επαναρύθμιση" 29 | 30 | #: src/menu/menu.c:1039 31 | msgid "Exit" 32 | msgstr "Έξοδος" 33 | 34 | #: src/menu/menu.c:1055 35 | msgid "Minimize" 36 | msgstr "Ελαχιστοποίηση" 37 | 38 | #: src/menu/menu.c:1057 39 | msgid "Maximize" 40 | msgstr "Μεγιστοποίηση" 41 | 42 | #: src/menu/menu.c:1059 43 | msgid "Fullscreen" 44 | msgstr "Πλήρης οθόνη" 45 | 46 | #: src/menu/menu.c:1061 47 | msgid "Roll Up/Down" 48 | msgstr "Τύλιγμα/Ξετύλιγμα" 49 | 50 | #: src/menu/menu.c:1063 51 | msgid "Decorations" 52 | msgstr "Διακόσμηση" 53 | 54 | #: src/menu/menu.c:1065 55 | msgid "Always on Top" 56 | msgstr "Πάντα στο προσκήνιο" 57 | 58 | #: src/menu/menu.c:1070 59 | msgid "Move Left" 60 | msgstr "Στα αριστερά" 61 | 62 | #: src/menu/menu.c:1077 63 | msgid "Move Right" 64 | msgstr "Στα δεξιά" 65 | 66 | #: src/menu/menu.c:1082 67 | msgid "Always on Visible Workspace" 68 | msgstr "Πάντα στην ενεργή επιφάνεια εργασίας" 69 | 70 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 71 | msgid "Workspace" 72 | msgstr "Επιφάνεια εργασίας" 73 | 74 | #: src/menu/menu.c:1088 75 | msgid "Close" 76 | msgstr "Κλείσιμο" 77 | -------------------------------------------------------------------------------- /po/es.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2022 3 | # This file is distributed under the same license as the labwc package. 4 | # Mick Amadio <01micko@gmail.com>, 2022. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-03-19 11:08+0000\n" 12 | "Last-Translator: Roberalz \n" 13 | "Language-Team: Spanish \n" 14 | "Language: es\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 19 | "X-Generator: Weblate 4.2.1\n" 20 | 21 | #: src/menu/menu.c:1017 22 | msgid "Go there..." 23 | msgstr "" 24 | 25 | #: src/menu/menu.c:1037 26 | msgid "Reconfigure" 27 | msgstr "Reconfigurar" 28 | 29 | #: src/menu/menu.c:1039 30 | msgid "Exit" 31 | msgstr "Salir" 32 | 33 | #: src/menu/menu.c:1055 34 | msgid "Minimize" 35 | msgstr "Minimizar" 36 | 37 | #: src/menu/menu.c:1057 38 | msgid "Maximize" 39 | msgstr "Maximizar" 40 | 41 | #: src/menu/menu.c:1059 42 | msgid "Fullscreen" 43 | msgstr "Pantalla completa" 44 | 45 | #: src/menu/menu.c:1061 46 | msgid "Roll Up/Down" 47 | msgstr "Enrollar hacia arriba/abajo" 48 | 49 | #: src/menu/menu.c:1063 50 | msgid "Decorations" 51 | msgstr "Decoraciones" 52 | 53 | #: src/menu/menu.c:1065 54 | msgid "Always on Top" 55 | msgstr "Siempre encima" 56 | 57 | #: src/menu/menu.c:1070 58 | msgid "Move Left" 59 | msgstr "Mover a la izquierda" 60 | 61 | #: src/menu/menu.c:1077 62 | msgid "Move Right" 63 | msgstr "Mover a la derecha" 64 | 65 | #: src/menu/menu.c:1082 66 | msgid "Always on Visible Workspace" 67 | msgstr "Siempre en un espacio de trabajo visible" 68 | 69 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 70 | msgid "Workspace" 71 | msgstr "Espacio de trabajo" 72 | 73 | #: src/menu/menu.c:1088 74 | msgid "Close" 75 | msgstr "Cerrar" 76 | -------------------------------------------------------------------------------- /po/et.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2023 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-09-23 20:01+0000\n" 12 | "Last-Translator: Priit Jõerüüt \n" 13 | "Language-Team: Estonian \n" 15 | "Language: et\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 20 | "X-Generator: Weblate 4.2.1\n" 21 | 22 | #: src/menu/menu.c:1017 23 | msgid "Go there..." 24 | msgstr "Suundu..." 25 | 26 | #: src/menu/menu.c:1037 27 | msgid "Reconfigure" 28 | msgstr "Seadista uuesti" 29 | 30 | #: src/menu/menu.c:1039 31 | msgid "Exit" 32 | msgstr "Välju" 33 | 34 | #: src/menu/menu.c:1055 35 | msgid "Minimize" 36 | msgstr "Vähenda" 37 | 38 | #: src/menu/menu.c:1057 39 | msgid "Maximize" 40 | msgstr "Suurenda" 41 | 42 | #: src/menu/menu.c:1059 43 | msgid "Fullscreen" 44 | msgstr "Täisekraanivaade" 45 | 46 | #: src/menu/menu.c:1061 47 | msgid "Roll Up/Down" 48 | msgstr "Keri üles/alla" 49 | 50 | #: src/menu/menu.c:1063 51 | msgid "Decorations" 52 | msgstr "Akende välimus" 53 | 54 | #: src/menu/menu.c:1065 55 | msgid "Always on Top" 56 | msgstr "Alati kõige peal" 57 | 58 | #: src/menu/menu.c:1070 59 | msgid "Move Left" 60 | msgstr "Tõsta vasakule" 61 | 62 | #: src/menu/menu.c:1077 63 | msgid "Move Right" 64 | msgstr "Tõsta paremale" 65 | 66 | #: src/menu/menu.c:1082 67 | msgid "Always on Visible Workspace" 68 | msgstr "Alati nähtav töölaual" 69 | 70 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 71 | msgid "Workspace" 72 | msgstr "Töölaud" 73 | 74 | #: src/menu/menu.c:1088 75 | msgid "Close" 76 | msgstr "Sulge" 77 | -------------------------------------------------------------------------------- /po/eu.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2023 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-03-19 11:08+0000\n" 12 | "Last-Translator: Roberalz \n" 13 | "Language-Team: Basque \n" 14 | "Language: eu\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 19 | "X-Generator: Weblate 4.2.1\n" 20 | 21 | #: src/menu/menu.c:1017 22 | msgid "Go there..." 23 | msgstr "" 24 | 25 | #: src/menu/menu.c:1037 26 | msgid "Reconfigure" 27 | msgstr "Berriz konfiguratu" 28 | 29 | #: src/menu/menu.c:1039 30 | msgid "Exit" 31 | msgstr "Irten" 32 | 33 | #: src/menu/menu.c:1055 34 | msgid "Minimize" 35 | msgstr "Minimizatu" 36 | 37 | #: src/menu/menu.c:1057 38 | msgid "Maximize" 39 | msgstr "Maximizatu" 40 | 41 | #: src/menu/menu.c:1059 42 | msgid "Fullscreen" 43 | msgstr "Pantaila osoa" 44 | 45 | #: src/menu/menu.c:1061 46 | msgid "Roll Up/Down" 47 | msgstr "Ibili gora/behera" 48 | 49 | #: src/menu/menu.c:1063 50 | msgid "Decorations" 51 | msgstr "Apaingarriak" 52 | 53 | #: src/menu/menu.c:1065 54 | msgid "Always on Top" 55 | msgstr "Beti gainean" 56 | 57 | #: src/menu/menu.c:1070 58 | msgid "Move Left" 59 | msgstr "Mugitu ezkerrera" 60 | 61 | #: src/menu/menu.c:1077 62 | msgid "Move Right" 63 | msgstr "Mugitu eskuinera" 64 | 65 | #: src/menu/menu.c:1082 66 | msgid "Always on Visible Workspace" 67 | msgstr "Beti ikusgai dagoen lan-eremuan" 68 | 69 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 70 | msgid "Workspace" 71 | msgstr "Langunea" 72 | 73 | #: src/menu/menu.c:1088 74 | msgid "Close" 75 | msgstr "Itxi" 76 | -------------------------------------------------------------------------------- /po/fa.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2024 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 | "Last-Translator: Automatically generated\n" 13 | "Language-Team: none\n" 14 | "Language: fa\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: src/menu/menu.c:1017 20 | msgid "Go there..." 21 | msgstr "" 22 | 23 | #: src/menu/menu.c:1037 24 | msgid "Reconfigure" 25 | msgstr "" 26 | 27 | #: src/menu/menu.c:1039 28 | msgid "Exit" 29 | msgstr "" 30 | 31 | #: src/menu/menu.c:1055 32 | msgid "Minimize" 33 | msgstr "" 34 | 35 | #: src/menu/menu.c:1057 36 | msgid "Maximize" 37 | msgstr "" 38 | 39 | #: src/menu/menu.c:1059 40 | msgid "Fullscreen" 41 | msgstr "" 42 | 43 | #: src/menu/menu.c:1061 44 | msgid "Roll Up/Down" 45 | msgstr "" 46 | 47 | #: src/menu/menu.c:1063 48 | msgid "Decorations" 49 | msgstr "" 50 | 51 | #: src/menu/menu.c:1065 52 | msgid "Always on Top" 53 | msgstr "" 54 | 55 | #: src/menu/menu.c:1070 56 | msgid "Move Left" 57 | msgstr "" 58 | 59 | #: src/menu/menu.c:1077 60 | msgid "Move Right" 61 | msgstr "" 62 | 63 | #: src/menu/menu.c:1082 64 | msgid "Always on Visible Workspace" 65 | msgstr "" 66 | 67 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 68 | msgid "Workspace" 69 | msgstr "" 70 | 71 | #: src/menu/menu.c:1088 72 | msgid "Close" 73 | msgstr "" 74 | -------------------------------------------------------------------------------- /po/fi.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2023 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-04-20 15:23+0000\n" 12 | "Last-Translator: Jouni Järvinen \n" 13 | "Language-Team: Finnish \n" 14 | "Language: fi\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 19 | "X-Generator: Weblate 4.2.1\n" 20 | 21 | #: src/menu/menu.c:1017 22 | msgid "Go there..." 23 | msgstr "" 24 | 25 | #: src/menu/menu.c:1037 26 | msgid "Reconfigure" 27 | msgstr "Uudelleenmääritä" 28 | 29 | #: src/menu/menu.c:1039 30 | msgid "Exit" 31 | msgstr "Poistu" 32 | 33 | #: src/menu/menu.c:1055 34 | msgid "Minimize" 35 | msgstr "Pienennä" 36 | 37 | #: src/menu/menu.c:1057 38 | msgid "Maximize" 39 | msgstr "Suurenna" 40 | 41 | #: src/menu/menu.c:1059 42 | msgid "Fullscreen" 43 | msgstr "Koko näyttö" 44 | 45 | #: src/menu/menu.c:1061 46 | msgid "Roll Up/Down" 47 | msgstr "Rullaa ylös/alas" 48 | 49 | #: src/menu/menu.c:1063 50 | msgid "Decorations" 51 | msgstr "Kehykset" 52 | 53 | #: src/menu/menu.c:1065 54 | msgid "Always on Top" 55 | msgstr "Aina ylimpänä" 56 | 57 | #: src/menu/menu.c:1070 58 | msgid "Move Left" 59 | msgstr "Siirrä vasemmalle" 60 | 61 | #: src/menu/menu.c:1077 62 | msgid "Move Right" 63 | msgstr "Siirrä oikealle" 64 | 65 | #: src/menu/menu.c:1082 66 | msgid "Always on Visible Workspace" 67 | msgstr "Aina näkyvässä työtilassa" 68 | 69 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 70 | msgid "Workspace" 71 | msgstr "Työtila" 72 | 73 | #: src/menu/menu.c:1088 74 | msgid "Close" 75 | msgstr "Sulje" 76 | -------------------------------------------------------------------------------- /po/fr.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2024 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-09-30 20:01+0000\n" 12 | "Last-Translator: Eric Migeon \n" 13 | "Language-Team: French \n" 15 | "Language: fr\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=2; plural=n > 1;\n" 20 | "X-Generator: Weblate 4.2.1\n" 21 | 22 | #: src/menu/menu.c:1017 23 | msgid "Go there..." 24 | msgstr "" 25 | 26 | #: src/menu/menu.c:1037 27 | msgid "Reconfigure" 28 | msgstr "Reconfigurer" 29 | 30 | #: src/menu/menu.c:1039 31 | msgid "Exit" 32 | msgstr "Quitter" 33 | 34 | #: src/menu/menu.c:1055 35 | msgid "Minimize" 36 | msgstr "Minimiser" 37 | 38 | #: src/menu/menu.c:1057 39 | msgid "Maximize" 40 | msgstr "Maximiser" 41 | 42 | #: src/menu/menu.c:1059 43 | msgid "Fullscreen" 44 | msgstr "Plein écran" 45 | 46 | #: src/menu/menu.c:1061 47 | msgid "Roll Up/Down" 48 | msgstr "Enrouler/Dérouler" 49 | 50 | #: src/menu/menu.c:1063 51 | msgid "Decorations" 52 | msgstr "Décorations" 53 | 54 | #: src/menu/menu.c:1065 55 | msgid "Always on Top" 56 | msgstr "Toujours au dessus" 57 | 58 | #: src/menu/menu.c:1070 59 | msgid "Move Left" 60 | msgstr "Déplacer à gauche" 61 | 62 | #: src/menu/menu.c:1077 63 | msgid "Move Right" 64 | msgstr "Déplacer à droite" 65 | 66 | #: src/menu/menu.c:1082 67 | msgid "Always on Visible Workspace" 68 | msgstr "Toujours sur le bureau visible" 69 | 70 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 71 | msgid "Workspace" 72 | msgstr "Bureau" 73 | 74 | #: src/menu/menu.c:1088 75 | msgid "Close" 76 | msgstr "Fermer" 77 | -------------------------------------------------------------------------------- /po/gl.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2023 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-03-19 11:08+0000\n" 12 | "Last-Translator: Roberalz \n" 13 | "Language-Team: Galician \n" 14 | "Language: gl\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 19 | "X-Generator: Weblate 4.2.1\n" 20 | 21 | #: src/menu/menu.c:1017 22 | msgid "Go there..." 23 | msgstr "" 24 | 25 | #: src/menu/menu.c:1037 26 | msgid "Reconfigure" 27 | msgstr "Reconfigurar" 28 | 29 | #: src/menu/menu.c:1039 30 | msgid "Exit" 31 | msgstr "Saír" 32 | 33 | #: src/menu/menu.c:1055 34 | msgid "Minimize" 35 | msgstr "Minimizar" 36 | 37 | #: src/menu/menu.c:1057 38 | msgid "Maximize" 39 | msgstr "Maximizar" 40 | 41 | #: src/menu/menu.c:1059 42 | msgid "Fullscreen" 43 | msgstr "Pantalla completa" 44 | 45 | #: src/menu/menu.c:1061 46 | msgid "Roll Up/Down" 47 | msgstr "Rodar cara arriba/abaixo" 48 | 49 | #: src/menu/menu.c:1063 50 | msgid "Decorations" 51 | msgstr "Decoracións" 52 | 53 | #: src/menu/menu.c:1065 54 | msgid "Always on Top" 55 | msgstr "Sempre enriba" 56 | 57 | #: src/menu/menu.c:1070 58 | msgid "Move Left" 59 | msgstr "Mover á esquerda" 60 | 61 | #: src/menu/menu.c:1077 62 | msgid "Move Right" 63 | msgstr "Mover á dereita" 64 | 65 | #: src/menu/menu.c:1082 66 | msgid "Always on Visible Workspace" 67 | msgstr "Sempre no espazo de traballo visible" 68 | 69 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 70 | msgid "Workspace" 71 | msgstr "Espazo de traballo" 72 | 73 | #: src/menu/menu.c:1088 74 | msgid "Close" 75 | msgstr "Pechar" 76 | -------------------------------------------------------------------------------- /po/hu.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2024 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-02-19 21:23+0000\n" 12 | "Last-Translator: winerysearch \n" 13 | "Language-Team: Hungarian \n" 14 | "Language: hu\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 19 | "X-Generator: Weblate 4.2.1\n" 20 | 21 | #: src/menu/menu.c:1017 22 | msgid "Go there..." 23 | msgstr "" 24 | 25 | #: src/menu/menu.c:1037 26 | msgid "Reconfigure" 27 | msgstr "Rekonfigurál" 28 | 29 | #: src/menu/menu.c:1039 30 | msgid "Exit" 31 | msgstr "Kilépés" 32 | 33 | #: src/menu/menu.c:1055 34 | msgid "Minimize" 35 | msgstr "Kis méret" 36 | 37 | #: src/menu/menu.c:1057 38 | msgid "Maximize" 39 | msgstr "Teljes méret" 40 | 41 | #: src/menu/menu.c:1059 42 | msgid "Fullscreen" 43 | msgstr "Teljes képernyő" 44 | 45 | #: src/menu/menu.c:1061 46 | msgid "Roll Up/Down" 47 | msgstr "Felhúz / Legördül" 48 | 49 | #: src/menu/menu.c:1063 50 | msgid "Decorations" 51 | msgstr "Dekorációk" 52 | 53 | #: src/menu/menu.c:1065 54 | msgid "Always on Top" 55 | msgstr "Mindig felül" 56 | 57 | #: src/menu/menu.c:1070 58 | msgid "Move Left" 59 | msgstr "Balra dokkol" 60 | 61 | #: src/menu/menu.c:1077 62 | msgid "Move Right" 63 | msgstr "Jobbra dokkol" 64 | 65 | #: src/menu/menu.c:1082 66 | msgid "Always on Visible Workspace" 67 | msgstr "Kitűz" 68 | 69 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 70 | msgid "Workspace" 71 | msgstr "Munkaasztal" 72 | 73 | #: src/menu/menu.c:1088 74 | msgid "Close" 75 | msgstr "Bezárás" 76 | -------------------------------------------------------------------------------- /po/id.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2023 3 | # This file is distributed under the same license as the labwc package. 4 | # May Mantari , 2023. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-03-12 21:48+0000\n" 12 | "Last-Translator: alwanasary \n" 13 | "Language-Team: Indonesian \n" 14 | "Language: id\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=1; plural=0;\n" 19 | "X-Generator: Weblate 4.2.1\n" 20 | 21 | #: src/menu/menu.c:1017 22 | msgid "Go there..." 23 | msgstr "" 24 | 25 | #: src/menu/menu.c:1037 26 | msgid "Reconfigure" 27 | msgstr "Atur Ulang" 28 | 29 | #: src/menu/menu.c:1039 30 | msgid "Exit" 31 | msgstr "Keluar" 32 | 33 | #: src/menu/menu.c:1055 34 | msgid "Minimize" 35 | msgstr "Sembunyikan" 36 | 37 | #: src/menu/menu.c:1057 38 | msgid "Maximize" 39 | msgstr "Perluas Jendela" 40 | 41 | #: src/menu/menu.c:1059 42 | msgid "Fullscreen" 43 | msgstr "Tampil Menyeluruh" 44 | 45 | #: src/menu/menu.c:1061 46 | msgid "Roll Up/Down" 47 | msgstr "Gulir atas/bawah" 48 | 49 | #: src/menu/menu.c:1063 50 | msgid "Decorations" 51 | msgstr "Dekorasi" 52 | 53 | #: src/menu/menu.c:1065 54 | msgid "Always on Top" 55 | msgstr "Selalu di Muka" 56 | 57 | #: src/menu/menu.c:1070 58 | msgid "Move Left" 59 | msgstr "Geser ke Kiri" 60 | 61 | #: src/menu/menu.c:1077 62 | msgid "Move Right" 63 | msgstr "Geser ke Kanan" 64 | 65 | #: src/menu/menu.c:1082 66 | msgid "Always on Visible Workspace" 67 | msgstr "Selalu pada Ruang Kerja yang Terlihat" 68 | 69 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 70 | msgid "Workspace" 71 | msgstr "Ruang Kerja" 72 | 73 | #: src/menu/menu.c:1088 74 | msgid "Close" 75 | msgstr "Tutup" 76 | -------------------------------------------------------------------------------- /po/it.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2022 3 | # This file is distributed under the same license as the labwc package. 4 | # Mick Amadio <01micko@gmail.com>, 2022. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-09-21 20:01+0000\n" 12 | "Last-Translator: Standreas \n" 13 | "Language-Team: Italian \n" 15 | "Language: it\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 20 | "X-Generator: Weblate 4.2.1\n" 21 | 22 | #: src/menu/menu.c:1017 23 | msgid "Go there..." 24 | msgstr "Vai lì..." 25 | 26 | #: src/menu/menu.c:1037 27 | msgid "Reconfigure" 28 | msgstr "Riconfigura" 29 | 30 | #: src/menu/menu.c:1039 31 | msgid "Exit" 32 | msgstr "Esci" 33 | 34 | #: src/menu/menu.c:1055 35 | msgid "Minimize" 36 | msgstr "Minimizza" 37 | 38 | #: src/menu/menu.c:1057 39 | msgid "Maximize" 40 | msgstr "Massimizza" 41 | 42 | #: src/menu/menu.c:1059 43 | msgid "Fullscreen" 44 | msgstr "Schermo intero" 45 | 46 | #: src/menu/menu.c:1061 47 | msgid "Roll Up/Down" 48 | msgstr "Arrotola/srotola" 49 | 50 | #: src/menu/menu.c:1063 51 | msgid "Decorations" 52 | msgstr "Decorazioni" 53 | 54 | #: src/menu/menu.c:1065 55 | msgid "Always on Top" 56 | msgstr "Sempre sopra" 57 | 58 | #: src/menu/menu.c:1070 59 | msgid "Move Left" 60 | msgstr "Sposta a sinistra" 61 | 62 | #: src/menu/menu.c:1077 63 | msgid "Move Right" 64 | msgstr "Sposta a destra" 65 | 66 | #: src/menu/menu.c:1082 67 | msgid "Always on Visible Workspace" 68 | msgstr "Sempre sull'area di lavoro visibile" 69 | 70 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 71 | msgid "Workspace" 72 | msgstr "Area di lavoro" 73 | 74 | #: src/menu/menu.c:1088 75 | msgid "Close" 76 | msgstr "Chiudi" 77 | -------------------------------------------------------------------------------- /po/ja.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2023 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-03-15 16:23+0000\n" 12 | "Last-Translator: Hiroaki Yamamoto \n" 13 | "Language-Team: Japanese \n" 14 | "Language: ja\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=1; plural=0;\n" 19 | "X-Generator: Weblate 4.2.1\n" 20 | 21 | #: src/menu/menu.c:1017 22 | msgid "Go there..." 23 | msgstr "" 24 | 25 | #: src/menu/menu.c:1037 26 | msgid "Reconfigure" 27 | msgstr "再設定" 28 | 29 | #: src/menu/menu.c:1039 30 | msgid "Exit" 31 | msgstr "終了" 32 | 33 | #: src/menu/menu.c:1055 34 | msgid "Minimize" 35 | msgstr "最小化" 36 | 37 | #: src/menu/menu.c:1057 38 | msgid "Maximize" 39 | msgstr "最大化" 40 | 41 | #: src/menu/menu.c:1059 42 | msgid "Fullscreen" 43 | msgstr "フルスクリーン" 44 | 45 | #: src/menu/menu.c:1061 46 | msgid "Roll Up/Down" 47 | msgstr "折りたたむ/広げる" 48 | 49 | #: src/menu/menu.c:1063 50 | msgid "Decorations" 51 | msgstr "デコレーション" 52 | 53 | #: src/menu/menu.c:1065 54 | msgid "Always on Top" 55 | msgstr "常に最前面に表示" 56 | 57 | #: src/menu/menu.c:1070 58 | msgid "Move Left" 59 | msgstr "左に移動" 60 | 61 | #: src/menu/menu.c:1077 62 | msgid "Move Right" 63 | msgstr "右に移動" 64 | 65 | #: src/menu/menu.c:1082 66 | msgid "Always on Visible Workspace" 67 | msgstr "現在のワークスペースに常に表示" 68 | 69 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 70 | msgid "Workspace" 71 | msgstr "ワークスペース" 72 | 73 | #: src/menu/menu.c:1088 74 | msgid "Close" 75 | msgstr "閉じる" 76 | -------------------------------------------------------------------------------- /po/ka.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2023 3 | # This file is distributed under the same license as the labwc package. 4 | # Temuri Doghonadze , 2023. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2023-02-22 09:43+0100\n" 12 | "Last-Translator: Temuri Doghonadze \n" 13 | "Language-Team: Georgian \n" 14 | "Language: ka\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | "X-Generator: Poedit 3.2.2\n" 20 | 21 | #: src/menu/menu.c:1017 22 | msgid "Go there..." 23 | msgstr "" 24 | 25 | #: src/menu/menu.c:1037 26 | msgid "Reconfigure" 27 | msgstr "თავიდან მორგება" 28 | 29 | #: src/menu/menu.c:1039 30 | msgid "Exit" 31 | msgstr "გასვლა" 32 | 33 | #: src/menu/menu.c:1055 34 | msgid "Minimize" 35 | msgstr "ჩაკეცვა" 36 | 37 | #: src/menu/menu.c:1057 38 | msgid "Maximize" 39 | msgstr "გადიდება" 40 | 41 | #: src/menu/menu.c:1059 42 | msgid "Fullscreen" 43 | msgstr "მთელ ეკრანზე" 44 | 45 | #: src/menu/menu.c:1061 46 | msgid "Roll Up/Down" 47 | msgstr "" 48 | 49 | #: src/menu/menu.c:1063 50 | msgid "Decorations" 51 | msgstr "დეკორაციები" 52 | 53 | #: src/menu/menu.c:1065 54 | msgid "Always on Top" 55 | msgstr "ყოველთვისყველაზეზემოდან" 56 | 57 | #: src/menu/menu.c:1070 58 | msgid "Move Left" 59 | msgstr "მარცხნივ გაწევა" 60 | 61 | #: src/menu/menu.c:1077 62 | msgid "Move Right" 63 | msgstr "მარჯვნივ გაწევა" 64 | 65 | #: src/menu/menu.c:1082 66 | msgid "Always on Visible Workspace" 67 | msgstr "" 68 | 69 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 70 | msgid "Workspace" 71 | msgstr "სამუშაო ადგილი" 72 | 73 | #: src/menu/menu.c:1088 74 | msgid "Close" 75 | msgstr "დახურვა" 76 | -------------------------------------------------------------------------------- /po/ko.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2024 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-07-03 08:01+0000\n" 12 | "Last-Translator: tark1998 \n" 13 | "Language-Team: Korean \n" 14 | "Language: ko\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=1; plural=0;\n" 19 | "X-Generator: Weblate 4.2.1\n" 20 | 21 | #: src/menu/menu.c:1017 22 | msgid "Go there..." 23 | msgstr "" 24 | 25 | #: src/menu/menu.c:1037 26 | msgid "Reconfigure" 27 | msgstr "재설정" 28 | 29 | #: src/menu/menu.c:1039 30 | msgid "Exit" 31 | msgstr "종료" 32 | 33 | #: src/menu/menu.c:1055 34 | msgid "Minimize" 35 | msgstr "최소화" 36 | 37 | #: src/menu/menu.c:1057 38 | msgid "Maximize" 39 | msgstr "최대화" 40 | 41 | #: src/menu/menu.c:1059 42 | msgid "Fullscreen" 43 | msgstr "전체화면" 44 | 45 | #: src/menu/menu.c:1061 46 | msgid "Roll Up/Down" 47 | msgstr "접기/펼치기" 48 | 49 | #: src/menu/menu.c:1063 50 | msgid "Decorations" 51 | msgstr "창 장식" 52 | 53 | #: src/menu/menu.c:1065 54 | msgid "Always on Top" 55 | msgstr "항상 최상단에 표시" 56 | 57 | #: src/menu/menu.c:1070 58 | msgid "Move Left" 59 | msgstr "좌로 이동" 60 | 61 | #: src/menu/menu.c:1077 62 | msgid "Move Right" 63 | msgstr "우로 이동" 64 | 65 | #: src/menu/menu.c:1082 66 | msgid "Always on Visible Workspace" 67 | msgstr "현재 작업공간에 항상 표시" 68 | 69 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 70 | msgid "Workspace" 71 | msgstr "작업공간" 72 | 73 | #: src/menu/menu.c:1088 74 | msgid "Close" 75 | msgstr "닫기" 76 | -------------------------------------------------------------------------------- /po/labwc.pot: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2024 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: labwc\n" 10 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 11 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: src/menu/menu.c:1017 21 | msgid "Go there..." 22 | msgstr "" 23 | 24 | #: src/menu/menu.c:1037 25 | msgid "Reconfigure" 26 | msgstr "" 27 | 28 | #: src/menu/menu.c:1039 29 | msgid "Exit" 30 | msgstr "" 31 | 32 | #: src/menu/menu.c:1055 33 | msgid "Minimize" 34 | msgstr "" 35 | 36 | #: src/menu/menu.c:1057 37 | msgid "Maximize" 38 | msgstr "" 39 | 40 | #: src/menu/menu.c:1059 41 | msgid "Fullscreen" 42 | msgstr "" 43 | 44 | #: src/menu/menu.c:1061 45 | msgid "Roll Up/Down" 46 | msgstr "" 47 | 48 | #: src/menu/menu.c:1063 49 | msgid "Decorations" 50 | msgstr "" 51 | 52 | #: src/menu/menu.c:1065 53 | msgid "Always on Top" 54 | msgstr "" 55 | 56 | #: src/menu/menu.c:1070 57 | msgid "Move Left" 58 | msgstr "" 59 | 60 | #: src/menu/menu.c:1077 61 | msgid "Move Right" 62 | msgstr "" 63 | 64 | #: src/menu/menu.c:1082 65 | msgid "Always on Visible Workspace" 66 | msgstr "" 67 | 68 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 69 | msgid "Workspace" 70 | msgstr "" 71 | 72 | #: src/menu/menu.c:1088 73 | msgid "Close" 74 | msgstr "" 75 | -------------------------------------------------------------------------------- /po/lt.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2023 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-02-29 14:23+0000\n" 12 | "Last-Translator: Moo \n" 13 | "Language-Team: Lithuanian \n" 14 | "Language: lt\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=3; plural=(n % 10 == 1 && (n % 100 < 11 || n % 100 > 19)) ? 0 : ((n % 10 >= 2 && n % 10 <= 9 && (n % 100 < 11 || n % 100 > 19)) ? 1 : 2);\n" 19 | "X-Generator: Weblate 4.2.1\n" 20 | 21 | #: src/menu/menu.c:1017 22 | msgid "Go there..." 23 | msgstr "" 24 | 25 | #: src/menu/menu.c:1037 26 | msgid "Reconfigure" 27 | msgstr "Konfigūruoti iš naujo" 28 | 29 | #: src/menu/menu.c:1039 30 | msgid "Exit" 31 | msgstr "Išeiti" 32 | 33 | #: src/menu/menu.c:1055 34 | msgid "Minimize" 35 | msgstr "Suskleisti" 36 | 37 | #: src/menu/menu.c:1057 38 | msgid "Maximize" 39 | msgstr "Išskleisti" 40 | 41 | #: src/menu/menu.c:1059 42 | msgid "Fullscreen" 43 | msgstr "Visas ekranas" 44 | 45 | #: src/menu/menu.c:1061 46 | msgid "Roll Up/Down" 47 | msgstr "Užraityti/atraityti" 48 | 49 | #: src/menu/menu.c:1063 50 | msgid "Decorations" 51 | msgstr "Dekoracijos" 52 | 53 | #: src/menu/menu.c:1065 54 | msgid "Always on Top" 55 | msgstr "Visada viršuje" 56 | 57 | #: src/menu/menu.c:1070 58 | msgid "Move Left" 59 | msgstr "Perkelti kairėn" 60 | 61 | #: src/menu/menu.c:1077 62 | msgid "Move Right" 63 | msgstr "Perkelti dešinėn" 64 | 65 | #: src/menu/menu.c:1082 66 | msgid "Always on Visible Workspace" 67 | msgstr "Visada matomoje darbo srityje" 68 | 69 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 70 | msgid "Workspace" 71 | msgstr "Darbo sritis" 72 | 73 | #: src/menu/menu.c:1088 74 | msgid "Close" 75 | msgstr "Užverti" 76 | -------------------------------------------------------------------------------- /po/meson.build: -------------------------------------------------------------------------------- 1 | i18n = import('i18n') 2 | 3 | add_project_arguments( 4 | '-DGETTEXT_PACKAGE="' + meson.project_name() + '"', 5 | '-DLOCALEDIR="' + get_option('prefix') / get_option('localedir') + '"', 6 | language:'c', 7 | ) 8 | 9 | i18n.gettext( 10 | meson.project_name(), 11 | args: [ 12 | '--directory=' + source_root, 13 | '--add-comments=TRANSLATORS', 14 | '--keyword=_', 15 | '--msgid-bugs=https://github.com/labwc/labwc/issues', 16 | ], 17 | preset: 'glib', 18 | ) 19 | -------------------------------------------------------------------------------- /po/nl.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2023 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-09-21 20:01+0000\n" 12 | "Last-Translator: Heimen Stoffels \n" 13 | "Language-Team: Dutch \n" 15 | "Language: nl\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 20 | "X-Generator: Weblate 4.2.1\n" 21 | 22 | #: src/menu/menu.c:1017 23 | msgid "Go there..." 24 | msgstr "Openen…" 25 | 26 | #: src/menu/menu.c:1037 27 | msgid "Reconfigure" 28 | msgstr "Opnieuw instellen" 29 | 30 | #: src/menu/menu.c:1039 31 | msgid "Exit" 32 | msgstr "Afsluiten" 33 | 34 | #: src/menu/menu.c:1055 35 | msgid "Minimize" 36 | msgstr "Minimaliseren" 37 | 38 | #: src/menu/menu.c:1057 39 | msgid "Maximize" 40 | msgstr "Maximaliseren" 41 | 42 | #: src/menu/menu.c:1059 43 | msgid "Fullscreen" 44 | msgstr "Schermvullende weergave" 45 | 46 | #: src/menu/menu.c:1061 47 | msgid "Roll Up/Down" 48 | msgstr "Op-/Afrollen" 49 | 50 | #: src/menu/menu.c:1063 51 | msgid "Decorations" 52 | msgstr "Decoraties" 53 | 54 | #: src/menu/menu.c:1065 55 | msgid "Always on Top" 56 | msgstr "Altijd bovenaan" 57 | 58 | #: src/menu/menu.c:1070 59 | msgid "Move Left" 60 | msgstr "Naar links verplaatsen" 61 | 62 | #: src/menu/menu.c:1077 63 | msgid "Move Right" 64 | msgstr "Naar rechts verplaatsen" 65 | 66 | #: src/menu/menu.c:1082 67 | msgid "Always on Visible Workspace" 68 | msgstr "Altijd op zichtbaar werkblad" 69 | 70 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 71 | msgid "Workspace" 72 | msgstr "Werkblad" 73 | 74 | #: src/menu/menu.c:1088 75 | msgid "Close" 76 | msgstr "Sluiten" 77 | -------------------------------------------------------------------------------- /po/pa.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2023 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-02-21 14:23+0000\n" 12 | "Last-Translator: A S Alam \n" 13 | "Language-Team: Punjabi \n" 14 | "Language: pa\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=n > 1;\n" 19 | "X-Generator: Weblate 4.2.1\n" 20 | 21 | #: src/menu/menu.c:1017 22 | msgid "Go there..." 23 | msgstr "" 24 | 25 | #: src/menu/menu.c:1037 26 | msgid "Reconfigure" 27 | msgstr "ਮੁੜ-ਸੰਰਚਨਾ ਕਰੋ" 28 | 29 | #: src/menu/menu.c:1039 30 | msgid "Exit" 31 | msgstr "ਬਾਹਰ" 32 | 33 | #: src/menu/menu.c:1055 34 | msgid "Minimize" 35 | msgstr "ਘੱਟੋ-ਘੱਟ" 36 | 37 | #: src/menu/menu.c:1057 38 | msgid "Maximize" 39 | msgstr "ਵੱਧ ਤੋਂ ਵੱਧ" 40 | 41 | #: src/menu/menu.c:1059 42 | msgid "Fullscreen" 43 | msgstr "ਪੂਰੀ ਸਕਰੀਨ" 44 | 45 | #: src/menu/menu.c:1061 46 | msgid "Roll Up/Down" 47 | msgstr "ਉੱਤੇ/ਹੇਠਾਂ ਸਕਰਾਓ" 48 | 49 | #: src/menu/menu.c:1063 50 | msgid "Decorations" 51 | msgstr "ਸਜਾਵਟ" 52 | 53 | #: src/menu/menu.c:1065 54 | msgid "Always on Top" 55 | msgstr "ਹਮੇਸ਼ਾਂ ਉੱਤੇ ਰੱਖੋ" 56 | 57 | #: src/menu/menu.c:1070 58 | msgid "Move Left" 59 | msgstr "ਖੱਬੇ ਭੇਜੋ" 60 | 61 | #: src/menu/menu.c:1077 62 | msgid "Move Right" 63 | msgstr "ਸੱਜੇ ਭੇਜੋ" 64 | 65 | #: src/menu/menu.c:1082 66 | msgid "Always on Visible Workspace" 67 | msgstr "ਹਮੇਸ਼ਾਂ ਦਿੱਖ ਵਰਕਸਪੇਸ ਉੱਤੇ" 68 | 69 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 70 | msgid "Workspace" 71 | msgstr "ਵਰਕਸਪੇਸ" 72 | 73 | #: src/menu/menu.c:1088 74 | msgid "Close" 75 | msgstr "ਬੰਦ ਕਰੋ" 76 | -------------------------------------------------------------------------------- /po/pl.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2023 3 | # This file is distributed under the same license as the labwc package. 4 | # Marcin Puc , 2023. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-09-21 20:01+0000\n" 12 | "Last-Translator: Jan Rolski \n" 13 | "Language-Team: Polish \n" 15 | "Language: pl\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " 20 | "|| n%100>=20) ? 1 : 2;\n" 21 | "X-Generator: Weblate 4.2.1\n" 22 | 23 | #: src/menu/menu.c:1017 24 | msgid "Go there..." 25 | msgstr "Przejdź tam..." 26 | 27 | #: src/menu/menu.c:1037 28 | msgid "Reconfigure" 29 | msgstr "Rekonfiguruj" 30 | 31 | #: src/menu/menu.c:1039 32 | msgid "Exit" 33 | msgstr "Wyjdź" 34 | 35 | #: src/menu/menu.c:1055 36 | msgid "Minimize" 37 | msgstr "Minimalizuj" 38 | 39 | #: src/menu/menu.c:1057 40 | msgid "Maximize" 41 | msgstr "Maksymalizuj" 42 | 43 | #: src/menu/menu.c:1059 44 | msgid "Fullscreen" 45 | msgstr "Pełny ekran" 46 | 47 | #: src/menu/menu.c:1061 48 | msgid "Roll Up/Down" 49 | msgstr "Zwiń w górę/w dół" 50 | 51 | #: src/menu/menu.c:1063 52 | msgid "Decorations" 53 | msgstr "Dekoracje" 54 | 55 | #: src/menu/menu.c:1065 56 | msgid "Always on Top" 57 | msgstr "Zawsze na wierzchu" 58 | 59 | #: src/menu/menu.c:1070 60 | msgid "Move Left" 61 | msgstr "Przenieś w lewo" 62 | 63 | #: src/menu/menu.c:1077 64 | msgid "Move Right" 65 | msgstr "Przenieś w prawo" 66 | 67 | #: src/menu/menu.c:1082 68 | msgid "Always on Visible Workspace" 69 | msgstr "Zawsze na widocznym obszarze roboczym" 70 | 71 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 72 | msgid "Workspace" 73 | msgstr "Przestrzeń robocza" 74 | 75 | #: src/menu/menu.c:1088 76 | msgid "Close" 77 | msgstr "Zamknij" 78 | -------------------------------------------------------------------------------- /po/pt.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2023 3 | # This file is distributed under the same license as the labwc package. 4 | # Daniel , 2023. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-09-21 20:01+0000\n" 12 | "Last-Translator: Hugo Carvalho \n" 13 | "Language-Team: Portuguese \n" 15 | "Language: pt\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=2; plural=n > 1;\n" 20 | "X-Generator: Weblate 4.2.1\n" 21 | 22 | #: src/menu/menu.c:1017 23 | msgid "Go there..." 24 | msgstr "Ir lá..." 25 | 26 | #: src/menu/menu.c:1037 27 | msgid "Reconfigure" 28 | msgstr "Reconfigurar" 29 | 30 | #: src/menu/menu.c:1039 31 | msgid "Exit" 32 | msgstr "Sair" 33 | 34 | #: src/menu/menu.c:1055 35 | msgid "Minimize" 36 | msgstr "Minimizar" 37 | 38 | #: src/menu/menu.c:1057 39 | msgid "Maximize" 40 | msgstr "Maximizar" 41 | 42 | #: src/menu/menu.c:1059 43 | msgid "Fullscreen" 44 | msgstr "Ecrã inteiro" 45 | 46 | #: src/menu/menu.c:1061 47 | msgid "Roll Up/Down" 48 | msgstr "Rolar para cima/baixo" 49 | 50 | #: src/menu/menu.c:1063 51 | msgid "Decorations" 52 | msgstr "Decorações" 53 | 54 | #: src/menu/menu.c:1065 55 | msgid "Always on Top" 56 | msgstr "Sempre no topo" 57 | 58 | #: src/menu/menu.c:1070 59 | msgid "Move Left" 60 | msgstr "Mover para a esquerda" 61 | 62 | #: src/menu/menu.c:1077 63 | msgid "Move Right" 64 | msgstr "Mover para a direita" 65 | 66 | #: src/menu/menu.c:1082 67 | msgid "Always on Visible Workspace" 68 | msgstr "Sempre visível na área de trabalho" 69 | 70 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 71 | msgid "Workspace" 72 | msgstr "Área de trabalho" 73 | 74 | #: src/menu/menu.c:1088 75 | msgid "Close" 76 | msgstr "Fechar" 77 | -------------------------------------------------------------------------------- /po/pt_BR.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2024 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-08-24 20:01+0000\n" 12 | "Last-Translator: daniel \n" 13 | "Language-Team: Portuguese (Brazil) \n" 14 | "Language: pt_BR\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=n > 1;\n" 19 | "X-Generator: Weblate 4.2.1\n" 20 | 21 | #: src/menu/menu.c:1017 22 | msgid "Go there..." 23 | msgstr "" 24 | 25 | #: src/menu/menu.c:1037 26 | msgid "Reconfigure" 27 | msgstr "Reconfigurar" 28 | 29 | #: src/menu/menu.c:1039 30 | msgid "Exit" 31 | msgstr "Sair" 32 | 33 | #: src/menu/menu.c:1055 34 | msgid "Minimize" 35 | msgstr "Minimizar" 36 | 37 | #: src/menu/menu.c:1057 38 | msgid "Maximize" 39 | msgstr "Maximizar" 40 | 41 | #: src/menu/menu.c:1059 42 | msgid "Fullscreen" 43 | msgstr "Tela Cheia" 44 | 45 | #: src/menu/menu.c:1061 46 | msgid "Roll Up/Down" 47 | msgstr "Rolar para Cima/Baixo" 48 | 49 | #: src/menu/menu.c:1063 50 | msgid "Decorations" 51 | msgstr "Decorações" 52 | 53 | #: src/menu/menu.c:1065 54 | msgid "Always on Top" 55 | msgstr "Sempre no Topo" 56 | 57 | #: src/menu/menu.c:1070 58 | msgid "Move Left" 59 | msgstr "Mover à Esquerda" 60 | 61 | #: src/menu/menu.c:1077 62 | msgid "Move Right" 63 | msgstr "Mover à Direita" 64 | 65 | #: src/menu/menu.c:1082 66 | msgid "Always on Visible Workspace" 67 | msgstr "Sempre Visível na Área de Trabalho" 68 | 69 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 70 | msgid "Workspace" 71 | msgstr "Área de Trabalho" 72 | 73 | #: src/menu/menu.c:1088 74 | msgid "Close" 75 | msgstr "Fechar" 76 | -------------------------------------------------------------------------------- /po/ru.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2023 3 | # This file is distributed under the same license as the labwc package. 4 | # Aleksey Samoilov , 2023. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-02-26 12:23+0000\n" 12 | "Last-Translator: Alice Ventus \n" 13 | "Language-Team: Russian \n" 14 | "Language: ru\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" 19 | "X-Generator: Weblate 4.2.1\n" 20 | 21 | #: src/menu/menu.c:1017 22 | msgid "Go there..." 23 | msgstr "" 24 | 25 | #: src/menu/menu.c:1037 26 | msgid "Reconfigure" 27 | msgstr "Перенастроить" 28 | 29 | #: src/menu/menu.c:1039 30 | msgid "Exit" 31 | msgstr "Выход" 32 | 33 | #: src/menu/menu.c:1055 34 | msgid "Minimize" 35 | msgstr "Свернуть" 36 | 37 | #: src/menu/menu.c:1057 38 | msgid "Maximize" 39 | msgstr "Развернуть" 40 | 41 | #: src/menu/menu.c:1059 42 | msgid "Fullscreen" 43 | msgstr "На весь экран" 44 | 45 | #: src/menu/menu.c:1061 46 | msgid "Roll Up/Down" 47 | msgstr "Свернуть/развернуть в заголовок" 48 | 49 | #: src/menu/menu.c:1063 50 | msgid "Decorations" 51 | msgstr "Декорации" 52 | 53 | #: src/menu/menu.c:1065 54 | msgid "Always on Top" 55 | msgstr "Всегда на переднем плане" 56 | 57 | #: src/menu/menu.c:1070 58 | msgid "Move Left" 59 | msgstr "Переместить влево" 60 | 61 | #: src/menu/menu.c:1077 62 | msgid "Move Right" 63 | msgstr "Переместить вправо" 64 | 65 | #: src/menu/menu.c:1082 66 | msgid "Always on Visible Workspace" 67 | msgstr "На всех рабочих пространствах" 68 | 69 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 70 | msgid "Workspace" 71 | msgstr "Рабочее пространство" 72 | 73 | #: src/menu/menu.c:1088 74 | msgid "Close" 75 | msgstr "Закрыть" 76 | -------------------------------------------------------------------------------- /po/sv.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2022 3 | # This file is distributed under the same license as the labwc package. 4 | # Johan Malm , 2022. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-10-12 07:24+0000\n" 12 | "Last-Translator: bittin \n" 13 | "Language-Team: Swedish \n" 15 | "Language: sv\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 20 | "X-Generator: Weblate 4.2.1\n" 21 | 22 | #: src/menu/menu.c:1017 23 | msgid "Go there..." 24 | msgstr "Gå dit..." 25 | 26 | #: src/menu/menu.c:1037 27 | msgid "Reconfigure" 28 | msgstr "Konfigurera om" 29 | 30 | #: src/menu/menu.c:1039 31 | msgid "Exit" 32 | msgstr "Avsluta" 33 | 34 | #: src/menu/menu.c:1055 35 | msgid "Minimize" 36 | msgstr "Minimera" 37 | 38 | #: src/menu/menu.c:1057 39 | msgid "Maximize" 40 | msgstr "Maximera" 41 | 42 | #: src/menu/menu.c:1059 43 | msgid "Fullscreen" 44 | msgstr "Fullskärm" 45 | 46 | #: src/menu/menu.c:1061 47 | msgid "Roll Up/Down" 48 | msgstr "Rulla upp/ned" 49 | 50 | #: src/menu/menu.c:1063 51 | msgid "Decorations" 52 | msgstr "Dekorationer" 53 | 54 | #: src/menu/menu.c:1065 55 | msgid "Always on Top" 56 | msgstr "Alltid överst" 57 | 58 | #: src/menu/menu.c:1070 59 | msgid "Move Left" 60 | msgstr "Flytta till vänster" 61 | 62 | #: src/menu/menu.c:1077 63 | msgid "Move Right" 64 | msgstr "Flytta till höger" 65 | 66 | #: src/menu/menu.c:1082 67 | msgid "Always on Visible Workspace" 68 | msgstr "Alltid på aktiv arbetsyta" 69 | 70 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 71 | msgid "Workspace" 72 | msgstr "Arbetsyta" 73 | 74 | #: src/menu/menu.c:1088 75 | msgid "Close" 76 | msgstr "Stäng" 77 | -------------------------------------------------------------------------------- /po/tr.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2022 3 | # This file is distributed under the same license as the labwc package. 4 | # Oğuz Ersen , 2022. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-10-03 08:01+0000\n" 12 | "Last-Translator: Dr. Ayhan YALÇINSOY \n" 13 | "Language-Team: Turkish \n" 15 | "Language: tr\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 20 | "X-Generator: Weblate 4.2.1\n" 21 | 22 | #: src/menu/menu.c:1017 23 | msgid "Go there..." 24 | msgstr "Şuraya git..." 25 | 26 | #: src/menu/menu.c:1037 27 | msgid "Reconfigure" 28 | msgstr "Yeniden Yapılandır" 29 | 30 | #: src/menu/menu.c:1039 31 | msgid "Exit" 32 | msgstr "Çıkış" 33 | 34 | #: src/menu/menu.c:1055 35 | msgid "Minimize" 36 | msgstr "Küçült" 37 | 38 | #: src/menu/menu.c:1057 39 | msgid "Maximize" 40 | msgstr "Büyüt" 41 | 42 | #: src/menu/menu.c:1059 43 | msgid "Fullscreen" 44 | msgstr "Tam Ekran" 45 | 46 | #: src/menu/menu.c:1061 47 | msgid "Roll Up/Down" 48 | msgstr "Yukarı/aşağı katla" 49 | 50 | #: src/menu/menu.c:1063 51 | msgid "Decorations" 52 | msgstr "Süslemeler" 53 | 54 | #: src/menu/menu.c:1065 55 | msgid "Always on Top" 56 | msgstr "Her Zaman Üstte" 57 | 58 | #: src/menu/menu.c:1070 59 | msgid "Move Left" 60 | msgstr "Sola taşı" 61 | 62 | #: src/menu/menu.c:1077 63 | msgid "Move Right" 64 | msgstr "Sağa taşı" 65 | 66 | #: src/menu/menu.c:1082 67 | msgid "Always on Visible Workspace" 68 | msgstr "Her Zaman Görünür Çalışma Alanında" 69 | 70 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 71 | msgid "Workspace" 72 | msgstr "Çalışma Alanı" 73 | 74 | #: src/menu/menu.c:1088 75 | msgid "Close" 76 | msgstr "Kapat" 77 | -------------------------------------------------------------------------------- /po/uk.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2023 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-09-24 08:01+0000\n" 12 | "Last-Translator: Ihor Hordiichuk \n" 13 | "Language-Team: Ukrainian \n" 15 | "Language: uk\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" 20 | "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" 21 | "X-Generator: Weblate 4.2.1\n" 22 | 23 | #: src/menu/menu.c:1017 24 | msgid "Go there..." 25 | msgstr "Перейти до..." 26 | 27 | #: src/menu/menu.c:1037 28 | msgid "Reconfigure" 29 | msgstr "Переналаштувати" 30 | 31 | #: src/menu/menu.c:1039 32 | msgid "Exit" 33 | msgstr "Вихід" 34 | 35 | #: src/menu/menu.c:1055 36 | msgid "Minimize" 37 | msgstr "Згорнути" 38 | 39 | #: src/menu/menu.c:1057 40 | msgid "Maximize" 41 | msgstr "Розгорнути" 42 | 43 | #: src/menu/menu.c:1059 44 | msgid "Fullscreen" 45 | msgstr "На весь екран" 46 | 47 | #: src/menu/menu.c:1061 48 | msgid "Roll Up/Down" 49 | msgstr "Згорнути/розгорнути" 50 | 51 | #: src/menu/menu.c:1063 52 | msgid "Decorations" 53 | msgstr "Декорації" 54 | 55 | #: src/menu/menu.c:1065 56 | msgid "Always on Top" 57 | msgstr "Завжди зверху" 58 | 59 | #: src/menu/menu.c:1070 60 | msgid "Move Left" 61 | msgstr "Перемістити ліворуч" 62 | 63 | #: src/menu/menu.c:1077 64 | msgid "Move Right" 65 | msgstr "Перемістити праворуч" 66 | 67 | #: src/menu/menu.c:1082 68 | msgid "Always on Visible Workspace" 69 | msgstr "Завжди на видимому робочому просторі" 70 | 71 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 72 | msgid "Workspace" 73 | msgstr "Робочий простір" 74 | 75 | #: src/menu/menu.c:1088 76 | msgid "Close" 77 | msgstr "Закрити" 78 | -------------------------------------------------------------------------------- /po/zh_CN.po: -------------------------------------------------------------------------------- 1 | # Labwc pot file 2 | # Copyright (C) 2023 3 | # This file is distributed under the same license as the labwc package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: labwc\n" 9 | "Report-Msgid-Bugs-To: https://github.com/labwc/labwc/issues\n" 10 | "POT-Creation-Date: 2024-09-19 21:09+1000\n" 11 | "PO-Revision-Date: 2024-01-30 08:23+0000\n" 12 | "Last-Translator: kmephistoh \n" 13 | "Language-Team: Chinese (Simplified) \n" 14 | "Language: zh_CN\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=1; plural=0;\n" 19 | "X-Generator: Weblate 4.2.1\n" 20 | 21 | #: src/menu/menu.c:1017 22 | msgid "Go there..." 23 | msgstr "" 24 | 25 | #: src/menu/menu.c:1037 26 | msgid "Reconfigure" 27 | msgstr "配置重载" 28 | 29 | #: src/menu/menu.c:1039 30 | msgid "Exit" 31 | msgstr "退出" 32 | 33 | #: src/menu/menu.c:1055 34 | msgid "Minimize" 35 | msgstr "最小化" 36 | 37 | #: src/menu/menu.c:1057 38 | msgid "Maximize" 39 | msgstr "最大化" 40 | 41 | #: src/menu/menu.c:1059 42 | msgid "Fullscreen" 43 | msgstr "全屏" 44 | 45 | #: src/menu/menu.c:1061 46 | msgid "Roll Up/Down" 47 | msgstr "滚动 上/下" 48 | 49 | #: src/menu/menu.c:1063 50 | msgid "Decorations" 51 | msgstr "装饰" 52 | 53 | #: src/menu/menu.c:1065 54 | msgid "Always on Top" 55 | msgstr "最上层显示" 56 | 57 | #: src/menu/menu.c:1070 58 | msgid "Move Left" 59 | msgstr "左移" 60 | 61 | #: src/menu/menu.c:1077 62 | msgid "Move Right" 63 | msgstr "右移" 64 | 65 | #: src/menu/menu.c:1082 66 | msgid "Always on Visible Workspace" 67 | msgstr "始终在可见工作区" 68 | 69 | #: src/menu/menu.c:1085 src/config/rcxml.c:1629 70 | msgid "Workspace" 71 | msgstr "工作区" 72 | 73 | #: src/menu/menu.c:1088 74 | msgid "Close" 75 | msgstr "关闭" 76 | -------------------------------------------------------------------------------- /protocols/meson.build: -------------------------------------------------------------------------------- 1 | wl_protocol_dir = wayland_protos.get_variable('pkgdatadir') 2 | wayland_scanner = find_program('wayland-scanner') 3 | 4 | wayland_scanner_code = generator( 5 | wayland_scanner, 6 | output: '@BASENAME@-protocol.c', 7 | arguments: ['private-code', '@INPUT@', '@OUTPUT@'], 8 | ) 9 | 10 | wayland_scanner_server = generator( 11 | wayland_scanner, 12 | output: '@BASENAME@-protocol.h', 13 | arguments: ['server-header', '@INPUT@', '@OUTPUT@'], 14 | ) 15 | 16 | server_protocols = [ 17 | wl_protocol_dir / 'stable/xdg-shell/xdg-shell.xml', 18 | wl_protocol_dir / 'unstable/pointer-constraints/pointer-constraints-unstable-v1.xml', 19 | wl_protocol_dir / 'stable/tablet/tablet-v2.xml', 20 | wl_protocol_dir / 'staging/cursor-shape/cursor-shape-v1.xml', 21 | wl_protocol_dir / 'staging/drm-lease/drm-lease-v1.xml', 22 | wl_protocol_dir / 'staging/xwayland-shell/xwayland-shell-v1.xml', 23 | wl_protocol_dir / 'staging/tearing-control/tearing-control-v1.xml', 24 | 'cosmic-workspace-unstable-v1.xml', 25 | 'wlr-layer-shell-unstable-v1.xml', 26 | 'wlr-input-inhibitor-unstable-v1.xml', 27 | 'wlr-output-power-management-unstable-v1.xml', 28 | ] 29 | 30 | server_protos_src = [] 31 | server_protos_headers = [] 32 | 33 | foreach xml : server_protocols 34 | server_protos_src += wayland_scanner_code.process(xml) 35 | server_protos_headers += wayland_scanner_server.process(xml) 36 | endforeach 37 | 38 | lib_server_protos = static_library( 39 | 'server_protos', 40 | server_protos_src + server_protos_headers, 41 | dependencies: [wayland_server] 42 | ) 43 | 44 | server_protos = declare_dependency( 45 | link_with: lib_server_protos, 46 | sources: server_protos_headers, 47 | ) 48 | -------------------------------------------------------------------------------- /scripts/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | find-banned 3 | -------------------------------------------------------------------------------- /scripts/README.md: -------------------------------------------------------------------------------- 1 | These scripts are intended to be run from the project top-level directory 2 | like this: `scripts/foo.sh` 3 | 4 | - `scripts/check`: wrapper to check all files in `src/` and `include/` 5 | 6 | - `scripts/checkpatch.pl`: Quick hack on the Linux kernel [checkpatch.pl] 7 | to lint C files written according to the labwc coding style. Run like 8 | this: `./checkpatch.pl --no-tree --terse --strict --file ` 9 | 10 | [checkpatch.pl]: https://raw.githubusercontent.com/torvalds/linux/4ce9f970457899defdf68e26e0502c7245002eb3/scripts/checkpatch.pl 11 | -------------------------------------------------------------------------------- /scripts/check: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | file= 4 | 5 | usage_message="Usage: check [OPTIONS] 6 | OPTIONS: 7 | --file= Specify file to check. If none specified, all 8 | files in src/ and include/ will be checked. 9 | " 10 | 11 | run_checkpatch() { 12 | nice scripts/checkpatch.pl --terse --no-tree --strict --file "$1" 13 | return $? 14 | } 15 | 16 | run_checks () { 17 | if [ ! -z "$file" ]; then 18 | run_checkpatch "${file}" 19 | return $? 20 | fi 21 | 22 | find src/ include/ \( -name "*.c" -o -name "*.h" \) -type f -print0 | 23 | nice xargs -0 --max-args 1 --max-procs $(nproc) \ 24 | scripts/checkpatch.pl --terse --no-tree --strict --file 25 | return $? 26 | } 27 | 28 | main () { 29 | for arg 30 | do 31 | opt=${arg%%=*} 32 | var=${arg#*=} 33 | case "$opt" in 34 | --file) 35 | file="$var" ;; 36 | -h|--help) 37 | printf '%b' "$usage_message"; exit 1 ;; 38 | *) 39 | printf '%b\n' "warn: unknown option $opt" >&2 ;; 40 | esac 41 | done 42 | 43 | run_checks 44 | } 45 | 46 | main "$@" 47 | -------------------------------------------------------------------------------- /scripts/ci/autostart: -------------------------------------------------------------------------------- 1 | scripts/ci/ci_autostart.sh 2 | -------------------------------------------------------------------------------- /scripts/ci/ci_autostart.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if test -z "$LABWC_PID"; then 4 | echo "LABWC_PID not set" >&2 5 | exit 1 6 | fi 7 | 8 | echo "Running with pid $LABWC_PID" 9 | 10 | # Could add runtime tests here 11 | 12 | echo "killing labwc" 13 | kill -s TERM $LABWC_PID 14 | -------------------------------------------------------------------------------- /scripts/ci/smoke-test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | : ${LABWC_RUNS:=1} 4 | 5 | if ! test -x "$1/labwc"; then 6 | echo "$1/labwc not found" 7 | exit 1 8 | fi 9 | 10 | args=( 11 | "$1/labwc" 12 | -C scripts/ci 13 | -d 14 | ) 15 | 16 | export XDG_RUNTIME_DIR=$(mktemp -d) 17 | export WLR_BACKENDS=headless 18 | 19 | gdb_run() { 20 | # Not using -Db_sanitize=address,undefined 21 | # because it slows down the usual execution 22 | # way too much and spams pages over pages 23 | # of irrelevant memory-still-in-use logs 24 | # for external libraries. 25 | # 26 | # Not using coredumps either because they 27 | # are a pain to setup on GH actions and 28 | # just running labwc again is a lot faster 29 | # anyway. 30 | 31 | gdb --batch \ 32 | --return-child-result \ 33 | -ex run \ 34 | -ex 'bt full' \ 35 | -ex 'echo \n' \ 36 | -ex 'echo "Local vars:\n' \ 37 | -ex 'info locals' \ 38 | -ex 'echo \n' \ 39 | -ex 'set listsize 50' \ 40 | -ex list \ 41 | --args "${args[@]}" 42 | return $? 43 | } 44 | 45 | echo "Running with LABWC_RUNS=$LABWC_RUNS" 46 | 47 | ret=0 48 | for((i=1; i<=LABWC_RUNS; i++)); do 49 | printf "Starting run %2s\n" $i 50 | output=$(gdb_run 2>&1) 51 | ret=$? 52 | if test $ret -ne 0; then 53 | echo "Crash encountered:" 54 | echo "------------------" 55 | echo "$output" 56 | break 57 | fi 58 | done 59 | 60 | echo "labwc terminated with return code $ret" 61 | exit $ret 62 | -------------------------------------------------------------------------------- /scripts/find-banned.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | banned="malloc,g_strcmp0,sprintf,vsprintf,strcpy,strncpy,strcat,strncat,atof" 4 | 5 | echo "Searching for banned functions" 6 | find src/ include/ \( -name "*.c" -o -name "*.h" \) -type f \ 7 | | ./scripts/helper/find-idents --tokens=$banned - 8 | -------------------------------------------------------------------------------- /scripts/helper/.gitignore: -------------------------------------------------------------------------------- 1 | find-idents 2 | *.o 3 | -------------------------------------------------------------------------------- /scripts/helper/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS += -g -Wall -O0 -std=c11 2 | LDFLAGS += -fsanitize=address 3 | 4 | PROGS = find-idents 5 | 6 | all: $(PROGS) 7 | 8 | find-idents: find-idents.o 9 | $(CC) -o $@ $^ 10 | 11 | clean : 12 | $(RM) $(PROGS) *.o 13 | -------------------------------------------------------------------------------- /src/common/box.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #include 3 | #include "common/box.h" 4 | #include "common/macros.h" 5 | 6 | bool 7 | box_contains(struct wlr_box *box_super, struct wlr_box *box_sub) 8 | { 9 | if (wlr_box_empty(box_super) || wlr_box_empty(box_sub)) { 10 | return false; 11 | } 12 | return box_super->x <= box_sub->x 13 | && box_super->x + box_super->width >= box_sub->x + box_sub->width 14 | && box_super->y <= box_sub->y 15 | && box_super->y + box_super->height >= box_sub->y + box_sub->height; 16 | } 17 | 18 | bool 19 | box_intersects(struct wlr_box *box_a, struct wlr_box *box_b) 20 | { 21 | if (wlr_box_empty(box_a) || wlr_box_empty(box_b)) { 22 | return false; 23 | } 24 | return box_a->x < box_b->x + box_b->width 25 | && box_b->x < box_a->x + box_a->width 26 | && box_a->y < box_b->y + box_b->height 27 | && box_b->y < box_a->y + box_a->height; 28 | } 29 | 30 | void 31 | box_union(struct wlr_box *box_dest, struct wlr_box *box_a, struct wlr_box *box_b) 32 | { 33 | if (wlr_box_empty(box_a)) { 34 | *box_dest = *box_b; 35 | return; 36 | } 37 | if (wlr_box_empty(box_b)) { 38 | *box_dest = *box_a; 39 | return; 40 | } 41 | int x1 = MIN(box_a->x, box_b->x); 42 | int y1 = MIN(box_a->y, box_b->y); 43 | int x2 = MAX(box_a->x + box_a->width, box_b->x + box_b->width); 44 | int y2 = MAX(box_a->y + box_a->height, box_b->y + box_b->height); 45 | box_dest->x = x1; 46 | box_dest->y = y1; 47 | box_dest->width = x2 - x1; 48 | box_dest->height = y2 - y1; 49 | } 50 | 51 | struct wlr_box 52 | box_fit_within(int width, int height, int max_width, int max_height) 53 | { 54 | struct wlr_box box; 55 | 56 | if (width <= max_width && height <= max_height) { 57 | /* No downscaling needed */ 58 | box.width = width; 59 | box.height = height; 60 | } else if (width * max_height > height * max_width) { 61 | /* Wider content, fit width */ 62 | box.width = max_width; 63 | box.height = (height * max_width + (width / 2)) / width; 64 | } else { 65 | /* Taller content, fit height */ 66 | box.width = (width * max_height + (height / 2)) / height; 67 | box.height = max_height; 68 | } 69 | 70 | /* Compute centered position */ 71 | box.x = (max_width - box.width) / 2; 72 | box.y = (max_height - box.height) / 2; 73 | 74 | return box; 75 | } 76 | -------------------------------------------------------------------------------- /src/common/direction.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #include 3 | #include 4 | #include "common/direction.h" 5 | #include "view.h" 6 | 7 | enum wlr_direction 8 | direction_from_view_edge(enum view_edge edge) 9 | { 10 | switch (edge) { 11 | case VIEW_EDGE_LEFT: 12 | return WLR_DIRECTION_LEFT; 13 | case VIEW_EDGE_RIGHT: 14 | return WLR_DIRECTION_RIGHT; 15 | case VIEW_EDGE_UP: 16 | return WLR_DIRECTION_UP; 17 | case VIEW_EDGE_DOWN: 18 | return WLR_DIRECTION_DOWN; 19 | case VIEW_EDGE_CENTER: 20 | case VIEW_EDGE_INVALID: 21 | default: 22 | return WLR_DIRECTION_UP; 23 | } 24 | } 25 | 26 | enum wlr_direction 27 | direction_get_opposite(enum wlr_direction direction) 28 | { 29 | switch (direction) { 30 | case WLR_DIRECTION_RIGHT: 31 | return WLR_DIRECTION_LEFT; 32 | case WLR_DIRECTION_LEFT: 33 | return WLR_DIRECTION_RIGHT; 34 | case WLR_DIRECTION_DOWN: 35 | return WLR_DIRECTION_UP; 36 | case WLR_DIRECTION_UP: 37 | return WLR_DIRECTION_DOWN; 38 | default: 39 | assert(0); /* Unreachable */ 40 | return WLR_DIRECTION_UP; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/common/fd-util.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #define _POSIX_C_SOURCE 200809L 3 | 4 | #include 5 | #include 6 | 7 | #include "common/fd-util.h" 8 | 9 | static struct rlimit original_nofile_rlimit = {0}; 10 | 11 | void 12 | increase_nofile_limit(void) 13 | { 14 | if (getrlimit(RLIMIT_NOFILE, &original_nofile_rlimit) != 0) { 15 | wlr_log_errno(WLR_ERROR, 16 | "Failed to bump max open files limit: getrlimit(NOFILE) failed"); 17 | return; 18 | } 19 | 20 | struct rlimit new_rlimit = original_nofile_rlimit; 21 | new_rlimit.rlim_cur = new_rlimit.rlim_max; 22 | if (setrlimit(RLIMIT_NOFILE, &new_rlimit) != 0) { 23 | wlr_log_errno(WLR_ERROR, 24 | "Failed to bump max open files limit: setrlimit(NOFILE) failed"); 25 | 26 | wlr_log(WLR_INFO, "Running with %d max open files", 27 | (int)original_nofile_rlimit.rlim_cur); 28 | } 29 | } 30 | 31 | void 32 | restore_nofile_limit(void) 33 | { 34 | if (original_nofile_rlimit.rlim_cur == 0) { 35 | return; 36 | } 37 | 38 | if (setrlimit(RLIMIT_NOFILE, &original_nofile_rlimit) != 0) { 39 | wlr_log_errno(WLR_ERROR, 40 | "Failed to restore max open files limit: setrlimit(NOFILE) failed"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/common/file-helpers.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #include 3 | #include "common/file-helpers.h" 4 | 5 | bool 6 | file_exists(const char *filename) 7 | { 8 | struct stat st; 9 | return (!stat(filename, &st)); 10 | } 11 | -------------------------------------------------------------------------------- /src/common/grab-file.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | /* 3 | * Read file into memory 4 | * 5 | * Copyright Johan Malm 2020 6 | */ 7 | 8 | #define _POSIX_C_SOURCE 200809L 9 | #include "common/grab-file.h" 10 | #include "common/buf.h" 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | struct buf 17 | grab_file(const char *filename) 18 | { 19 | char *line = NULL; 20 | size_t len = 0; 21 | FILE *stream = fopen(filename, "r"); 22 | if (!stream) { 23 | return BUF_INIT; 24 | } 25 | struct buf buffer = BUF_INIT; 26 | while ((getline(&line, &len, stream) != -1)) { 27 | char *p = strrchr(line, '\n'); 28 | if (p) { 29 | *p = '\0'; 30 | } 31 | buf_add(&buffer, line); 32 | } 33 | free(line); 34 | fclose(stream); 35 | return buffer; 36 | } 37 | -------------------------------------------------------------------------------- /src/common/match.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | 3 | #include 4 | #include "common/match.h" 5 | 6 | bool 7 | match_glob(const char *pattern, const char *string) 8 | { 9 | return fnmatch(pattern, string, FNM_CASEFOLD) == 0; 10 | } 11 | -------------------------------------------------------------------------------- /src/common/mem.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #define _POSIX_C_SOURCE 200809L 3 | #include 4 | #include 5 | #include 6 | #include "common/mem.h" 7 | 8 | static void 9 | die_if_null(void *ptr) 10 | { 11 | if (!ptr) { 12 | perror("Failed to allocate memory"); 13 | exit(EXIT_FAILURE); 14 | } 15 | } 16 | 17 | void * 18 | xzalloc(size_t size) 19 | { 20 | if (!size) { 21 | return NULL; 22 | } 23 | void *ptr = calloc(1, size); 24 | die_if_null(ptr); 25 | return ptr; 26 | } 27 | 28 | void * 29 | xrealloc(void *ptr, size_t size) 30 | { 31 | if (!size) { 32 | free(ptr); 33 | return NULL; 34 | } 35 | ptr = realloc(ptr, size); 36 | die_if_null(ptr); 37 | return ptr; 38 | } 39 | 40 | char * 41 | xstrdup(const char *str) 42 | { 43 | assert(str); 44 | char *copy = strdup(str); 45 | die_if_null(copy); 46 | return copy; 47 | } 48 | -------------------------------------------------------------------------------- /src/common/meson.build: -------------------------------------------------------------------------------- 1 | labwc_sources += files( 2 | 'direction.c', 3 | 'box.c', 4 | 'buf.c', 5 | 'dir.c', 6 | 'fd-util.c', 7 | 'file-helpers.c', 8 | 'font.c', 9 | 'grab-file.c', 10 | 'graphic-helpers.c', 11 | 'match.c', 12 | 'mem.c', 13 | 'nodename.c', 14 | 'parse-bool.c', 15 | 'parse-double.c', 16 | 'scaled-font-buffer.c', 17 | 'scaled-scene-buffer.c', 18 | 'scene-helpers.c', 19 | 'set.c', 20 | 'surface-helpers.c', 21 | 'spawn.c', 22 | 'string-helpers.c', 23 | ) 24 | -------------------------------------------------------------------------------- /src/common/nodename.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #include 3 | #include 4 | #include "common/nodename.h" 5 | 6 | char * 7 | nodename(xmlNode *node, char *buf, int len) 8 | { 9 | if (!node || !node->name) { 10 | return NULL; 11 | } 12 | 13 | /* Ignore superfluous 'text.' in node name */ 14 | if (node->parent && !strcmp((char *)node->name, "text")) { 15 | node = node->parent; 16 | } 17 | 18 | char *p = buf; 19 | p[--len] = 0; 20 | for (;;) { 21 | const char *name = (char *)node->name; 22 | char c; 23 | while ((c = *name++) != 0) { 24 | *p++ = tolower(c); 25 | if (!--len) { 26 | return buf; 27 | } 28 | } 29 | *p = 0; 30 | node = node->parent; 31 | if (!node || !node->name) { 32 | return buf; 33 | } 34 | *p++ = '.'; 35 | if (!--len) { 36 | return buf; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/common/parse-bool.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #include 3 | #include 4 | #include "common/parse-bool.h" 5 | 6 | enum three_state 7 | parse_three_state(const char *str) 8 | { 9 | if (!str) { 10 | goto error_not_a_boolean; 11 | } else if (!strcasecmp(str, "yes")) { 12 | return LAB_STATE_ENABLED; 13 | } else if (!strcasecmp(str, "true")) { 14 | return LAB_STATE_ENABLED; 15 | } else if (!strcasecmp(str, "on")) { 16 | return LAB_STATE_ENABLED; 17 | } else if (!strcmp(str, "1")) { 18 | return LAB_STATE_ENABLED; 19 | } else if (!strcasecmp(str, "no")) { 20 | return LAB_STATE_DISABLED; 21 | } else if (!strcasecmp(str, "false")) { 22 | return LAB_STATE_DISABLED; 23 | } else if (!strcasecmp(str, "off")) { 24 | return LAB_STATE_DISABLED; 25 | } else if (!strcmp(str, "0")) { 26 | return LAB_STATE_DISABLED; 27 | } 28 | error_not_a_boolean: 29 | wlr_log(WLR_ERROR, "(%s) is not a boolean value", str); 30 | return LAB_STATE_UNSPECIFIED; 31 | } 32 | 33 | int 34 | parse_bool(const char *str, int default_value) 35 | { 36 | enum three_state val = parse_three_state(str); 37 | if (val == LAB_STATE_UNSPECIFIED) { 38 | return default_value; 39 | } 40 | return (val == LAB_STATE_ENABLED) ? 1 : 0; 41 | } 42 | 43 | void 44 | set_bool(const char *str, bool *variable) 45 | { 46 | int ret = parse_bool(str, -1); 47 | if (ret < 0) { 48 | return; 49 | } 50 | *variable = ret; 51 | } 52 | 53 | void 54 | set_bool_as_int(const char *str, int *variable) 55 | { 56 | int ret = parse_bool(str, -1); 57 | if (ret < 0) { 58 | return; 59 | } 60 | *variable = ret; 61 | } 62 | -------------------------------------------------------------------------------- /src/common/parse-double.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "common/mem.h" 7 | #include "common/parse-double.h" 8 | 9 | struct dec_separator { 10 | int index; 11 | bool multiple; 12 | }; 13 | 14 | struct converted_double { 15 | double value; 16 | bool valid; 17 | }; 18 | 19 | static struct dec_separator 20 | find_dec_separator(const char *str) 21 | { 22 | struct dec_separator loc = { 23 | .index = -1, 24 | .multiple = false 25 | }; 26 | 27 | for (int i = 0; *str; i++, str++) { 28 | switch (*str) { 29 | case ',': 30 | case '.': 31 | if (loc.index >= 0) { 32 | loc.multiple = true; 33 | return loc; 34 | } else { 35 | loc.index = i; 36 | } 37 | break; 38 | } 39 | } 40 | 41 | return loc; 42 | } 43 | 44 | static struct converted_double 45 | convert_double(const char *str) 46 | { 47 | struct converted_double result = { 48 | .value = 0, 49 | .valid = true, 50 | }; 51 | 52 | char *eptr = NULL; 53 | 54 | errno = 0; 55 | result.value = strtod(str, &eptr); 56 | 57 | if (errno) { 58 | wlr_log(WLR_ERROR, "value '%s' is out of range", str); 59 | result.valid = false; 60 | } 61 | 62 | if (*eptr) { 63 | wlr_log(WLR_ERROR, "value '%s' contains trailing garbage", str); 64 | result.valid = false; 65 | } 66 | 67 | return result; 68 | } 69 | 70 | bool 71 | set_double(const char *str, double *val) 72 | { 73 | assert(str); 74 | assert(val); 75 | 76 | struct dec_separator dloc = find_dec_separator(str); 77 | if (dloc.multiple) { 78 | wlr_log(WLR_ERROR, 79 | "value '%s' contains multiple decimal markers", str); 80 | return false; 81 | } 82 | 83 | char *lstr = NULL; 84 | 85 | if (dloc.index >= 0) { 86 | lstr = xstrdup(str); 87 | struct lconv *lc = localeconv(); 88 | lstr[dloc.index] = *lc->decimal_point; 89 | str = lstr; 90 | } 91 | 92 | struct converted_double conv = convert_double(str); 93 | if (conv.valid) { 94 | *val = conv.value; 95 | } 96 | 97 | free(lstr); 98 | return conv.valid; 99 | } 100 | -------------------------------------------------------------------------------- /src/common/scaled-font-buffer.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #define _POSIX_C_SOURCE 200809L 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "buffer.h" 9 | #include "common/font.h" 10 | #include "common/mem.h" 11 | #include "common/scaled-scene-buffer.h" 12 | #include "common/scaled-font-buffer.h" 13 | 14 | static struct lab_data_buffer * 15 | _create_buffer(struct scaled_scene_buffer *scaled_buffer, double scale) 16 | { 17 | struct lab_data_buffer *buffer = NULL; 18 | struct scaled_font_buffer *self = scaled_buffer->data; 19 | 20 | /* Buffer gets free'd automatically along the backing wlr_buffer */ 21 | font_buffer_create(&buffer, self->max_width, self->text, 22 | &self->font, self->color, self->bg_color, self->arrow, scale); 23 | 24 | if (!buffer) { 25 | wlr_log(WLR_ERROR, "font_buffer_create() failed"); 26 | } 27 | 28 | self->width = buffer ? buffer->logical_width : 0; 29 | self->height = buffer ? buffer->logical_height : 0; 30 | return buffer; 31 | } 32 | 33 | static void 34 | _destroy(struct scaled_scene_buffer *scaled_buffer) 35 | { 36 | struct scaled_font_buffer *self = scaled_buffer->data; 37 | scaled_buffer->data = NULL; 38 | 39 | zfree(self->text); 40 | zfree(self->font.name); 41 | zfree(self->arrow); 42 | free(self); 43 | } 44 | 45 | static const struct scaled_scene_buffer_impl impl = { 46 | .create_buffer = _create_buffer, 47 | .destroy = _destroy 48 | }; 49 | 50 | /* Public API */ 51 | struct scaled_font_buffer * 52 | scaled_font_buffer_create(struct wlr_scene_tree *parent) 53 | { 54 | assert(parent); 55 | struct scaled_font_buffer *self = znew(*self); 56 | struct scaled_scene_buffer *scaled_buffer = 57 | scaled_scene_buffer_create(parent, &impl, /* drop_buffer */ true); 58 | if (!scaled_buffer) { 59 | free(self); 60 | return NULL; 61 | } 62 | 63 | scaled_buffer->data = self; 64 | self->scaled_buffer = scaled_buffer; 65 | self->scene_buffer = scaled_buffer->scene_buffer; 66 | return self; 67 | } 68 | 69 | void 70 | scaled_font_buffer_update(struct scaled_font_buffer *self, const char *text, 71 | int max_width, struct font *font, const float *color, 72 | const float *bg_color, const char *arrow) 73 | { 74 | assert(self); 75 | assert(text); 76 | assert(font); 77 | assert(color); 78 | 79 | /* Clean up old internal state */ 80 | zfree(self->text); 81 | zfree(self->font.name); 82 | zfree(self->arrow); 83 | 84 | /* Update internal state */ 85 | self->text = xstrdup(text); 86 | self->max_width = max_width; 87 | if (font->name) { 88 | self->font.name = xstrdup(font->name); 89 | } 90 | self->font.size = font->size; 91 | self->font.slant = font->slant; 92 | self->font.weight = font->weight; 93 | memcpy(self->color, color, sizeof(self->color)); 94 | memcpy(self->bg_color, bg_color, sizeof(self->bg_color)); 95 | self->arrow = arrow ? xstrdup(arrow) : NULL; 96 | 97 | /* Invalidate cache and force a new render */ 98 | scaled_scene_buffer_invalidate_cache(self->scaled_buffer); 99 | } 100 | 101 | void 102 | scaled_font_buffer_set_max_width(struct scaled_font_buffer *self, int max_width) 103 | { 104 | self->max_width = max_width; 105 | scaled_scene_buffer_invalidate_cache(self->scaled_buffer); 106 | } 107 | -------------------------------------------------------------------------------- /src/common/set.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #include 3 | #include "common/set.h" 4 | 5 | bool 6 | lab_set_contains(struct lab_set *set, uint32_t value) 7 | { 8 | for (int i = 0; i < set->size; ++i) { 9 | if (set->values[i] == value) { 10 | return true; 11 | } 12 | } 13 | return false; 14 | } 15 | 16 | void 17 | lab_set_add(struct lab_set *set, uint32_t value) 18 | { 19 | if (lab_set_contains(set, value)) { 20 | return; 21 | } 22 | if (set->size >= LAB_SET_MAX_SIZE) { 23 | wlr_log(WLR_ERROR, "lab_set size exceeded"); 24 | return; 25 | } 26 | set->values[set->size++] = value; 27 | } 28 | 29 | void 30 | lab_set_remove(struct lab_set *set, uint32_t value) 31 | { 32 | bool shifting = false; 33 | 34 | for (int i = 0; i < LAB_SET_MAX_SIZE; ++i) { 35 | if (set->values[i] == value) { 36 | --set->size; 37 | shifting = true; 38 | } 39 | if (shifting) { 40 | set->values[i] = i < LAB_SET_MAX_SIZE - 1 41 | ? set->values[i + 1] : 0; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/common/surface-helpers.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #include 3 | #include 4 | #include 5 | #include "common/surface-helpers.h" 6 | 7 | struct wlr_layer_surface_v1 * 8 | subsurface_parent_layer(struct wlr_surface *wlr_surface) 9 | { 10 | struct wlr_subsurface *subsurface = 11 | wlr_subsurface_try_from_wlr_surface(wlr_surface); 12 | if (!subsurface) { 13 | wlr_log(WLR_DEBUG, "surface %p is not subsurface", subsurface); 14 | return NULL; 15 | } 16 | struct wlr_surface *parent = subsurface->parent; 17 | if (!parent) { 18 | wlr_log(WLR_DEBUG, "subsurface %p has no parent", subsurface); 19 | return NULL; 20 | } 21 | struct wlr_layer_surface_v1 *wlr_layer_surface = 22 | wlr_layer_surface_v1_try_from_wlr_surface(parent); 23 | if (wlr_layer_surface) { 24 | return wlr_layer_surface; 25 | } 26 | /* Recurse in case there are nested sub-surfaces */ 27 | return subsurface_parent_layer(parent); 28 | } 29 | -------------------------------------------------------------------------------- /src/config/libinput.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #include 3 | #include 4 | 5 | #include "common/mem.h" 6 | #include "common/list.h" 7 | #include "common/string-helpers.h" 8 | #include "config/libinput.h" 9 | #include "config/rcxml.h" 10 | 11 | static void 12 | libinput_category_init(struct libinput_category *l) 13 | { 14 | l->type = LAB_LIBINPUT_DEVICE_DEFAULT; 15 | l->name = NULL; 16 | l->pointer_speed = -2; 17 | l->natural_scroll = -1; 18 | l->left_handed = -1; 19 | l->tap = LIBINPUT_CONFIG_TAP_ENABLED; 20 | l->tap_button_map = LIBINPUT_CONFIG_TAP_MAP_LRM; 21 | l->tap_and_drag = -1; 22 | l->drag_lock = -1; 23 | l->accel_profile = -1; 24 | l->middle_emu = -1; 25 | l->dwt = -1; 26 | l->click_method = -1; 27 | l->send_events_mode = -1; 28 | l->have_calibration_matrix = false; 29 | l->scroll_factor = 1.0; 30 | } 31 | 32 | enum lab_libinput_device_type 33 | get_device_type(const char *s) 34 | { 35 | if (string_null_or_empty(s)) { 36 | return LAB_LIBINPUT_DEVICE_NONE; 37 | } 38 | if (!strcasecmp(s, "default")) { 39 | return LAB_LIBINPUT_DEVICE_DEFAULT; 40 | } 41 | if (!strcasecmp(s, "touch")) { 42 | return LAB_LIBINPUT_DEVICE_TOUCH; 43 | } 44 | if (!strcasecmp(s, "touchpad")) { 45 | return LAB_LIBINPUT_DEVICE_TOUCHPAD; 46 | } 47 | if (!strcasecmp(s, "non-touch")) { 48 | return LAB_LIBINPUT_DEVICE_NON_TOUCH; 49 | } 50 | return LAB_LIBINPUT_DEVICE_NONE; 51 | } 52 | 53 | struct libinput_category * 54 | libinput_category_create(void) 55 | { 56 | struct libinput_category *l = znew(*l); 57 | libinput_category_init(l); 58 | wl_list_append(&rc.libinput_categories, &l->link); 59 | return l; 60 | } 61 | 62 | /* After rcxml_read(), a default category always exists. */ 63 | struct libinput_category * 64 | libinput_category_get_default(void) 65 | { 66 | struct libinput_category *l; 67 | /* 68 | * Iterate in reverse to get the last one added in case multiple 69 | * 'default' profiles were created. 70 | */ 71 | wl_list_for_each_reverse(l, &rc.libinput_categories, link) { 72 | if (l->type == LAB_LIBINPUT_DEVICE_DEFAULT) { 73 | return l; 74 | } 75 | } 76 | return NULL; 77 | } 78 | -------------------------------------------------------------------------------- /src/config/meson.build: -------------------------------------------------------------------------------- 1 | labwc_sources += files( 2 | 'rcxml.c', 3 | 'keybind.c', 4 | 'session.c', 5 | 'mousebind.c', 6 | 'touch.c', 7 | 'tablet.c', 8 | 'tablet-tool.c', 9 | 'libinput.c', 10 | ) 11 | -------------------------------------------------------------------------------- /src/config/tablet-tool.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #define _POSIX_C_SOURCE 200809L 3 | #include 4 | #include 5 | #include "config/tablet-tool.h" 6 | 7 | enum motion 8 | tablet_parse_motion(const char *name) 9 | { 10 | if (!strcasecmp(name, "Absolute")) { 11 | return LAB_TABLET_MOTION_ABSOLUTE; 12 | } else if (!strcasecmp(name, "Relative")) { 13 | return LAB_TABLET_MOTION_RELATIVE; 14 | } 15 | wlr_log(WLR_ERROR, "Invalid value for tablet motion: %s", name); 16 | return LAB_TABLET_MOTION_ABSOLUTE; 17 | } 18 | -------------------------------------------------------------------------------- /src/config/touch.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #define _POSIX_C_SOURCE 200809L 3 | #include 4 | #include 5 | #include "common/list.h" 6 | #include "config/rcxml.h" 7 | 8 | static struct touch_config_entry * 9 | find_default_config(void) 10 | { 11 | struct touch_config_entry *entry; 12 | wl_list_for_each(entry, &rc.touch_configs, link) { 13 | if (!entry->device_name) { 14 | wlr_log(WLR_INFO, "found default touch configuration"); 15 | return entry; 16 | } 17 | } 18 | return NULL; 19 | } 20 | 21 | struct touch_config_entry * 22 | touch_find_config_for_device(char *device_name) 23 | { 24 | wlr_log(WLR_INFO, "find touch configuration for %s\n", device_name); 25 | struct touch_config_entry *entry; 26 | wl_list_for_each(entry, &rc.touch_configs, link) { 27 | if (entry->device_name && !strcasecmp(entry->device_name, device_name)) { 28 | wlr_log(WLR_INFO, "found touch configuration for %s\n", device_name); 29 | return entry; 30 | } 31 | } 32 | return find_default_config(); 33 | } 34 | -------------------------------------------------------------------------------- /src/decorations/meson.build: -------------------------------------------------------------------------------- 1 | labwc_sources += files( 2 | 'kde-deco.c', 3 | 'xdg-deco.c', 4 | ) 5 | -------------------------------------------------------------------------------- /src/idle.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "common/mem.h" 8 | #include "idle.h" 9 | 10 | struct lab_idle_inhibitor { 11 | struct wlr_idle_inhibitor_v1 *wlr_inhibitor; 12 | struct wl_listener on_destroy; 13 | }; 14 | 15 | struct lab_idle_manager { 16 | struct wlr_idle_notifier_v1 *ext; 17 | struct { 18 | struct wlr_idle_inhibit_manager_v1 *manager; 19 | struct wl_listener on_new_inhibitor; 20 | } inhibitor; 21 | struct wlr_seat *wlr_seat; 22 | struct wl_listener on_display_destroy; 23 | }; 24 | 25 | static struct lab_idle_manager *manager; 26 | 27 | static void 28 | handle_idle_inhibitor_destroy(struct wl_listener *listener, void *data) 29 | { 30 | struct lab_idle_inhibitor *idle_inhibitor = wl_container_of(listener, 31 | idle_inhibitor, on_destroy); 32 | 33 | if (manager) { 34 | /* 35 | * The display destroy event might have been triggered 36 | * already and thus the manager would be NULL. 37 | */ 38 | bool still_inhibited = 39 | wl_list_length(&manager->inhibitor.manager->inhibitors) > 1; 40 | wlr_idle_notifier_v1_set_inhibited(manager->ext, still_inhibited); 41 | } 42 | 43 | wl_list_remove(&idle_inhibitor->on_destroy.link); 44 | free(idle_inhibitor); 45 | } 46 | 47 | static void 48 | handle_idle_inhibitor_new(struct wl_listener *listener, void *data) 49 | { 50 | assert(manager); 51 | struct wlr_idle_inhibitor_v1 *wlr_inhibitor = data; 52 | 53 | struct lab_idle_inhibitor *inhibitor = znew(*inhibitor); 54 | inhibitor->wlr_inhibitor = wlr_inhibitor; 55 | inhibitor->on_destroy.notify = handle_idle_inhibitor_destroy; 56 | wl_signal_add(&wlr_inhibitor->events.destroy, &inhibitor->on_destroy); 57 | 58 | wlr_idle_notifier_v1_set_inhibited(manager->ext, true); 59 | } 60 | 61 | static void 62 | handle_display_destroy(struct wl_listener *listener, void *data) 63 | { 64 | /* 65 | * All the managers will react to the display 66 | * destroy signal as well and thus clean up. 67 | */ 68 | wl_list_remove(&manager->on_display_destroy.link); 69 | zfree(manager); 70 | } 71 | 72 | void 73 | idle_manager_create(struct wl_display *display, struct wlr_seat *wlr_seat) 74 | { 75 | assert(!manager); 76 | manager = znew(*manager); 77 | manager->wlr_seat = wlr_seat; 78 | 79 | manager->ext = wlr_idle_notifier_v1_create(display); 80 | 81 | manager->inhibitor.manager = wlr_idle_inhibit_v1_create(display); 82 | manager->inhibitor.on_new_inhibitor.notify = handle_idle_inhibitor_new; 83 | wl_signal_add(&manager->inhibitor.manager->events.new_inhibitor, 84 | &manager->inhibitor.on_new_inhibitor); 85 | 86 | manager->on_display_destroy.notify = handle_display_destroy; 87 | wl_display_add_destroy_listener(display, &manager->on_display_destroy); 88 | } 89 | 90 | void 91 | idle_manager_notify_activity(struct wlr_seat *seat) 92 | { 93 | /* 94 | * The display destroy event might have been triggered 95 | * already and thus the manager would be NULL. Due to 96 | * future code changes we might also get called before 97 | * the manager has been created. 98 | */ 99 | if (!manager) { 100 | return; 101 | } 102 | 103 | wlr_idle_notifier_v1_notify_activity(manager->ext, seat); 104 | } 105 | -------------------------------------------------------------------------------- /src/img/gen-color-table.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Generates xpm-color-table.h from X11's rgb.txt 4 | # Adapted from gdk-pixbuf (LGPL-2.0-or-later) 5 | 6 | if (@ARGV != 1) { 7 | die "Usage: gen-color-table.pl rgb.txt > xpm-color-table.h\n"; 8 | } 9 | 10 | open IN, '<', $ARGV[0] or die "Cannot open $ARGV[0]: $!\n"; 11 | 12 | @colors = (); 13 | while () { 14 | next if /^!/; 15 | if (!/^\s*([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+(.*\S)\s*$/) { 16 | die "Cannot parse line $_"; 17 | } 18 | 19 | push @colors, [$1, $2, $3, $4]; 20 | } 21 | 22 | close IN or die "close IN failed: $!\n"; 23 | 24 | @colors = sort { lc($a->[3]) cmp lc($b->[3]) } @colors; 25 | 26 | $offset = 0; 27 | 28 | $date = gmtime; 29 | 30 | print <[3]; 43 | 44 | if ($offset != 0) { 45 | print qq(\n); 46 | } 47 | print qq( "$name\\0"); 48 | 49 | $color->[4] = $offset; 50 | $offset += length($name) + 1; 51 | } 52 | 53 | print ";\n\n"; 54 | 55 | print <[0]; 69 | $green = $color->[1]; 70 | $blue = $color->[2]; 71 | $offset = $color->[4]; 72 | 73 | if ($i != 0) { 74 | print ",\n"; 75 | } 76 | print " { $offset, $red, $green, $blue }"; 77 | $i++; 78 | } 79 | 80 | print "\n};\n"; 81 | -------------------------------------------------------------------------------- /src/img/img-png.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | /* 3 | * Copyright (C) Johan Malm 2023 4 | */ 5 | #define _POSIX_C_SOURCE 200809L 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "buffer.h" 13 | #include "img/img-png.h" 14 | #include "common/string-helpers.h" 15 | #include "labwc.h" 16 | 17 | /* 18 | * cairo_image_surface_create_from_png() does not gracefully handle non-png 19 | * files, so we verify the header before trying to read the rest of the file. 20 | */ 21 | #define PNG_BYTES_TO_CHECK (4) 22 | static bool 23 | ispng(const char *filename) 24 | { 25 | unsigned char header[PNG_BYTES_TO_CHECK]; 26 | FILE *fp = fopen(filename, "rb"); 27 | if (!fp) { 28 | return false; 29 | } 30 | if (fread(header, 1, PNG_BYTES_TO_CHECK, fp) != PNG_BYTES_TO_CHECK) { 31 | fclose(fp); 32 | return false; 33 | } 34 | if (png_sig_cmp(header, (png_size_t)0, PNG_BYTES_TO_CHECK)) { 35 | wlr_log(WLR_ERROR, "file '%s' is not a recognised png file", filename); 36 | fclose(fp); 37 | return false; 38 | } 39 | fclose(fp); 40 | return true; 41 | } 42 | 43 | #undef PNG_BYTES_TO_CHECK 44 | 45 | void 46 | img_png_load(const char *filename, struct lab_data_buffer **buffer, int size, 47 | float scale) 48 | { 49 | if (*buffer) { 50 | wlr_buffer_drop(&(*buffer)->base); 51 | *buffer = NULL; 52 | } 53 | if (string_null_or_empty(filename)) { 54 | return; 55 | } 56 | if (!ispng(filename)) { 57 | return; 58 | } 59 | 60 | cairo_surface_t *image = cairo_image_surface_create_from_png(filename); 61 | if (cairo_surface_status(image)) { 62 | wlr_log(WLR_ERROR, "error reading png button '%s'", filename); 63 | cairo_surface_destroy(image); 64 | return; 65 | } 66 | 67 | *buffer = buffer_convert_cairo_surface_for_icon(image, size, scale); 68 | } 69 | -------------------------------------------------------------------------------- /src/img/img-svg.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | /* 3 | * Copyright (C) Johan Malm 2023 4 | */ 5 | #define _POSIX_C_SOURCE 200809L 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "buffer.h" 13 | #include "img/img-svg.h" 14 | #include "common/string-helpers.h" 15 | #include "labwc.h" 16 | 17 | void 18 | img_svg_load(const char *filename, struct lab_data_buffer **buffer, int size, 19 | float scale) 20 | { 21 | if (*buffer) { 22 | wlr_buffer_drop(&(*buffer)->base); 23 | *buffer = NULL; 24 | } 25 | if (string_null_or_empty(filename)) { 26 | return; 27 | } 28 | 29 | GError *err = NULL; 30 | RsvgRectangle viewport = { .width = size, .height = size }; 31 | RsvgHandle *svg = rsvg_handle_new_from_file(filename, &err); 32 | if (err) { 33 | wlr_log(WLR_DEBUG, "error reading svg %s-%s", filename, err->message); 34 | g_error_free(err); 35 | /* 36 | * rsvg_handle_new_from_file() returns NULL if an error occurs, 37 | * so there is no need to free svg here. 38 | */ 39 | return; 40 | } 41 | 42 | *buffer = buffer_create_cairo(size, size, scale); 43 | cairo_surface_t *image = (*buffer)->surface; 44 | cairo_t *cr = (*buffer)->cairo; 45 | 46 | rsvg_handle_render_document(svg, cr, &viewport, &err); 47 | if (err) { 48 | wlr_log(WLR_ERROR, "error rendering svg %s-%s\n", filename, err->message); 49 | g_error_free(err); 50 | goto error; 51 | } 52 | 53 | if (cairo_surface_status(image)) { 54 | wlr_log(WLR_ERROR, "error reading svg button '%s'", filename); 55 | goto error; 56 | } 57 | cairo_surface_flush(image); 58 | 59 | g_object_unref(svg); 60 | return; 61 | 62 | error: 63 | wlr_buffer_drop(&(*buffer)->base); 64 | *buffer = NULL; 65 | g_object_unref(svg); 66 | } 67 | -------------------------------------------------------------------------------- /src/img/meson.build: -------------------------------------------------------------------------------- 1 | labwc_sources += files( 2 | 'img-png.c', 3 | 'img-xbm.c', 4 | 'img-xpm.c' 5 | ) 6 | 7 | if have_rsvg 8 | labwc_sources += files( 9 | 'img-svg.c', 10 | ) 11 | endif 12 | 13 | -------------------------------------------------------------------------------- /src/input/input.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #include "input/cursor.h" 3 | #include "input/input.h" 4 | #include "input/keyboard.h" 5 | 6 | void 7 | input_handlers_init(struct seat *seat) 8 | { 9 | cursor_init(seat); 10 | keyboard_group_init(seat); 11 | } 12 | 13 | void 14 | input_handlers_finish(struct seat *seat) 15 | { 16 | cursor_finish(seat); 17 | keyboard_group_finish(seat); 18 | } 19 | -------------------------------------------------------------------------------- /src/input/key-state.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "common/set.h" 9 | #include "input/key-state.h" 10 | 11 | static struct lab_set pressed, pressed_mods, bound, pressed_sent; 12 | 13 | static void 14 | report(struct lab_set *key_set, const char *msg) 15 | { 16 | static char *should_print; 17 | static bool has_run; 18 | 19 | if (!has_run) { 20 | should_print = getenv("LABWC_DEBUG_KEY_STATE"); 21 | has_run = true; 22 | } 23 | if (!should_print) { 24 | return; 25 | } 26 | printf("%s", msg); 27 | for (int i = 0; i < key_set->size; ++i) { 28 | printf("%d,", key_set->values[i]); 29 | } 30 | printf("\n"); 31 | } 32 | 33 | uint32_t * 34 | key_state_pressed_sent_keycodes(void) 35 | { 36 | report(&pressed, "before - pressed:"); 37 | report(&bound, "before - bound:"); 38 | 39 | /* pressed_sent = pressed - bound */ 40 | pressed_sent = pressed; 41 | for (int i = 0; i < bound.size; ++i) { 42 | lab_set_remove(&pressed_sent, bound.values[i]); 43 | } 44 | 45 | report(&pressed_sent, "after - pressed_sent:"); 46 | 47 | return pressed_sent.values; 48 | } 49 | 50 | int 51 | key_state_nr_pressed_sent_keycodes(void) 52 | { 53 | return pressed_sent.size; 54 | } 55 | 56 | void 57 | key_state_set_pressed(uint32_t keycode, bool is_pressed, bool is_modifier) 58 | { 59 | if (is_pressed) { 60 | lab_set_add(&pressed, keycode); 61 | if (is_modifier) { 62 | lab_set_add(&pressed_mods, keycode); 63 | } 64 | } else { 65 | lab_set_remove(&pressed, keycode); 66 | lab_set_remove(&pressed_mods, keycode); 67 | } 68 | } 69 | 70 | void 71 | key_state_store_pressed_key_as_bound(uint32_t keycode) 72 | { 73 | lab_set_add(&bound, keycode); 74 | /* 75 | * Also store any pressed modifiers as bound. This prevents 76 | * applications from seeing and handling the release event for 77 | * a modifier key that was part of a keybinding (e.g. Firefox 78 | * displays its menu bar for a lone Alt press + release). 79 | */ 80 | for (int i = 0; i < pressed_mods.size; ++i) { 81 | lab_set_add(&bound, pressed_mods.values[i]); 82 | } 83 | } 84 | 85 | bool 86 | key_state_corresponding_press_event_was_bound(uint32_t keycode) 87 | { 88 | return lab_set_contains(&bound, keycode); 89 | } 90 | 91 | void 92 | key_state_bound_key_remove(uint32_t keycode) 93 | { 94 | lab_set_remove(&bound, keycode); 95 | } 96 | 97 | int 98 | key_state_nr_bound_keys(void) 99 | { 100 | return bound.size; 101 | } 102 | 103 | int 104 | key_state_nr_pressed_keys(void) 105 | { 106 | return pressed.size; 107 | } 108 | -------------------------------------------------------------------------------- /src/input/meson.build: -------------------------------------------------------------------------------- 1 | labwc_sources += files( 2 | 'cursor.c', 3 | 'tablet.c', 4 | 'tablet-pad.c', 5 | 'tablet-tool.c', 6 | 'gestures.c', 7 | 'input.c', 8 | 'keyboard.c', 9 | 'key-state.c', 10 | 'touch.c', 11 | 'ime.c', 12 | ) 13 | -------------------------------------------------------------------------------- /src/input/tablet-tool.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "common/macros.h" 8 | #include "common/mem.h" 9 | #include "config/rcxml.h" 10 | #include "input/cursor.h" 11 | #include "input/tablet-tool.h" 12 | #include "labwc.h" 13 | 14 | bool 15 | tablet_tool_has_focused_surface(struct seat *seat) 16 | { 17 | struct drawing_tablet_tool *tool; 18 | wl_list_for_each(tool, &seat->tablet_tools, link) { 19 | if (tool->tool_v2->focused_surface) { 20 | return true; 21 | } 22 | } 23 | 24 | return false; 25 | } 26 | 27 | static void 28 | handle_set_cursor(struct wl_listener *listener, void *data) 29 | { 30 | struct drawing_tablet_tool *tool = 31 | wl_container_of(listener, tool, handlers.set_cursor); 32 | struct wlr_tablet_v2_event_cursor *ev = data; 33 | 34 | struct seat *seat = tool->seat; 35 | struct wlr_seat_client *focused_client = 36 | seat->seat->pointer_state.focused_client; 37 | 38 | if (seat->server->input_mode != LAB_INPUT_STATE_PASSTHROUGH) { 39 | return; 40 | } 41 | 42 | if (ev->seat_client != focused_client) { 43 | return; 44 | } 45 | 46 | wlr_cursor_set_surface(seat->cursor, ev->surface, 47 | ev->hotspot_x, ev->hotspot_y); 48 | } 49 | 50 | static void 51 | handle_destroy(struct wl_listener *listener, void *data) 52 | { 53 | struct drawing_tablet_tool *tool = 54 | wl_container_of(listener, tool, handlers.destroy); 55 | 56 | wl_list_remove(&tool->link); 57 | wl_list_remove(&tool->handlers.set_cursor.link); 58 | wl_list_remove(&tool->handlers.destroy.link); 59 | free(tool); 60 | } 61 | 62 | void 63 | tablet_tool_create(struct seat *seat, 64 | struct wlr_tablet_tool *wlr_tablet_tool) 65 | { 66 | wlr_log(WLR_DEBUG, "setting up tablet tool"); 67 | struct drawing_tablet_tool *tool = znew(*tool); 68 | tool->seat = seat; 69 | tool->tool_v2 = 70 | wlr_tablet_tool_create(seat->server->tablet_manager, 71 | seat->seat, wlr_tablet_tool); 72 | wlr_tablet_tool->data = tool; 73 | wlr_log(WLR_INFO, "tablet tool capabilities:%s%s%s%s%s%s", 74 | wlr_tablet_tool->tilt ? " tilt" : "", 75 | wlr_tablet_tool->pressure ? " pressure" : "", 76 | wlr_tablet_tool->distance ? " distance" : "", 77 | wlr_tablet_tool->rotation ? " rotation" : "", 78 | wlr_tablet_tool->slider ? " slider" : "", 79 | wlr_tablet_tool->wheel ? " wheel" : ""); 80 | CONNECT_SIGNAL(tool->tool_v2, &tool->handlers, set_cursor); 81 | CONNECT_SIGNAL(wlr_tablet_tool, &tool->handlers, destroy); 82 | wl_list_insert(&seat->tablet_tools, &tool->link); 83 | } 84 | -------------------------------------------------------------------------------- /src/menu/meson.build: -------------------------------------------------------------------------------- 1 | labwc_sources += files( 2 | 'menu.c', 3 | ) 4 | -------------------------------------------------------------------------------- /src/meson.build: -------------------------------------------------------------------------------- 1 | labwc_sources = files( 2 | 'action.c', 3 | 'buffer.c', 4 | 'debug.c', 5 | 'desktop.c', 6 | 'dnd.c', 7 | 'edges.c', 8 | 'foreign.c', 9 | 'idle.c', 10 | 'interactive.c', 11 | 'layers.c', 12 | 'magnifier.c', 13 | 'main.c', 14 | 'node.c', 15 | 'osd.c', 16 | 'osd-field.c', 17 | 'output.c', 18 | 'output-state.c', 19 | 'output-virtual.c', 20 | 'overlay.c', 21 | 'placement.c', 22 | 'regions.c', 23 | 'resistance.c', 24 | 'resize-outlines.c', 25 | 'seat.c', 26 | 'server.c', 27 | 'session-lock.c', 28 | 'snap-constraints.c', 29 | 'snap.c', 30 | 'tearing.c', 31 | 'theme.c', 32 | 'view.c', 33 | 'view-impl-common.c', 34 | 'window-rules.c', 35 | 'workspaces.c', 36 | 'xdg.c', 37 | 'xdg-popup.c', 38 | ) 39 | 40 | if have_xwayland 41 | labwc_sources += files( 42 | 'xwayland.c', 43 | 'xwayland-unmanaged.c', 44 | ) 45 | endif 46 | 47 | if have_libsfdo 48 | labwc_sources += files( 49 | 'icon-loader.c', 50 | ) 51 | endif 52 | 53 | subdir('img') 54 | subdir('common') 55 | subdir('config') 56 | subdir('decorations') 57 | subdir('input') 58 | subdir('menu') 59 | subdir('ssd') 60 | subdir('protocols') 61 | -------------------------------------------------------------------------------- /src/node.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #include 3 | #include 4 | #include "common/mem.h" 5 | #include "node.h" 6 | 7 | static void 8 | descriptor_destroy(struct node_descriptor *node_descriptor) 9 | { 10 | if (!node_descriptor) { 11 | return; 12 | } 13 | wl_list_remove(&node_descriptor->destroy.link); 14 | free(node_descriptor); 15 | } 16 | 17 | static void 18 | destroy_notify(struct wl_listener *listener, void *data) 19 | { 20 | struct node_descriptor *node_descriptor = 21 | wl_container_of(listener, node_descriptor, destroy); 22 | descriptor_destroy(node_descriptor); 23 | } 24 | 25 | void 26 | node_descriptor_create(struct wlr_scene_node *scene_node, 27 | enum node_descriptor_type type, void *data) 28 | { 29 | struct node_descriptor *node_descriptor = znew(*node_descriptor); 30 | node_descriptor->type = type; 31 | node_descriptor->data = data; 32 | node_descriptor->destroy.notify = destroy_notify; 33 | wl_signal_add(&scene_node->events.destroy, &node_descriptor->destroy); 34 | scene_node->data = node_descriptor; 35 | } 36 | 37 | struct view * 38 | node_view_from_node(struct wlr_scene_node *wlr_scene_node) 39 | { 40 | assert(wlr_scene_node->data); 41 | struct node_descriptor *node_descriptor = wlr_scene_node->data; 42 | assert(node_descriptor->type == LAB_NODE_DESC_VIEW 43 | || node_descriptor->type == LAB_NODE_DESC_XDG_POPUP); 44 | return (struct view *)node_descriptor->data; 45 | } 46 | 47 | struct lab_layer_surface * 48 | node_layer_surface_from_node(struct wlr_scene_node *wlr_scene_node) 49 | { 50 | assert(wlr_scene_node->data); 51 | struct node_descriptor *node_descriptor = wlr_scene_node->data; 52 | assert(node_descriptor->type == LAB_NODE_DESC_LAYER_SURFACE); 53 | return (struct lab_layer_surface *)node_descriptor->data; 54 | } 55 | 56 | struct lab_layer_popup * 57 | node_layer_popup_from_node(struct wlr_scene_node *wlr_scene_node) 58 | { 59 | assert(wlr_scene_node->data); 60 | struct node_descriptor *node_descriptor = wlr_scene_node->data; 61 | assert(node_descriptor->type == LAB_NODE_DESC_LAYER_POPUP); 62 | return (struct lab_layer_popup *)node_descriptor->data; 63 | } 64 | 65 | struct menuitem * 66 | node_menuitem_from_node(struct wlr_scene_node *wlr_scene_node) 67 | { 68 | assert(wlr_scene_node->data); 69 | struct node_descriptor *node_descriptor = wlr_scene_node->data; 70 | assert(node_descriptor->type == LAB_NODE_DESC_MENUITEM); 71 | return (struct menuitem *)node_descriptor->data; 72 | } 73 | 74 | struct ssd_button * 75 | node_ssd_button_from_node(struct wlr_scene_node *wlr_scene_node) 76 | { 77 | assert(wlr_scene_node->data); 78 | struct node_descriptor *node_descriptor = wlr_scene_node->data; 79 | assert(node_descriptor->type == LAB_NODE_DESC_SSD_BUTTON); 80 | return (struct ssd_button *)node_descriptor->data; 81 | } 82 | -------------------------------------------------------------------------------- /src/output-state.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | 3 | #include 4 | #include 5 | #include "labwc.h" 6 | #include "output-state.h" 7 | 8 | void 9 | output_state_init(struct output *output) 10 | { 11 | wlr_output_state_init(&output->pending); 12 | 13 | /* 14 | * As there is no direct way to convert an existing output 15 | * configuration to an output_state we first convert it 16 | * to a temporary output-management config and then apply 17 | * it to an empty wlr_output_state. 18 | */ 19 | struct wlr_output_configuration_v1 *backup_config = 20 | wlr_output_configuration_v1_create(); 21 | struct wlr_output_configuration_head_v1 *backup_head = 22 | wlr_output_configuration_head_v1_create( 23 | backup_config, output->wlr_output); 24 | 25 | wlr_output_head_v1_state_apply(&backup_head->state, &output->pending); 26 | wlr_output_configuration_v1_destroy(backup_config); 27 | } 28 | 29 | bool 30 | output_state_commit(struct output *output) 31 | { 32 | bool committed = 33 | wlr_output_commit_state(output->wlr_output, &output->pending); 34 | if (committed) { 35 | wlr_output_state_finish(&output->pending); 36 | wlr_output_state_init(&output->pending); 37 | } else { 38 | wlr_log(WLR_ERROR, "Failed to commit frame"); 39 | } 40 | return committed; 41 | } 42 | -------------------------------------------------------------------------------- /src/protocols/cosmic_workspaces/meson.build: -------------------------------------------------------------------------------- 1 | labwc_sources += files( 2 | 'cosmic-workspaces.c', 3 | 'transactions.c', 4 | 'output.c', 5 | ) 6 | -------------------------------------------------------------------------------- /src/protocols/cosmic_workspaces/transactions.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #include 3 | #include 4 | #include 5 | #include "common/list.h" 6 | #include "common/mem.h" 7 | #include "protocols/cosmic-workspaces-internal.h" 8 | 9 | static void 10 | transactions_destroy(struct wl_list *list) 11 | { 12 | struct transaction_group *group; 13 | struct transaction *trans, *trans_tmp; 14 | wl_list_for_each_safe(trans, trans_tmp, list, link) { 15 | if (trans->change == CW_PENDING_WS_CREATE) { 16 | group = wl_container_of(trans, group, base); 17 | free(group->new_workspace_name); 18 | } 19 | wl_list_remove(&trans->link); 20 | free(trans); 21 | } 22 | } 23 | 24 | void 25 | resource_addon_destroy(struct wl_resource_addon *addon) 26 | { 27 | assert(addon); 28 | assert(addon->ctx); 29 | 30 | addon->ctx->ref_count--; 31 | assert(addon->ctx->ref_count >= 0); 32 | 33 | wlr_log(WLR_DEBUG, "New refcount for session %p: %d", 34 | addon->ctx, addon->ctx->ref_count); 35 | if (!addon->ctx->ref_count) { 36 | wlr_log(WLR_DEBUG, "Destroying session context"); 37 | transactions_destroy(&addon->ctx->transactions); 38 | free(addon->ctx); 39 | } 40 | 41 | free(addon); 42 | } 43 | 44 | struct wl_resource_addon * 45 | resource_addon_create(struct session_context *ctx) 46 | { 47 | struct wl_resource_addon *addon = znew(*addon); 48 | if (!ctx) { 49 | ctx = znew(*ctx); 50 | wl_list_init(&ctx->transactions); 51 | } 52 | addon->ctx = ctx; 53 | addon->ctx->ref_count++; 54 | return addon; 55 | } 56 | 57 | void 58 | transaction_add_workspace_ev(struct lab_cosmic_workspace *ws, 59 | struct wl_resource *resource, enum pending_change change) 60 | { 61 | struct wl_resource_addon *addon = wl_resource_get_user_data(resource); 62 | if (!addon) { 63 | wlr_log(WLR_ERROR, "Failed to find manager addon for workspace transaction"); 64 | return; 65 | } 66 | 67 | assert(change != CW_PENDING_WS_CREATE); 68 | 69 | struct transaction_workspace *trans_ws = znew(*trans_ws); 70 | trans_ws->workspace = ws; 71 | trans_ws->base.change = change; 72 | wl_list_append(&addon->ctx->transactions, &trans_ws->base.link); 73 | } 74 | 75 | void 76 | transaction_add_workspace_group_ev(struct lab_cosmic_workspace_group *group, 77 | struct wl_resource *resource, enum pending_change change, 78 | const char *new_workspace_name) 79 | { 80 | struct wl_resource_addon *addon = wl_resource_get_user_data(resource); 81 | if (!addon) { 82 | wlr_log(WLR_ERROR, "Failed to find manager addon for group transaction"); 83 | return; 84 | } 85 | 86 | assert(change == CW_PENDING_WS_CREATE); 87 | 88 | struct transaction_group *trans_grp = znew(*trans_grp); 89 | trans_grp->group = group; 90 | trans_grp->base.change = change; 91 | trans_grp->new_workspace_name = xstrdup(new_workspace_name); 92 | wl_list_append(&addon->ctx->transactions, &trans_grp->base.link); 93 | } 94 | -------------------------------------------------------------------------------- /src/protocols/meson.build: -------------------------------------------------------------------------------- 1 | subdir('cosmic_workspaces') 2 | -------------------------------------------------------------------------------- /src/resize-outlines.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | 3 | #include 4 | #include "common/graphic-helpers.h" 5 | #include "ssd.h" 6 | #include "resize-outlines.h" 7 | #include "labwc.h" 8 | 9 | bool 10 | resize_outlines_enabled(struct view *view) 11 | { 12 | return view->resize_outlines.rect 13 | && view->resize_outlines.rect->tree->node.enabled; 14 | } 15 | 16 | void 17 | resize_outlines_update(struct view *view, struct wlr_box new_geo) 18 | { 19 | struct resize_outlines *outlines = &view->resize_outlines; 20 | 21 | if (!outlines->rect) { 22 | float *colors[3] = { 23 | view->server->theme->osd_bg_color, 24 | view->server->theme->osd_label_text_color, 25 | view->server->theme->osd_bg_color, 26 | }; 27 | int width = 1; 28 | outlines->rect = multi_rect_create( 29 | view->scene_tree, colors, width); 30 | } 31 | 32 | struct border margin = ssd_get_margin(view->ssd); 33 | struct wlr_box box = { 34 | .x = new_geo.x - margin.left, 35 | .y = new_geo.y - margin.top, 36 | .width = new_geo.width + margin.left + margin.right, 37 | .height = new_geo.height + margin.top + margin.bottom, 38 | }; 39 | multi_rect_set_size(outlines->rect, box.width, box.height); 40 | wlr_scene_node_set_position(&outlines->rect->tree->node, 41 | box.x - view->current.x, box.y - view->current.y); 42 | wlr_scene_node_set_enabled( 43 | &view->resize_outlines.rect->tree->node, true); 44 | 45 | outlines->view_geo = new_geo; 46 | 47 | resize_indicator_update(view); 48 | } 49 | 50 | void 51 | resize_outlines_finish(struct view *view) 52 | { 53 | view_move_resize(view, view->resize_outlines.view_geo); 54 | wlr_scene_node_set_enabled( 55 | &view->resize_outlines.rect->tree->node, false); 56 | } 57 | -------------------------------------------------------------------------------- /src/ssd/meson.build: -------------------------------------------------------------------------------- 1 | labwc_sources += files( 2 | 'resize-indicator.c', 3 | 'ssd.c', 4 | 'ssd-part.c', 5 | 'ssd-titlebar.c', 6 | 'ssd-border.c', 7 | 'ssd-extents.c', 8 | 'ssd-shadow.c', 9 | ) 10 | -------------------------------------------------------------------------------- /src/tearing.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | 3 | #include "common/mem.h" 4 | #include "labwc.h" 5 | #include "view.h" 6 | 7 | struct tearing_controller { 8 | struct wlr_tearing_control_v1 *tearing_control; 9 | struct wl_listener set_hint; 10 | struct wl_listener destroy; 11 | }; 12 | 13 | static void 14 | set_tearing_hint(struct wl_listener *listener, void *data) 15 | { 16 | struct tearing_controller *controller = wl_container_of(listener, controller, set_hint); 17 | struct view *view = view_from_wlr_surface(controller->tearing_control->surface); 18 | if (view) { 19 | /* 20 | * tearing_control->current is actually an enum: 21 | * WP_TEARING_CONTROL_V1_PRESENTATION_HINT_VSYNC = 0 22 | * WP_TEARING_CONTROL_V1_PRESENTATION_HINT_ASYNC = 1 23 | * 24 | * Using it as a bool here allows us to not ship the XML. 25 | */ 26 | view->tearing_hint = controller->tearing_control->current; 27 | } 28 | } 29 | 30 | static void 31 | tearing_controller_destroy(struct wl_listener *listener, void *data) 32 | { 33 | struct tearing_controller *controller = wl_container_of(listener, controller, destroy); 34 | wl_list_remove(&controller->set_hint.link); 35 | wl_list_remove(&controller->destroy.link); 36 | free(controller); 37 | } 38 | 39 | void 40 | new_tearing_hint(struct wl_listener *listener, void *data) 41 | { 42 | struct server *server = wl_container_of(listener, server, tearing_new_object); 43 | struct wlr_tearing_control_v1 *tearing_control = data; 44 | 45 | enum wp_tearing_control_v1_presentation_hint hint = 46 | wlr_tearing_control_manager_v1_surface_hint_from_surface 47 | (server->tearing_control, tearing_control->surface); 48 | wlr_log(WLR_DEBUG, "New presentation hint %d received for surface %p", 49 | hint, tearing_control->surface); 50 | 51 | struct tearing_controller *controller = znew(*controller); 52 | controller->tearing_control = tearing_control; 53 | 54 | controller->set_hint.notify = set_tearing_hint; 55 | wl_signal_add(&tearing_control->events.set_hint, &controller->set_hint); 56 | 57 | controller->destroy.notify = tearing_controller_destroy; 58 | wl_signal_add(&tearing_control->events.destroy, &controller->destroy); 59 | } 60 | -------------------------------------------------------------------------------- /subprojects/.gitignore: -------------------------------------------------------------------------------- 1 | /* 2 | !/*.wrap 3 | -------------------------------------------------------------------------------- /subprojects/libsfdo.wrap: -------------------------------------------------------------------------------- 1 | [wrap-git] 2 | url = https://gitlab.freedesktop.org/vyivel/libsfdo.git 3 | revision = v0.1.3 4 | 5 | [provide] 6 | dependency_names = libsfdo-basedir, libsfdo-desktop, libsfdo-icon 7 | -------------------------------------------------------------------------------- /subprojects/wlroots.wrap: -------------------------------------------------------------------------------- 1 | [wrap-git] 2 | url = https://gitlab.freedesktop.org/wlroots/wlroots.git 3 | revision = 0.18 4 | 5 | [provide] 6 | dependency_names = wlroots-0.18 7 | wlroots-0.18=wlroots 8 | -------------------------------------------------------------------------------- /t/.gitignore: -------------------------------------------------------------------------------- 1 | *.t 2 | -------------------------------------------------------------------------------- /t/buf-simple.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #define _POSIX_C_SOURCE 200809L 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "common/buf.h" 10 | #include "common/mem.h" 11 | 12 | static void 13 | test_expand_title(void **state) 14 | { 15 | (void)state; 16 | 17 | struct buf s = BUF_INIT; 18 | 19 | char TEMPLATE[] = "foo ~/bar"; 20 | char expect[4096]; 21 | snprintf(expect, sizeof(expect), "foo %s/bar", getenv("HOME")); 22 | 23 | buf_add(&s, TEMPLATE); 24 | assert_string_equal(s.data, TEMPLATE); 25 | assert_int_equal(s.len, strlen(TEMPLATE)); 26 | 27 | // Resolve ~ 28 | buf_expand_tilde(&s); 29 | assert_string_equal(s.data, expect); 30 | assert_int_equal(s.len, strlen(expect)); 31 | 32 | setenv("bar", "BAR", 1); 33 | 34 | // Resolve $bar and ${bar} 35 | s.len = 0; 36 | buf_add(&s, "foo $bar baz"); 37 | buf_expand_shell_variables(&s); 38 | assert_string_equal(s.data, "foo BAR baz"); 39 | assert_int_equal(s.len, 11); 40 | 41 | s.len = 0; 42 | buf_add(&s, "foo ${bar} baz"); 43 | buf_expand_shell_variables(&s); 44 | assert_string_equal(s.data, "foo BAR baz"); 45 | assert_int_equal(s.len, 11); 46 | 47 | // Don't resolve $() 48 | s.len = 0; 49 | buf_add(&s, "foo $(bar) baz"); 50 | buf_expand_shell_variables(&s); 51 | assert_string_equal(s.data, "foo $(bar) baz"); 52 | assert_int_equal(s.len, 14); 53 | 54 | unsetenv("bar"); 55 | free(s.data); 56 | } 57 | 58 | static void 59 | test_buf_add_fmt(void **state) 60 | { 61 | (void)state; 62 | 63 | struct buf s = BUF_INIT; 64 | 65 | buf_add(&s, "foo"); 66 | buf_add_fmt(&s, " %s baz %d", "bar", 10); 67 | assert_string_equal(s.data, "foo bar baz 10"); 68 | 69 | buf_reset(&s); 70 | } 71 | 72 | int main(int argc, char **argv) 73 | { 74 | const struct CMUnitTest tests[] = { 75 | cmocka_unit_test(test_expand_title), 76 | cmocka_unit_test(test_buf_add_fmt), 77 | }; 78 | 79 | return cmocka_run_group_tests(tests, NULL, NULL); 80 | } 81 | -------------------------------------------------------------------------------- /t/meson.build: -------------------------------------------------------------------------------- 1 | test_lib = static_library( 2 | 'test_lib', 3 | sources: files( 4 | '../src/common/buf.c', 5 | '../src/common/mem.c', 6 | '../src/common/string-helpers.c' 7 | ), 8 | include_directories: [labwc_inc], 9 | dependencies: [dep_cmocka], 10 | ) 11 | 12 | tests = [ 13 | 'buf-simple', 14 | ] 15 | 16 | foreach t : tests 17 | test( 18 | 'test_@0@'.format(t), 19 | executable( 20 | 'test_@0@'.format(t), 21 | sources: '@0@.c'.format(t), 22 | include_directories: [labwc_inc], 23 | link_with: [test_lib], 24 | ), 25 | is_parallel: false, 26 | ) 27 | endforeach 28 | --------------------------------------------------------------------------------