├── .editorconfig
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── feature_request.md
│ └── others.md
└── workflows
│ ├── ci.yaml
│ └── mandoc.yaml
├── .gitignore
├── .gitmodules
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── config.h.in
├── man
├── meson.build
└── wayfire.1.in
├── meson.build
├── meson_options.txt
├── metadata
├── alpha.xml
├── animate.xml
├── autostart.xml
├── blur.xml
├── command.xml
├── core.xml
├── cube.xml
├── decoration.xml
├── expo.xml
├── extra-gestures.xml
├── fast-switcher.xml
├── fisheye.xml
├── foreign-toplevel.xml
├── grid.xml
├── gtk-shell.xml
├── idle.xml
├── input-device.xml
├── input-method-v1.xml
├── input.xml
├── invert.xml
├── ipc-rules.xml
├── ipc.xml
├── meson.build
├── move.xml
├── oswitch.xml
├── output.xml
├── place.xml
├── preserve-output.xml
├── resize.xml
├── scale-title-filter.xml
├── scale.xml
├── session-lock.xml
├── shortcuts-inhibit.xml
├── simple-tile.xml
├── switcher.xml
├── vswipe.xml
├── vswitch.xml
├── wayfire-shell.xml
├── window-rules.xml
├── wm-actions.xml
├── wobbly.xml
├── workarounds.xml
├── wrot.xml
├── wsets.xml
├── xdg-activation.xml
└── zoom.xml
├── plugins
├── animate
│ ├── animate.cpp
│ ├── animate.hpp
│ ├── basic_animations.hpp
│ ├── fire
│ │ ├── fire.cpp
│ │ ├── fire.hpp
│ │ ├── particle.cpp
│ │ ├── particle.hpp
│ │ └── shaders.hpp
│ ├── meson.build
│ ├── shaders
│ │ ├── frag.glsl
│ │ └── vertex.glsl
│ ├── spin.hpp
│ ├── squeezimize.hpp
│ ├── system_fade.hpp
│ ├── unmapped-view-node.hpp
│ └── zap.hpp
├── blur
│ ├── blur-base.cpp
│ ├── blur.cpp
│ ├── blur.hpp
│ ├── bokeh.cpp
│ ├── box.cpp
│ ├── gaussian.cpp
│ ├── kawase.cpp
│ └── meson.build
├── common
│ ├── meson.build
│ ├── move-drag-interface.cpp
│ ├── wayfire
│ │ └── plugins
│ │ │ └── common
│ │ │ ├── cairo-util.hpp
│ │ │ ├── geometry-animation.hpp
│ │ │ ├── input-grab.hpp
│ │ │ ├── key-repeat.hpp
│ │ │ ├── move-drag-interface.hpp
│ │ │ ├── preview-indication.hpp
│ │ │ ├── shared-core-data.hpp
│ │ │ ├── simple-text-node.hpp
│ │ │ ├── simple-texture.hpp
│ │ │ ├── util.hpp
│ │ │ └── workspace-wall.hpp
│ └── workspace-wall.cpp
├── cube
│ ├── cube-background.hpp
│ ├── cube-control-signal.hpp
│ ├── cube.cpp
│ ├── cube.hpp
│ ├── cubemap-shaders.tpp
│ ├── cubemap.cpp
│ ├── cubemap.hpp
│ ├── meson.build
│ ├── shaders-3-2.tpp
│ ├── shaders.tpp
│ ├── simple-background.cpp
│ ├── simple-background.hpp
│ ├── skydome.cpp
│ └── skydome.hpp
├── decor
│ ├── deco-button.cpp
│ ├── deco-button.hpp
│ ├── deco-layout.cpp
│ ├── deco-layout.hpp
│ ├── deco-subsurface.cpp
│ ├── deco-subsurface.hpp
│ ├── deco-theme.cpp
│ ├── deco-theme.hpp
│ ├── decoration.cpp
│ └── meson.build
├── grid
│ ├── grid.cpp
│ ├── meson.build
│ └── wayfire
│ │ └── plugins
│ │ ├── crossfade.hpp
│ │ └── grid.hpp
├── ipc-rules
│ ├── ipc-events.hpp
│ ├── ipc-input-methods.hpp
│ ├── ipc-rules-common.hpp
│ ├── ipc-rules.cpp
│ ├── ipc-utility-methods.hpp
│ └── meson.build
├── ipc
│ ├── ipc.cpp
│ ├── ipc.hpp
│ ├── meson.build
│ ├── stipc.cpp
│ └── wayfire
│ │ └── plugins
│ │ └── ipc
│ │ ├── ipc-activator.hpp
│ │ ├── ipc-helpers.hpp
│ │ └── ipc-method-repository.hpp
├── meson.build
├── pch
│ └── plugin_pch.hpp
├── protocols
│ ├── foreign-toplevel.cpp
│ ├── gtk-shell.cpp
│ ├── gtk-shell.hpp
│ ├── input-method-v1.cpp
│ ├── input-method-v1.hpp
│ ├── meson.build
│ ├── session-lock.cpp
│ ├── shortcuts-inhibit.cpp
│ ├── text-input-v1-v3.hpp
│ ├── wayfire-shell.cpp
│ └── xdg-activation.cpp
├── scale
│ ├── meson.build
│ ├── scale-title-filter.cpp
│ ├── scale-title-overlay.cpp
│ ├── scale-title-overlay.hpp
│ ├── scale.cpp
│ ├── scale.hpp
│ └── wayfire
│ │ └── plugins
│ │ └── scale-signal.hpp
├── single_plugins
│ ├── alpha.cpp
│ ├── autostart.cpp
│ ├── command.cpp
│ ├── compositor-view-test.cpp
│ ├── expo.cpp
│ ├── extra-gestures.cpp
│ ├── fast-switcher.cpp
│ ├── fisheye.cpp
│ ├── idle.cpp
│ ├── invert.cpp
│ ├── meson.build
│ ├── move.cpp
│ ├── oswitch.cpp
│ ├── place.cpp
│ ├── preserve-output.cpp
│ ├── resize.cpp
│ ├── switcher.cpp
│ ├── vswipe-processing.hpp
│ ├── vswipe.cpp
│ ├── wrot.cpp
│ ├── wsets.cpp
│ ├── xkb-bindings.cpp
│ └── zoom.cpp
├── tile
│ ├── meson.build
│ ├── tile-dragging.hpp
│ ├── tile-ipc.hpp
│ ├── tile-plugin.cpp
│ ├── tile-wset.hpp
│ ├── tree-controller.cpp
│ ├── tree-controller.hpp
│ ├── tree.cpp
│ └── tree.hpp
├── vswitch
│ ├── meson.build
│ ├── vswitch.cpp
│ └── wayfire
│ │ └── plugins
│ │ └── vswitch.hpp
├── window-rules
│ ├── lambda-rules-registration.hpp
│ ├── meson.build
│ ├── view-action-interface.cpp
│ ├── view-action-interface.hpp
│ └── window-rules.cpp
├── wm-actions
│ ├── meson.build
│ ├── wm-actions-signals.hpp
│ └── wm-actions.cpp
└── wobbly
│ ├── meson.build
│ ├── wayfire
│ └── plugins
│ │ └── wobbly
│ │ └── wobbly-signal.hpp
│ ├── wobbly.c
│ ├── wobbly.cpp
│ └── wobbly.h
├── proto
├── gtk-shell.xml
├── meson.build
├── wayfire-shell-unstable-v2.xml
├── wlr-layer-shell-unstable-v1.xml
└── wlr-output-power-management-unstable-v1.xml
├── src
├── api
│ └── wayfire
│ │ ├── bindings-repository.hpp
│ │ ├── bindings.hpp
│ │ ├── compositor-view.hpp
│ │ ├── config-backend.hpp
│ │ ├── core.hpp
│ │ ├── dassert.hpp
│ │ ├── debug.hpp
│ │ ├── geometry.hpp
│ │ ├── idle.hpp
│ │ ├── img.hpp
│ │ ├── input-device.hpp
│ │ ├── matcher.hpp
│ │ ├── nonstd
│ │ ├── json.hpp
│ │ ├── observer_ptr.h
│ │ ├── reverse.hpp
│ │ ├── tracking-allocator.hpp
│ │ ├── wlroots-full.hpp
│ │ └── wlroots.hpp
│ │ ├── object.hpp
│ │ ├── opengl.hpp
│ │ ├── option-wrapper.hpp
│ │ ├── output-layout.hpp
│ │ ├── output.hpp
│ │ ├── per-output-plugin.hpp
│ │ ├── plugin.hpp
│ │ ├── region.hpp
│ │ ├── render-manager.hpp
│ │ ├── scene-input.hpp
│ │ ├── scene-operations.hpp
│ │ ├── scene-render.hpp
│ │ ├── scene.hpp
│ │ ├── seat.hpp
│ │ ├── signal-definitions.hpp
│ │ ├── signal-provider.hpp
│ │ ├── toplevel-view.hpp
│ │ ├── toplevel.hpp
│ │ ├── txn
│ │ ├── transaction-manager.hpp
│ │ ├── transaction-object.hpp
│ │ └── transaction.hpp
│ │ ├── unstable
│ │ ├── translation-node.hpp
│ │ ├── wlr-subsurface-controller.hpp
│ │ ├── wlr-surface-controller.hpp
│ │ ├── wlr-surface-node.hpp
│ │ ├── wlr-text-input-v3-popup.hpp
│ │ ├── wlr-view-events.hpp
│ │ ├── wlr-view-keyboard-interaction.hpp
│ │ ├── xdg-toplevel-base.hpp
│ │ └── xwl-toplevel-base.hpp
│ │ ├── util.hpp
│ │ ├── view-access-interface.hpp
│ │ ├── view-helpers.hpp
│ │ ├── view-transform.hpp
│ │ ├── view.hpp
│ │ ├── window-manager.hpp
│ │ ├── workarea.hpp
│ │ ├── workspace-set.hpp
│ │ └── workspace-stream.hpp
├── core
│ ├── core-impl.hpp
│ ├── core.cpp
│ ├── gldebug.hpp
│ ├── idle.cpp
│ ├── img.cpp
│ ├── matcher.cpp
│ ├── object.cpp
│ ├── opengl-priv.hpp
│ ├── opengl.cpp
│ ├── output-layout.cpp
│ ├── plugin-loader.cpp
│ ├── plugin-loader.hpp
│ ├── plugin.cpp
│ ├── scene-priv.hpp
│ ├── scene.cpp
│ ├── seat
│ │ ├── bindings-repository-impl.hpp
│ │ ├── bindings-repository.cpp
│ │ ├── cursor.cpp
│ │ ├── cursor.hpp
│ │ ├── drag-icon.cpp
│ │ ├── drag-icon.hpp
│ │ ├── hotspot-manager.cpp
│ │ ├── hotspot-manager.hpp
│ │ ├── input-manager.cpp
│ │ ├── input-manager.hpp
│ │ ├── input-method-popup.cpp
│ │ ├── input-method-relay.cpp
│ │ ├── input-method-relay.hpp
│ │ ├── keyboard.cpp
│ │ ├── keyboard.hpp
│ │ ├── pointer.cpp
│ │ ├── pointer.hpp
│ │ ├── pointing-device.cpp
│ │ ├── pointing-device.hpp
│ │ ├── seat-impl.hpp
│ │ ├── seat.cpp
│ │ ├── switch.cpp
│ │ ├── switch.hpp
│ │ ├── tablet.cpp
│ │ ├── tablet.hpp
│ │ ├── touch.cpp
│ │ └── touch.hpp
│ ├── shaders.tpp
│ ├── txn
│ │ ├── transaction-manager-impl.hpp
│ │ ├── transaction-manager.cpp
│ │ └── transaction.cpp
│ ├── view-access-interface.cpp
│ ├── window-manager.cpp
│ ├── wm.cpp
│ └── wm.hpp
├── debug.cpp
├── default-config-backend.cpp
├── geometry.cpp
├── json.cpp
├── main.cpp
├── main.hpp
├── meson.build
├── output
│ ├── output-impl.hpp
│ ├── output.cpp
│ ├── promotion-manager.hpp
│ ├── render-manager.cpp
│ ├── workarea.cpp
│ ├── workspace-impl.cpp
│ └── workspace-stream.cpp
├── pch
│ └── pch.h
├── region.cpp
├── util.cpp
├── version
│ ├── git-branch.cpp.in
│ └── git-commit.cpp.in
├── view
│ ├── compositor-view.cpp
│ ├── layer-shell
│ │ ├── layer-shell-node.cpp
│ │ ├── layer-shell-node.hpp
│ │ └── layer-shell.cpp
│ ├── toplevel-node.cpp
│ ├── toplevel-node.hpp
│ ├── toplevel-view.cpp
│ ├── translation-node.cpp
│ ├── view-3d.cpp
│ ├── view-impl.cpp
│ ├── view-impl.hpp
│ ├── view.cpp
│ ├── wlr-subsurface-controller.cpp
│ ├── wlr-surface-controller.cpp
│ ├── wlr-surface-node.cpp
│ ├── wlr-surface-pointer-interaction.hpp
│ ├── wlr-surface-touch-interaction.cpp
│ ├── xdg-shell.cpp
│ ├── xdg-shell.hpp
│ ├── xdg-shell
│ │ ├── xdg-toplevel-view.cpp
│ │ ├── xdg-toplevel-view.hpp
│ │ ├── xdg-toplevel.cpp
│ │ └── xdg-toplevel.hpp
│ ├── xwayland.cpp
│ └── xwayland
│ │ ├── xwayland-helpers.cpp
│ │ ├── xwayland-helpers.hpp
│ │ ├── xwayland-toplevel-view.cpp
│ │ ├── xwayland-toplevel-view.hpp
│ │ ├── xwayland-toplevel.cpp
│ │ ├── xwayland-toplevel.hpp
│ │ ├── xwayland-unmanaged-view.hpp
│ │ ├── xwayland-view-base.cpp
│ │ └── xwayland-view-base.hpp
└── wl-listener-wrapper.tpp
├── subprojects
└── yyjson.wrap
├── test
├── geometry
│ ├── geometry_test.cpp
│ └── meson.build
├── meson.build
├── misc
│ ├── meson.build
│ ├── safe-list-test.cpp
│ └── tracking-allocator.cpp
└── txn
│ ├── meson.build
│ ├── transaction-manager-test.cpp
│ ├── transaction-test-object.hpp
│ └── transaction-test.cpp
├── uncrustify.ini
├── wayfire.desktop
└── wayfire.ini
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | end_of_line = lf
5 | insert_final_newline = true
6 | charset = utf-8
7 | indent_style = space
8 | indent_size = 4
9 |
10 | [*.{build,xml,yaml}]
11 | indent_size = 2
12 |
13 | [metadata/**.xml]
14 | indent_style = tab
15 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Bad behavior (crash, something doesn't work, etc.)
4 | title: ''
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Enable plugin X
16 | 2. Do Y
17 | 3. Z happens
18 |
19 | **Expected behavior**
20 | A clear and concise description of what you expected to happen.
21 |
22 | **Screenshots or stacktrace**
23 | If applicable, add screenshots to help explain your problem.
24 | If it is a crash, attach the backtrace (or the whole log file), Wayfire will print it in the end of the log file or stdout.
25 | Backtrace with address sanitizer enabled (if possible):
26 |
27 | **Wayfire version**
28 | 0.5.0, git, package, something else?
29 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 | Please describe what you want Wayfire to do.
11 |
12 | If applicable, give an example: User does X, Y, Wayfire does Z
13 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/others.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Others
3 | about: Issues which are neither bugs nor feature requests
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.github/workflows/mandoc.yaml:
--------------------------------------------------------------------------------
1 | name: mandoc
2 |
3 | on:
4 | push:
5 | branches:
6 | - '*'
7 | pull_request:
8 | branches:
9 | - '*'
10 |
11 | jobs:
12 | pipeline:
13 | runs-on: ubuntu-latest
14 | steps:
15 | - uses: actions/checkout@v2
16 | - name: Install dependencies
17 | run: |
18 | sudo apt update
19 | sudo apt-get install -y mandoc
20 | - name: Check man pages
21 | run: |
22 | mandoc -T lint -W warning man/wayfire.1.in
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # Created by https://www.toptal.com/developers/gitignore/api/c++,meson,ninja,linux
3 | # Edit at https://www.toptal.com/developers/gitignore?templates=c++,meson,ninja,linux
4 |
5 | ### C++ ###
6 | # Prerequisites
7 | *.d
8 |
9 | # Compiled Object files
10 | *.slo
11 | *.lo
12 | *.o
13 | *.obj
14 |
15 | # Precompiled Headers
16 | *.gch
17 | *.pch
18 |
19 | # Compiled Dynamic libraries
20 | *.so
21 | *.dylib
22 | *.dll
23 |
24 | # Fortran module files
25 | *.mod
26 | *.smod
27 |
28 | # Compiled Static libraries
29 | *.lai
30 | *.la
31 | *.a
32 | *.lib
33 |
34 | # Executables
35 | *.exe
36 | *.out
37 | *.app
38 |
39 | ### Linux ###
40 | *~
41 |
42 | # temporary files which can be created if a process still has a handle open of a deleted file
43 | .fuse_hidden*
44 |
45 | # KDE directory preferences
46 | .directory
47 |
48 | # Linux trash folder which might appear on any partition or disk
49 | .Trash-*
50 |
51 | # .nfs files are created when an open file is removed but is still being accessed
52 | .nfs*
53 |
54 | ### Meson ###
55 | # subproject directories
56 | /subprojects/*
57 | !/subprojects/*.wrap
58 |
59 | ### Ninja ###
60 | .ninja_deps
61 | .ninja_log
62 |
63 | build/**
64 |
65 | .cache/**
66 |
67 | # End of https://www.toptal.com/developers/gitignore/api/c++,meson,ninja,linux
68 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "subprojects/wf-config"]
2 | path = subprojects/wf-config
3 | url = https://github.com/WayfireWM/wf-config
4 | [submodule "subprojects/wlroots"]
5 | path = subprojects/wlroots
6 | url = https://gitlab.freedesktop.org/wlroots/wlroots.git
7 | [submodule "subprojects/wf-utils"]
8 | path = subprojects/wf-utils
9 | url = https://github.com/WayfireWM/wf-utils.git
10 | [submodule "subprojects/wf-touch"]
11 | path = subprojects/wf-touch
12 | url = https://github.com/WayfireWM/wf-touch
13 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018 Iliya Bozhinov
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/config.h.in:
--------------------------------------------------------------------------------
1 | #ifndef CONFIG_H
2 | #define CONFIG_H
3 |
4 | #define INSTALL_PREFIX "@INSTALL_PREFIX@"
5 | #define PLUGIN_PATH "@PLUGIN_PATH@"
6 | #define PLUGIN_XML_DIR "@PLUGIN_XML_DIR@"
7 | #define SYSCONFDIR "@SYSCONFDIR@"
8 | #define WF_DEFAULT_CONFIG_BACKEND "@DEFAULT_CONFIG_BACKEND@"
9 | #mesondefine BUILD_WITH_IMAGEIO
10 | #mesondefine USE_GLES32
11 | #mesondefine WF_HAS_XWAYLAND
12 |
13 |
14 | #endif /* end of include guard: CONFIG_H */
15 |
--------------------------------------------------------------------------------
/man/meson.build:
--------------------------------------------------------------------------------
1 | configure_file(input: 'wayfire.1.in',
2 | output: 'wayfire.1',
3 | configuration: conf_data)
4 |
5 | install_man(join_paths(meson.project_build_root(), 'man', 'wayfire.1'))
6 |
--------------------------------------------------------------------------------
/meson_options.txt:
--------------------------------------------------------------------------------
1 | option('enable_gles32', type: 'boolean', value: true, description: 'Enable usage of GLES 3.2')
2 | option('enable_openmp', type: 'boolean', value: true, description: 'Enable usage of OpenMP')
3 | option('use_system_wfconfig', type: 'feature', value: 'auto', description: 'Use the system-wide installation of wf-config')
4 | option('use_system_wlroots', type: 'feature', value: 'auto', description: 'Use the system-wide installation of wlroots')
5 | option('xwayland', type: 'feature', value: 'auto', description: 'Build with xwayland support. Requires wlroots also built with xwayland support')
6 | option('default_config_backend', type: 'string', value: 'default', description: 'Default configuration backend to use')
7 | option('print_trace', type: 'boolean', value: true, description: 'Print stack trace in debug logs (disables coredump)')
8 | option('tests', type: 'feature', value: 'auto', description: 'Enable unit tests')
9 | option('custom_pch', type: 'boolean', value: false, description: 'Use custom PCH for plugins. May not work with all compilers and setups.')
10 |
--------------------------------------------------------------------------------
/metadata/alpha.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Alpha
5 | <_long>A plugin to change the opacity of windows.
6 | Desktop
7 |
12 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/metadata/autostart.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Autostart
5 | <_long>A plugin to run shell commands on startup.
6 | General
7 |
8 | <_short>Autostart
9 | <_long>Specifies the shell commands to run on startup.
10 |
17 |
18 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/metadata/command.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Command
5 | <_long>A plugin to bind key combo (key, button, touch) to execute shell commands.
6 | General
7 |
20 |
21 |
34 |
35 |
48 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/metadata/decoration.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Decoration
5 | <_long>Default decorations around XWayland windows.
6 | Effects
7 |
12 |
17 |
22 |
27 |
28 |
33 |
38 |
43 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/metadata/expo.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Expo
5 | <_long>A plugin to show an overview of all workspaces.
6 | Desktop
7 |
12 |
17 |
22 |
27 |
32 |
40 |
45 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/metadata/extra-gestures.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Extra Touchscreen Gestures
5 | <_long>A plugin which provides several touchscreen gestures.
6 | Desktop
7 |
14 |
21 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/metadata/fast-switcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Fast Switcher
5 | <_long>A plugin to switch active window.
6 | Window Management
7 |
12 |
17 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/metadata/fisheye.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Fisheye
5 | <_long>A plugin which provides fisheye effect.
6 | Effects
7 |
12 |
18 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/metadata/foreign-toplevel.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Foreign Toplevel Protocol
5 | <_long>An implementation of the wlr-foreign-toplevel-management-v1 protocol.
6 | Utility
7 |
8 |
9 |
--------------------------------------------------------------------------------
/metadata/gtk-shell.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>GTK Shell Protocol
5 | <_long>An implementation of the gtk-shell protocol.
6 | Utility
7 |
8 |
9 |
--------------------------------------------------------------------------------
/metadata/idle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Idle
5 | <_long>A plugin for idle settings, such as the screensaver and DPMS.
6 | Desktop
7 |
8 |
13 |
14 |
19 |
20 |
25 |
26 |
31 |
32 |
37 |
38 |
43 |
49 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/metadata/input-device.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
15 |
--------------------------------------------------------------------------------
/metadata/input-method-v1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Input-Method-V1 Protocol
5 | <_long>An implementation of the input-method-v1 protocol. Needed for proper functioning of input methods like Fcitx5.
6 | Utility
7 |
11 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/metadata/invert.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Invert
5 | <_long>A plugin to invert the colors of the whole output.
6 | Accessibility
7 |
12 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/metadata/ipc-rules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Window Rules IPC Interface
5 | <_long>Interface to allow an external program to implement window rules (requires the IPC plugin).
6 | Window Management
7 |
8 |
9 |
--------------------------------------------------------------------------------
/metadata/ipc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>IPC protocol
5 | <_long>Allow external programs to interact with Wayfire plugins.
6 | Utility
7 |
8 |
9 |
--------------------------------------------------------------------------------
/metadata/oswitch.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Output Switcher
5 | <_long>A plugin to change the focused output.
6 | Desktop
7 |
12 |
17 |
22 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/metadata/output.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
26 |
27 |
--------------------------------------------------------------------------------
/metadata/place.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Place
5 | <_long>A plugin to position newly opened windows.
6 | Window Management
7 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/metadata/preserve-output.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Preserve Output
5 | <_long>A plugin to restore windows to their original position if outputs are temporarily disconnected.
6 | Window Management
7 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/metadata/resize.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Resize
5 | <_long>A plugin to resize windows by dragging them from any part (not just the edges).
6 | Window Management
7 |
12 |
13 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/metadata/scale-title-filter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Scale Title Filter
5 | <_long>Filter the views shown by scale by typing.
6 | Utility
7 |
12 |
17 |
22 |
28 |
33 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/metadata/session-lock.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Session Lock Protocol
5 | <_long>An implementation of the ext-session-lock-v1 protocol. Provides more secure screen locking.
6 | Utility
7 |
8 |
9 |
--------------------------------------------------------------------------------
/metadata/shortcuts-inhibit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Keyboard Shortcuts Inhibit Protocol
5 | <_long>An implementation of the keyboard-shortcuts-inhibit-v1 protocol.
6 | Utility
7 |
8 |
13 |
14 |
19 |
20 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/metadata/switcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Switcher
5 | <_long>A plugin to change active window with an animation.
6 | Window Management
7 |
8 |
13 |
18 |
19 |
24 |
29 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/metadata/vswipe.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Viewport Swipe
5 | <_long>A plugin to swipe workspaces in a grid.
6 | Desktop
7 |
12 |
17 |
22 |
27 |
32 |
37 |
42 |
47 |
52 |
57 |
62 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/metadata/wayfire-shell.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Wayfire Shell Protocol
5 | <_long>An implementation of the wayfire-shell protocol.
6 | Utility
7 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/metadata/window-rules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Window Rules
5 | <_long>A plugin to apply specific commands to windows by using various criteria.
6 | Window Management
7 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/metadata/wm-actions.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>WM Actions
5 | <_long>A plugin which provides various window management functionalities.
6 | Window Management
7 |
12 |
17 |
22 |
27 |
32 |
37 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/metadata/wobbly.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Wobbly
5 | <_long>A plugin to get wobbly windows.
6 | Effects
7 |
12 |
17 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/metadata/wrot.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Window Rotate
5 | <_long>A plugin to rotate windows with the mouse.
6 | Effects
7 |
12 |
17 |
23 |
28 |
33 |
38 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/metadata/wsets.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Workspace Sets
5 | <_long>A plugin which allows manipulation of workspace sets.
6 | Desktop
7 |
12 |
17 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/metadata/xdg-activation.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>XDG Activation Protocol
5 | <_long>An implementation of the xdg-activation-v1 protocol. This allows the active app to pass the focus to a different view in the same or a different app.
6 | Utility
7 |
12 |
17 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/metadata/zoom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <_short>Zoom
5 | <_long>A plugin to zoom in the desktop with the mouse.
6 | Accessibility
7 |
12 |
18 |
23 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/plugins/animate/animate.hpp:
--------------------------------------------------------------------------------
1 | #ifndef ANIMATE_H_
2 | #define ANIMATE_H_
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | #define WF_ANIMATE_HIDING_ANIMATION (1 << 0)
9 | #define WF_ANIMATE_SHOWING_ANIMATION (1 << 1)
10 | #define WF_ANIMATE_MAP_STATE_ANIMATION (1 << 2)
11 | #define WF_ANIMATE_MINIMIZE_STATE_ANIMATION (1 << 3)
12 |
13 | namespace wf
14 | {
15 | namespace animate
16 | {
17 | enum animation_type
18 | {
19 | ANIMATION_TYPE_MAP = WF_ANIMATE_SHOWING_ANIMATION | WF_ANIMATE_MAP_STATE_ANIMATION,
20 | ANIMATION_TYPE_UNMAP = WF_ANIMATE_HIDING_ANIMATION | WF_ANIMATE_MAP_STATE_ANIMATION,
21 | ANIMATION_TYPE_MINIMIZE = WF_ANIMATE_HIDING_ANIMATION | WF_ANIMATE_MINIMIZE_STATE_ANIMATION,
22 | ANIMATION_TYPE_RESTORE = WF_ANIMATE_SHOWING_ANIMATION | WF_ANIMATE_MINIMIZE_STATE_ANIMATION,
23 | };
24 |
25 | class animation_base_t
26 | {
27 | public:
28 | virtual void init(wayfire_view view, wf::animation_description_t duration, animation_type type)
29 | {}
30 |
31 | /**
32 | * @return True if the animation should continue for at least one more frame.
33 | */
34 | virtual bool step()
35 | {
36 | return false;
37 | }
38 |
39 | /**
40 | * Reverse the animation direction (hiding -> showing, showing -> hiding)
41 | */
42 | virtual void reverse()
43 | {}
44 |
45 | virtual ~animation_base_t() = default;
46 | };
47 |
48 | struct effect_description_t
49 | {
50 | std::function()> generator;
51 | std::function()> default_duration;
52 | };
53 |
54 | /**
55 | * The effects registry holds a list of all available animation effects.
56 | * Plugins can access the effects registry via ref_ptr_t helper in wayfire/plugins/common/shared-core-data.hpp
57 | * They may add/remove their own effects.
58 | */
59 | class animate_effects_registry_t
60 | {
61 | public:
62 | void register_effect(std::string name, effect_description_t effect)
63 | {
64 | effects[name] = effect;
65 | }
66 |
67 | void unregister_effect(std::string name)
68 | {
69 | effects.erase(name);
70 | }
71 |
72 | std::map effects;
73 | };
74 | }
75 | }
76 |
77 | #endif
78 |
--------------------------------------------------------------------------------
/plugins/animate/fire/fire.hpp:
--------------------------------------------------------------------------------
1 | #ifndef FIRE_ANIMATION_HPP
2 | #define FIRE_ANIMATION_HPP
3 |
4 | #include
5 | #include
6 | #include "../animate.hpp"
7 |
8 | class FireTransformer;
9 | class ParticleSystem;
10 |
11 | class FireAnimation : public wf::animate::animation_base_t
12 | {
13 | std::string name; // the name of the transformer in the view's table
14 | wayfire_view view;
15 | wf::animation::simple_animation_t progression;
16 |
17 | public:
18 |
19 | ~FireAnimation();
20 | void init(wayfire_view view, wf::animation_description_t, wf::animate::animation_type type) override;
21 | bool step() override; /* return true if continue, false otherwise */
22 | void reverse() override; /* reverse the animation */
23 | };
24 |
25 | #endif /* end of include guard: FIRE_ANIMATION_HPP */
26 |
--------------------------------------------------------------------------------
/plugins/animate/fire/particle.hpp:
--------------------------------------------------------------------------------
1 | #ifndef ANIMATION_FIRE_PARTICLE_HPP
2 | #define ANIMATION_FIRE_PARTICLE_HPP
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | struct Particle
10 | {
11 | float life = -1;
12 | float fade;
13 |
14 | float radius, base_radius;
15 |
16 | glm::vec2 pos{0.0, 0.0}, speed{0.0, 0.0}, g{0.0, 0.0};
17 | glm::vec2 start_pos;
18 |
19 | glm::vec4 color{1.0, 1.0, 1.0, 1.0};
20 |
21 | /* update the given particle
22 | * time is the percentage of the frame which has elapsed
23 | * must be thread-safe */
24 | void update(float time);
25 | };
26 |
27 | /* a function to initialize a particle */
28 | using ParticleIniter = std::function;
29 |
30 | class ParticleSystem
31 | {
32 | public:
33 | /* the user of this class has to set up a proper GL context
34 | * before creating the ParticleSystem */
35 | ParticleSystem(int num_part);
36 | ~ParticleSystem();
37 | void set_initer(ParticleIniter init);
38 |
39 | ParticleSystem(const ParticleSystem &) = delete;
40 | ParticleSystem(ParticleSystem &&) = delete;
41 | ParticleSystem& operator =(const ParticleSystem&) = delete;
42 | ParticleSystem& operator =(ParticleSystem&&) = delete;
43 |
44 | /* spawn at most num new particles.
45 | * returns the number of actually spawned particles */
46 | int spawn(int num);
47 |
48 | /* change the maximal number of particles
49 | * Warning: This might kill a lot of particles */
50 | void resize(int num);
51 |
52 | // return the maximal number of particles
53 | int size();
54 |
55 | /* update all particles */
56 | void update();
57 |
58 | // number of particles alive
59 | int statistic();
60 |
61 | /* render particles, each will be multiplied by matrix
62 | * The user of this class has to set up the same GL context that was
63 | * used during the creation of the particle system */
64 | void render(glm::mat4 matrix);
65 |
66 | private:
67 | ParticleSystem() = delete;
68 |
69 | ParticleIniter pinit_func = [] (auto) {};
70 | uint32_t last_update_msec;
71 |
72 | std::atomic particles_alive;
73 | std::vector ps;
74 |
75 | static constexpr int color_per_particle = 4;
76 | std::vector color, dark_color;
77 |
78 | static constexpr int radius_per_particle = 1;
79 | std::vector radius;
80 |
81 | static constexpr int center_per_particle = 2;
82 | std::vector center;
83 |
84 | OpenGL::program_t program;
85 | void update_worker(float time, int i);
86 | void create_program();
87 | };
88 |
89 |
90 | #endif /* end of include guard: ANIMATION_FIRE_PARTICLE_HPP */
91 |
--------------------------------------------------------------------------------
/plugins/animate/fire/shaders.hpp:
--------------------------------------------------------------------------------
1 | #ifndef PARTICLE_ANIMATION_SHADER
2 | #define PARTICLE_ANIMATION_SHADER
3 |
4 | static const char *particle_vert_source =
5 | R"(
6 | #version 100
7 |
8 | attribute mediump float radius;
9 | attribute mediump vec2 position;
10 | attribute mediump vec2 center;
11 | attribute mediump vec4 color;
12 |
13 | uniform mat4 matrix;
14 |
15 | varying mediump vec2 uv;
16 | varying mediump vec4 out_color;
17 | varying mediump float R;
18 |
19 | void main() {
20 | uv = position * radius;
21 | gl_Position = matrix * vec4(center.x + uv.x * 0.75, center.y + uv.y, 0.0, 1.0);
22 |
23 | R = radius;
24 | out_color = color;
25 | }
26 | )";
27 |
28 | static const char *particle_frag_source =
29 | R"(
30 | #version 100
31 |
32 | varying mediump vec2 uv;
33 | varying mediump vec4 out_color;
34 | varying mediump float R;
35 |
36 | uniform mediump float smoothing;
37 |
38 | void main()
39 | {
40 | mediump float len = length(uv);
41 | if (len >= R)
42 | {
43 | gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
44 | }
45 | else {
46 | mediump float factor = 1.0 - len / R;
47 | factor = pow(factor, smoothing);
48 | gl_FragColor = factor * out_color;
49 | }
50 | }
51 | )";
52 |
53 | #endif /* end of include guard: PARTICLE_ANIMATION_SHADER */
54 |
--------------------------------------------------------------------------------
/plugins/animate/meson.build:
--------------------------------------------------------------------------------
1 | dependencies = [wlroots, pixman, wfconfig]
2 | animate_pch_deps = [plugin_pch_dep]
3 |
4 | if get_option('enable_openmp')
5 | dependencies += [dependency('openmp')]
6 | # PCH does not have openmp enabled
7 | animate_pch_deps = []
8 | endif
9 |
10 | animiate = shared_module('animate',
11 | ['animate.cpp',
12 | 'fire/particle.cpp',
13 | 'fire/fire.cpp'],
14 | include_directories: [wayfire_api_inc, wayfire_conf_inc],
15 | dependencies: dependencies + animate_pch_deps,
16 | install: true,
17 | install_dir: join_paths(get_option('libdir'), 'wayfire'))
18 |
19 | install_headers(['animate.hpp'], subdir: 'wayfire/plugins/animate')
20 |
--------------------------------------------------------------------------------
/plugins/animate/shaders/frag.glsl:
--------------------------------------------------------------------------------
1 | #version 310 es
2 |
3 | in mediump vec4 out_color;
4 | in mediump vec2 pos;
5 | out mediump vec4 fragColor;
6 |
7 | layout(location = 4) uniform highp float radii;
8 |
9 | void main()
10 | {
11 | mediump float dist_center = sqrt(pos.x * pos.x + pos.y * pos.y);
12 | mediump float factor = (radii - dist_center) / radii;
13 | if (factor < 0.0) factor = 0.0;
14 | mediump float factor2 = factor * factor;
15 |
16 | fragColor = vec4(out_color.xyz, out_color.w * factor2);
17 | }
18 |
--------------------------------------------------------------------------------
/plugins/animate/shaders/vertex.glsl:
--------------------------------------------------------------------------------
1 | #version 310 es
2 |
3 | layout(location = 0) in mediump vec2 position;
4 | layout(location = 1) in mediump vec2 center;
5 | layout(location = 2) in mediump vec4 color;
6 | layout(location = 3) uniform mediump vec2 global_offset;
7 |
8 | out mediump vec4 out_color;
9 | out mediump vec2 pos;
10 |
11 | void main() {
12 | gl_Position = vec4 (position + center + global_offset, 0.0, 1.0);
13 | out_color = color;
14 | pos = position;
15 | }
16 |
--------------------------------------------------------------------------------
/plugins/animate/system_fade.hpp:
--------------------------------------------------------------------------------
1 | #ifndef SYSTEM_FADE_HPP
2 | #define SYSTEM_FADE_HPP
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | /* animates wake from suspend/startup by fading in the whole output */
11 | class wf_system_fade
12 | {
13 | wf::animation::simple_animation_t progression;
14 |
15 | wf::output_t *output;
16 |
17 | wf::effect_hook_t damage_hook, render_hook;
18 |
19 | public:
20 | wf_system_fade(wf::output_t *out, wf::animation_description_t dur) :
21 | progression(wf::create_option(dur)), output(out)
22 | {
23 | damage_hook = [=] ()
24 | { output->render->damage_whole(); };
25 |
26 | render_hook = [=] ()
27 | { render(); };
28 |
29 | output->render->add_effect(&damage_hook, wf::OUTPUT_EFFECT_PRE);
30 | output->render->add_effect(&render_hook, wf::OUTPUT_EFFECT_OVERLAY);
31 | output->render->set_redraw_always();
32 | this->progression.animate(1, 0);
33 | }
34 |
35 | void render()
36 | {
37 | wf::color_t color{0, 0, 0, this->progression};
38 | auto fb = output->render->get_target_framebuffer();
39 | auto geometry = output->get_relative_geometry();
40 |
41 | OpenGL::render_begin(fb);
42 | OpenGL::render_rectangle(geometry, color,
43 | fb.get_orthographic_projection());
44 | OpenGL::render_end();
45 |
46 | if (!progression.running())
47 | {
48 | finish();
49 | }
50 | }
51 |
52 | void finish()
53 | {
54 | output->render->rem_effect(&damage_hook);
55 | output->render->rem_effect(&render_hook);
56 | output->render->set_redraw_always(false);
57 |
58 | delete this;
59 | }
60 | };
61 |
62 | #endif
63 |
--------------------------------------------------------------------------------
/plugins/animate/unmapped-view-node.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "wayfire/geometry.hpp"
4 | #include "wayfire/opengl.hpp"
5 | #include "wayfire/region.hpp"
6 | #include "wayfire/scene-render.hpp"
7 | #include "wayfire/scene.hpp"
8 | #include
9 |
10 | namespace wf
11 | {
12 | class unmapped_view_snapshot_node : public wf::scene::node_t
13 | {
14 | wf::render_target_t snapshot;
15 | wf::geometry_t bbox;
16 |
17 | public:
18 | unmapped_view_snapshot_node(wayfire_view view) : node_t(false)
19 | {
20 | view->take_snapshot(snapshot);
21 | bbox = view->get_surface_root_node()->get_bounding_box();
22 | }
23 |
24 | ~unmapped_view_snapshot_node()
25 | {
26 | OpenGL::render_begin();
27 | snapshot.release();
28 | OpenGL::render_end();
29 | }
30 |
31 | wf::geometry_t get_bounding_box() override
32 | {
33 | return bbox;
34 | }
35 |
36 | void gen_render_instances(std::vector& instances,
37 | scene::damage_callback push_damage, wf::output_t *shown_on) override
38 | {
39 | instances.push_back(std::make_unique(this, push_damage, shown_on));
40 | }
41 |
42 | std::string stringify() const override
43 | {
44 | return "unmapped-view-snapshot-node " + this->stringify_flags();
45 | }
46 |
47 | private:
48 | class rinstance_t : public wf::scene::simple_render_instance_t
49 | {
50 | public:
51 | using simple_render_instance_t::simple_render_instance_t;
52 | void render(const wf::render_target_t& target, const wf::region_t& region)
53 | {
54 | OpenGL::render_begin(target);
55 | for (auto& box : region)
56 | {
57 | target.logic_scissor(wlr_box_from_pixman_box(box));
58 | OpenGL::render_texture(self->snapshot.tex, target, self->get_bounding_box());
59 | }
60 |
61 | OpenGL::render_end();
62 | }
63 | };
64 | };
65 | }
66 |
--------------------------------------------------------------------------------
/plugins/blur/meson.build:
--------------------------------------------------------------------------------
1 | blur_base = shared_library('wayfire-blur-base',
2 | ['blur-base.cpp', 'box.cpp', 'gaussian.cpp', 'kawase.cpp', 'bokeh.cpp'],
3 | include_directories: [wayfire_api_inc, wayfire_conf_inc],
4 | dependencies: [wlroots, pixman, wfconfig, plugin_pch_dep],
5 | override_options: ['b_lundef=false'],
6 | install: true)
7 | install_headers(['blur.hpp'], subdir: 'wayfire/plugins/blur')
8 |
9 | blur = shared_module('blur', ['blur.cpp'],
10 | link_with: blur_base,
11 | include_directories: [wayfire_api_inc, wayfire_conf_inc],
12 | dependencies: [wlroots, pixman, wfconfig, plugin_pch_dep],
13 | install: true, install_dir: join_paths(get_option('libdir'), 'wayfire'))
14 |
--------------------------------------------------------------------------------
/plugins/common/meson.build:
--------------------------------------------------------------------------------
1 | plugins_common_inc = include_directories('.')
2 | install_subdir('wayfire', install_dir: get_option('includedir'))
3 |
4 | workspace_wall = static_library('wayfire-workspace-wall',
5 | ['workspace-wall.cpp'],
6 | include_directories: [wayfire_api_inc, wayfire_conf_inc],
7 | dependencies: [wlroots, pixman, wfconfig, plugin_pch_dep],
8 | override_options: ['b_lundef=false'],
9 | install: true)
10 |
11 | move_drag_interface = static_library('wayfire-move-drag-interface',
12 | ['move-drag-interface.cpp'],
13 | include_directories: [wayfire_api_inc, wayfire_conf_inc, wobbly_inc],
14 | dependencies: [wlroots, pixman, wfconfig, plugin_pch_dep],
15 | override_options: ['b_lundef=false'],
16 | install: true)
17 |
--------------------------------------------------------------------------------
/plugins/common/wayfire/plugins/common/geometry-animation.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 | #include
5 |
6 | namespace wf
7 | {
8 | using namespace wf::animation;
9 | class geometry_animation_t : public duration_t
10 | {
11 | public:
12 | using duration_t::duration_t;
13 |
14 | timed_transition_t x{*this};
15 | timed_transition_t y{*this};
16 | timed_transition_t width{*this};
17 | timed_transition_t height{*this};
18 |
19 | void set_start(wf::geometry_t geometry)
20 | {
21 | copy_fields(geometry, &timed_transition_t::start);
22 | }
23 |
24 | void set_end(wf::geometry_t geometry)
25 | {
26 | copy_fields(geometry, &timed_transition_t::end);
27 | }
28 |
29 | operator wf::geometry_t() const
30 | {
31 | return {(int)x, (int)y, (int)width, (int)height};
32 | }
33 |
34 | protected:
35 | void copy_fields(wf::geometry_t geometry, double timed_transition_t::*member)
36 | {
37 | this->x.*member = geometry.x;
38 | this->y.*member = geometry.y;
39 | this->width.*member = geometry.width;
40 | this->height.*member = geometry.height;
41 | }
42 | };
43 |
44 | /** Interpolate the geometry between a and b with alpha (in [0..1]), i.e a *
45 | * (1-alpha) + b * alpha */
46 | static inline wf::geometry_t interpolate(wf::geometry_t a, wf::geometry_t b,
47 | double alpha)
48 | {
49 | const auto& interp = [=] (int32_t wf::geometry_t::*member) -> int32_t
50 | {
51 | return std::round((1 - alpha) * a.*member + alpha * b.*member);
52 | };
53 |
54 | return {
55 | interp(&wf::geometry_t::x),
56 | interp(&wf::geometry_t::y),
57 | interp(&wf::geometry_t::width),
58 | interp(&wf::geometry_t::height)
59 | };
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/plugins/common/wayfire/plugins/common/key-repeat.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | namespace wf
7 | {
8 | struct key_repeat_t
9 | {
10 | wf::option_wrapper_t delay{"input/kb_repeat_delay"};
11 | wf::option_wrapper_t rate{"input/kb_repeat_rate"};
12 |
13 | wf::wl_timer timer_delay;
14 | wf::wl_timer timer_rate;
15 |
16 | using callback_t = std::function;
17 |
18 | key_repeat_t()
19 | {}
20 | key_repeat_t(uint32_t key, callback_t handler)
21 | {
22 | set_callback(key, handler);
23 | }
24 |
25 | void set_callback(uint32_t key, callback_t handler)
26 | {
27 | disconnect();
28 | timer_delay.set_timeout(delay, [=] ()
29 | {
30 | timer_rate.set_timeout(1000 / rate, [=] ()
31 | {
32 | // handle can determine if key should be repeated
33 | return handler(key);
34 | });
35 | });
36 | }
37 |
38 | void disconnect()
39 | {
40 | timer_delay.disconnect();
41 | timer_rate.disconnect();
42 | }
43 | };
44 | }
45 |
--------------------------------------------------------------------------------
/plugins/common/wayfire/plugins/common/shared-core-data.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | namespace wf
7 | {
8 | /**
9 | * The purpose of shared is to allow multiple plugins or plugin instances to
10 | * have shared global custom data.
11 | *
12 | * While this is already possible if the shared data is stored as custom data on
13 | * `wf::get_core()`, the classes here provide convenient wrappers for managing
14 | * the lifetime of the shared data by utilizing RAII.
15 | */
16 | namespace shared_data
17 | {
18 | namespace detail
19 | {
20 | /** Implementation detail: the actual data stored in core. */
21 | template
22 | class shared_data_t : public wf::custom_data_t
23 | {
24 | public:
25 | T data;
26 | int32_t use_count = 0;
27 | };
28 | }
29 |
30 | /**
31 | * A pointer to shared data which holds a reference to it (similar to
32 | * std::shared_ptr). Once the last reference is destroyed, data will be freed
33 | * from core.
34 | */
35 | template
36 | class ref_ptr_t
37 | {
38 | public:
39 | ref_ptr_t()
40 | {
41 | update_use_count(+1);
42 | this->data = &wf::get_core().get_data_safe>()->data;
43 | }
44 |
45 | ref_ptr_t(const ref_ptr_t& other)
46 | {
47 | this->data = other.data;
48 | update_use_count(+1);
49 | }
50 |
51 | ref_ptr_t& operator =(const ref_ptr_t& other)
52 | {
53 | this->data = other.data;
54 | update_use_count(+1);
55 | }
56 |
57 | ref_ptr_t(ref_ptr_t&& other) = default;
58 | ref_ptr_t& operator =(ref_ptr_t&& other) = default;
59 |
60 | ~ref_ptr_t()
61 | {
62 | update_use_count(-1);
63 | }
64 |
65 | T *get()
66 | {
67 | return data;
68 | }
69 |
70 | T*operator ->()
71 | {
72 | return data;
73 | }
74 |
75 | private:
76 | // Update the use count, and delete data if necessary.
77 | void update_use_count(int32_t delta)
78 | {
79 | auto instance = wf::get_core().get_data_safe>();
80 | instance->use_count += delta;
81 | if (instance->use_count <= 0)
82 | {
83 | wf::get_core().erase_data>();
84 | }
85 | }
86 |
87 | // Pointer to the global data
88 | T *data;
89 | };
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/plugins/common/wayfire/plugins/common/simple-text-node.hpp:
--------------------------------------------------------------------------------
1 | #include "wayfire/opengl.hpp"
2 | #include "wayfire/output.hpp"
3 | #include "wayfire/scene.hpp"
4 | #include
5 | #include
6 |
7 | class simple_text_node_t : public wf::scene::node_t
8 | {
9 | class render_instance_t : public wf::scene::simple_render_instance_t
10 | {
11 | public:
12 | using simple_render_instance_t::simple_render_instance_t;
13 |
14 | void render(const wf::render_target_t& target, const wf::region_t& region)
15 | {
16 | OpenGL::render_begin(target);
17 |
18 | auto g = self->get_bounding_box();
19 | for (auto box : region)
20 | {
21 | target.logic_scissor(wlr_box_from_pixman_box(box));
22 | OpenGL::render_texture(self->cr_text.tex.tex, target, g, glm::vec4(1.0f),
23 | OpenGL::TEXTURE_TRANSFORM_INVERT_Y);
24 | }
25 |
26 | OpenGL::render_end();
27 | }
28 | };
29 |
30 | wf::cairo_text_t cr_text;
31 |
32 | public:
33 | simple_text_node_t() : node_t(false)
34 | {}
35 |
36 | void gen_render_instances(std::vector& instances,
37 | wf::scene::damage_callback push_damage, wf::output_t *output) override
38 | {
39 | instances.push_back(std::make_unique(this, push_damage, output));
40 | }
41 |
42 | wf::geometry_t get_bounding_box() override
43 | {
44 | return wf::construct_box(position, size.value_or(cr_text.get_size()));
45 | }
46 |
47 | void set_position(wf::point_t position)
48 | {
49 | this->position = position;
50 | }
51 |
52 | void set_size(wf::dimensions_t size)
53 | {
54 | this->size = size;
55 | }
56 |
57 | void set_text_params(wf::cairo_text_t::params params)
58 | {
59 | this->params = params;
60 | }
61 |
62 | void set_text(std::string text)
63 | {
64 | wf::scene::damage_node(this->shared_from_this(), get_bounding_box());
65 | cr_text.render_text(text, params);
66 | wf::scene::damage_node(this->shared_from_this(), get_bounding_box());
67 | }
68 |
69 | private:
70 | wf::cairo_text_t::params params;
71 | std::optional size;
72 | wf::point_t position;
73 | };
74 |
--------------------------------------------------------------------------------
/plugins/common/wayfire/plugins/common/simple-texture.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 |
4 | namespace wf
5 | {
6 | struct simple_texture_t
7 | {
8 | GLuint tex = -1;
9 | int width = 0;
10 | int height = 0;
11 |
12 | /**
13 | * Destroy the GL texture.
14 | * This will call OpenGL::render_begin()/end() internally.
15 | */
16 | void release()
17 | {
18 | if (this->tex == (GLuint) - 1)
19 | {
20 | return;
21 | }
22 |
23 | OpenGL::render_begin();
24 | GL_CALL(glDeleteTextures(1, &tex));
25 | OpenGL::render_end();
26 | this->tex = -1;
27 | }
28 |
29 | simple_texture_t() = default;
30 |
31 | /** Auto-release the texture when the object is destroyed */
32 | ~simple_texture_t()
33 | {
34 | release();
35 | }
36 |
37 | simple_texture_t(const simple_texture_t &) = delete;
38 | simple_texture_t& operator =(const simple_texture_t&) = delete;
39 |
40 | simple_texture_t(simple_texture_t && o) noexcept : tex(o.tex), width(o.width),
41 | height(o.height)
42 | {
43 | o.tex = (GLuint) - 1;
44 | }
45 |
46 | simple_texture_t& operator =(simple_texture_t&& o) noexcept
47 | {
48 | if (&o == this)
49 | {
50 | return *this;
51 | }
52 |
53 | release();
54 |
55 | tex = o.tex;
56 | width = o.width;
57 | height = o.height;
58 | o.tex = (GLuint) - 1;
59 |
60 | return *this;
61 | }
62 | };
63 | }
64 |
--------------------------------------------------------------------------------
/plugins/cube/cube-background.hpp:
--------------------------------------------------------------------------------
1 | #ifndef WF_CUBE_BACKGROUND_HPP
2 | #define WF_CUBE_BACKGROUND_HPP
3 |
4 | #include
5 | #include "cube.hpp"
6 |
7 | class wf_cube_background_base
8 | {
9 | public:
10 | virtual void render_frame(const wf::render_target_t& fb,
11 | wf_cube_animation_attribs& attribs) = 0;
12 | virtual ~wf_cube_background_base() = default;
13 | };
14 |
15 | #endif /* end of include guard: WF_CUBE_BACKGROUND_HPP */
16 |
--------------------------------------------------------------------------------
/plugins/cube/cube-control-signal.hpp:
--------------------------------------------------------------------------------
1 | #ifndef CUBE_CONTROL_SIGNAL
2 | #define CUBE_CONTROL_SIGNAL
3 |
4 | #include
5 |
6 | /* A private signal, currently shared by idle & cube
7 | *
8 | * It is used to rotate the cube from the idle plugin as a screensaver.
9 | */
10 |
11 | /* Rotate cube to given angle and zoom level */
12 | struct cube_control_signal
13 | {
14 | double angle; // cube rotation in radians
15 | double zoom; // 1.0 means 100%; increase value to zoom
16 | double ease; // for cube deformation; range 0.0-1.0
17 | bool last_frame; // ends cube animation if true
18 | bool carried_out; // false if cube is disabled
19 | };
20 |
21 | #endif /* end of include guard: CUBE_CONTROL_SIGNAL */
22 |
--------------------------------------------------------------------------------
/plugins/cube/cube.hpp:
--------------------------------------------------------------------------------
1 | #ifndef WF_CUBE_HPP
2 | #define WF_CUBE_HPP
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | #define TEX_ERROR_FLAG_COLOR 0, 1, 0, 1
11 |
12 | using namespace wf::animation;
13 |
14 | class cube_animation_t : public duration_t
15 | {
16 | public:
17 | using duration_t::duration_t;
18 | timed_transition_t offset_y{*this};
19 | timed_transition_t offset_z{*this};
20 | timed_transition_t rotation{*this};
21 | timed_transition_t zoom{*this};
22 | timed_transition_t ease_deformation{*this};
23 | };
24 |
25 | struct wf_cube_animation_attribs
26 | {
27 | wf::option_wrapper_t animation_duration{"cube/initial_animation"};
28 | cube_animation_t cube_animation{animation_duration};
29 |
30 | glm::mat4 projection, view;
31 | float side_angle;
32 |
33 | bool in_exit;
34 | };
35 |
36 | #endif /* end of include guard: WF_CUBE_HPP */
37 |
--------------------------------------------------------------------------------
/plugins/cube/cubemap-shaders.tpp:
--------------------------------------------------------------------------------
1 | static const char* cubemap_vertex =
2 | R"(#version 100
3 |
4 | attribute mediump vec3 position;
5 | varying highp vec3 direction;
6 |
7 | uniform mat4 cubeMapMatrix;
8 |
9 | void main()
10 | {
11 | gl_Position = cubeMapMatrix * vec4(position, 1.0);
12 | direction = position;
13 | })";
14 |
15 | static const char* cubemap_fragment =
16 | R"(#version 100
17 | varying highp vec3 direction;
18 | uniform samplerCube smp;
19 |
20 | void main()
21 | {
22 | gl_FragColor = vec4(textureCube(smp, direction).xyz, 1);
23 | })";
24 |
--------------------------------------------------------------------------------
/plugins/cube/cubemap.hpp:
--------------------------------------------------------------------------------
1 | #ifndef WF_CUBE_CUBEMAP_HPP
2 | #define WF_CUBE_CUBEMAP_HPP
3 |
4 | #include "cube-background.hpp"
5 |
6 | class wf_cube_background_cubemap : public wf_cube_background_base
7 | {
8 | public:
9 | wf_cube_background_cubemap();
10 | virtual void render_frame(const wf::render_target_t& fb,
11 | wf_cube_animation_attribs& attribs) override;
12 |
13 | ~wf_cube_background_cubemap();
14 |
15 | private:
16 | void reload_texture();
17 | void create_program();
18 |
19 | OpenGL::program_t program;
20 | GLuint tex = -1;
21 | GLuint vbo_cube_vertices;
22 | GLuint ibo_cube_indices;
23 |
24 | std::string last_background_image;
25 | wf::option_wrapper_t background_image{"cube/cubemap_image"};
26 | };
27 |
28 | #endif /* end of include guard: WF_CUBE_CUBEMAP_HPP */
29 |
--------------------------------------------------------------------------------
/plugins/cube/meson.build:
--------------------------------------------------------------------------------
1 | animiate = shared_module('cube',
2 | ['cube.cpp', 'cubemap.cpp', 'skydome.cpp', 'simple-background.cpp'],
3 | include_directories: [wayfire_api_inc, wayfire_conf_inc, plugins_common_inc, ipc_include_dirs],
4 | dependencies: [wlroots, pixman, wfconfig, json, plugin_pch_dep],
5 | install: true,
6 | install_dir: join_paths(get_option('libdir'), 'wayfire'))
7 |
--------------------------------------------------------------------------------
/plugins/cube/shaders.tpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | static const char* cube_vertex_2_0 =
4 | R"(#version 100
5 | attribute mediump vec3 position;
6 | attribute highp vec2 uvPosition;
7 |
8 | varying highp vec2 uvpos;
9 |
10 | uniform mat4 VP;
11 | uniform mat4 model;
12 |
13 | void main() {
14 | gl_Position = VP * model * vec4(position, 1.0);
15 | uvpos = uvPosition;
16 | })";
17 |
18 | static const char* cube_fragment_2_0 =
19 | R"(#version 100
20 | varying highp vec2 uvpos;
21 | uniform sampler2D smp;
22 |
23 | void main() {
24 | gl_FragColor = vec4(texture2D(smp, uvpos).xyz, 1);
25 | })";
26 |
--------------------------------------------------------------------------------
/plugins/cube/simple-background.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include "simple-background.hpp"
3 |
4 | wf_cube_simple_background::wf_cube_simple_background()
5 | {}
6 |
7 | void wf_cube_simple_background::render_frame(const wf::render_target_t& fb,
8 | wf_cube_animation_attribs&)
9 | {
10 | OpenGL::render_begin(fb);
11 | OpenGL::clear(background_color, GL_COLOR_BUFFER_BIT);
12 | OpenGL::render_end();
13 | }
14 |
--------------------------------------------------------------------------------
/plugins/cube/simple-background.hpp:
--------------------------------------------------------------------------------
1 | #ifndef WF_CUBE_SIMPLE_BACKGROUND_HPP
2 | #define WF_CUBE_SIMPLE_BACKGROUND_HPP
3 |
4 | #include "cube-background.hpp"
5 |
6 | class wf_cube_simple_background : public wf_cube_background_base
7 | {
8 | wf::option_wrapper_t background_color{"cube/background"};
9 |
10 | public:
11 | wf_cube_simple_background();
12 | virtual void render_frame(const wf::render_target_t& fb,
13 | wf_cube_animation_attribs& attribs) override;
14 | };
15 |
16 | #endif /* end of include guard: WF_CUBE_SIMPLE_BACKGROUND_HPP */
17 |
--------------------------------------------------------------------------------
/plugins/cube/skydome.hpp:
--------------------------------------------------------------------------------
1 | #ifndef WF_CUBE_BACKGROUND_SKYDOME
2 | #define WF_CUBE_BACKGROUND_SKYDOME
3 |
4 | #include "cube-background.hpp"
5 | #include "wayfire/output.hpp"
6 | #include
7 |
8 | class wf_cube_background_skydome : public wf_cube_background_base
9 | {
10 | public:
11 | wf_cube_background_skydome(wf::output_t *output);
12 | virtual void render_frame(const wf::render_target_t& fb,
13 | wf_cube_animation_attribs& attribs) override;
14 |
15 | virtual ~wf_cube_background_skydome();
16 |
17 | private:
18 | wf::output_t *output;
19 |
20 | void load_program();
21 | void fill_vertices();
22 | void reload_texture();
23 |
24 | OpenGL::program_t program;
25 | GLuint tex = -1;
26 |
27 | std::vector vertices;
28 | std::vector coords;
29 | std::vector indices;
30 |
31 | std::string last_background_image;
32 | int last_mirror = -1;
33 | wf::option_wrapper_t background_image{"cube/skydome_texture"};
34 | wf::option_wrapper_t mirror_opt{"cube/skydome_mirror"};
35 | };
36 |
37 | #endif /* end of include guard: WF_CUBE_BACKGROUND_SKYDOME */
38 |
--------------------------------------------------------------------------------
/plugins/decor/deco-subsurface.hpp:
--------------------------------------------------------------------------------
1 | #ifndef DECO_SUBSURFACE_HPP
2 | #define DECO_SUBSURFACE_HPP
3 |
4 | #include "wayfire/object.hpp"
5 | #include "wayfire/toplevel.hpp"
6 | #include
7 | #include
8 |
9 | class simple_decoration_node_t;
10 | namespace wf
11 | {
12 | /**
13 | * A decorator object attached as custom data to a toplevel object.
14 | */
15 | class simple_decorator_t : public wf::custom_data_t
16 | {
17 | wayfire_toplevel_view view;
18 | std::shared_ptr deco;
19 |
20 | wf::signal::connection_t on_view_activated;
21 | wf::signal::connection_t on_view_geometry_changed;
22 | wf::signal::connection_t on_view_fullscreen;
23 |
24 | public:
25 | simple_decorator_t(wayfire_toplevel_view view);
26 | ~simple_decorator_t();
27 | wf::decoration_margins_t get_margins(const wf::toplevel_state_t& state);
28 | };
29 | }
30 |
31 | #endif /* end of include guard: DECO_SUBSURFACE_HPP */
32 |
--------------------------------------------------------------------------------
/plugins/decor/deco-theme.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include "deco-button.hpp"
4 |
5 | namespace wf
6 | {
7 | namespace decor
8 | {
9 | /**
10 | * A class which manages the outlook of decorations.
11 | * It is responsible for determining the background colors, sizes, etc.
12 | */
13 | class decoration_theme_t
14 | {
15 | public:
16 | /** Create a new theme with the default parameters */
17 | decoration_theme_t();
18 |
19 | /** @return The available height for displaying the title */
20 | int get_title_height() const;
21 | /** @return The available border for resizing */
22 | int get_border_size() const;
23 | /** Set the flags for buttons */
24 | void set_buttons(button_type_t flags);
25 | button_type_t button_flags;
26 |
27 | /**
28 | * Fill the given rectangle with the background color(s).
29 | *
30 | * @param fb The target framebuffer, must have been bound already.
31 | * @param rectangle The rectangle to redraw.
32 | * @param scissor The GL scissor rectangle to use.
33 | * @param active Whether to use active or inactive colors
34 | */
35 | void render_background(const wf::render_target_t& fb, wf::geometry_t rectangle,
36 | const wf::geometry_t& scissor, bool active) const;
37 |
38 | /**
39 | * Render the given text on a cairo_surface_t with the given size.
40 | * The caller is responsible for freeing the memory afterwards.
41 | */
42 | cairo_surface_t *render_text(std::string text, int width, int height) const;
43 |
44 | struct button_state_t
45 | {
46 | /** Button width */
47 | double width;
48 | /** Button height */
49 | double height;
50 | /** Button outline size */
51 | double border;
52 | /** Progress of button hover, in range [-1, 1].
53 | * Negative numbers are usually used for pressed state. */
54 | double hover_progress;
55 | };
56 |
57 | /**
58 | * Get the icon for the given button.
59 | * The caller is responsible for freeing the memory afterwards.
60 | *
61 | * @param button The button type.
62 | * @param state The button state.
63 | */
64 | cairo_surface_t *get_button_surface(button_type_t button,
65 | const button_state_t& state) const;
66 |
67 | private:
68 | wf::option_wrapper_t font{"decoration/font"};
69 | wf::option_wrapper_t title_height{"decoration/title_height"};
70 | wf::option_wrapper_t border_size{"decoration/border_size"};
71 | wf::option_wrapper_t active_color{"decoration/active_color"};
72 | wf::option_wrapper_t inactive_color{"decoration/inactive_color"};
73 | };
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/plugins/decor/meson.build:
--------------------------------------------------------------------------------
1 | decoration = shared_module('decoration',
2 | ['decoration.cpp', 'deco-subsurface.cpp', 'deco-button.cpp',
3 | 'deco-layout.cpp', 'deco-theme.cpp'],
4 | include_directories: [wayfire_api_inc, wayfire_conf_inc, plugins_common_inc],
5 | dependencies: [wlroots, pixman, wf_protos, wfconfig, cairo, pango, pangocairo, plugin_pch_dep],
6 | install: true,
7 | install_dir: join_paths(get_option('libdir'), 'wayfire'))
8 |
--------------------------------------------------------------------------------
/plugins/grid/meson.build:
--------------------------------------------------------------------------------
1 | grid_inc = include_directories('.')
2 | all_include_dirs = [wayfire_api_inc, wayfire_conf_inc, plugins_common_inc, wobbly_inc, grid_inc, ipc_include_dirs]
3 | all_deps = [wlroots, pixman, wfconfig, wftouch, cairo, json, plugin_pch_dep]
4 |
5 | shared_module('grid', ['grid.cpp'],
6 | include_directories: all_include_dirs,
7 | dependencies: all_deps,
8 | install: true,
9 | install_dir: conf_data.get('PLUGIN_PATH'))
10 |
11 | install_subdir('wayfire', install_dir: get_option('includedir'))
12 |
--------------------------------------------------------------------------------
/plugins/grid/wayfire/plugins/grid.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | namespace wf
8 | {
9 | namespace grid
10 | {
11 | /**
12 | * name: request
13 | * on: core
14 | * when: Emitted before move renders a grid indicator and sets the slot.
15 | * carried_out: true if a plugin can handle move request to grid.
16 | */
17 | struct grid_request_signal
18 | {
19 | /* True if a plugin handled this signal */
20 | bool carried_out = false;
21 | };
22 |
23 | /**
24 | * The slot where a view can be placed with grid.
25 | * BL = bottom-left, TR = top-right, etc.
26 | */
27 | enum slot_t
28 | {
29 | SLOT_NONE = 0,
30 | SLOT_BL = 1,
31 | SLOT_BOTTOM = 2,
32 | SLOT_BR = 3,
33 | SLOT_LEFT = 4,
34 | SLOT_CENTER = 5,
35 | SLOT_RIGHT = 6,
36 | SLOT_TL = 7,
37 | SLOT_TOP = 8,
38 | SLOT_TR = 9,
39 | };
40 |
41 | /*
42 | * 7 8 9
43 | * 4 5 6
44 | * 1 2 3
45 | */
46 | inline uint32_t get_tiled_edges_for_slot(uint32_t slot)
47 | {
48 | if (slot == 0)
49 | {
50 | return 0;
51 | }
52 |
53 | uint32_t edges = wf::TILED_EDGES_ALL;
54 | if (slot % 3 == 0)
55 | {
56 | edges &= ~WLR_EDGE_LEFT;
57 | }
58 |
59 | if (slot % 3 == 1)
60 | {
61 | edges &= ~WLR_EDGE_RIGHT;
62 | }
63 |
64 | if (slot <= 3)
65 | {
66 | edges &= ~WLR_EDGE_TOP;
67 | }
68 |
69 | if (slot >= 7)
70 | {
71 | edges &= ~WLR_EDGE_BOTTOM;
72 | }
73 |
74 | return edges;
75 | }
76 |
77 | inline uint32_t get_slot_from_tiled_edges(uint32_t edges)
78 | {
79 | for (int slot = 0; slot <= 9; slot++)
80 | {
81 | if (get_tiled_edges_for_slot(slot) == edges)
82 | {
83 | return slot;
84 | }
85 | }
86 |
87 | return 0;
88 | }
89 |
90 | /*
91 | * 7 8 9
92 | * 4 5 6
93 | * 1 2 3
94 | * */
95 | inline wf::geometry_t get_slot_dimensions(wf::output_t *output, int n)
96 | {
97 | auto area = output->workarea->get_workarea();
98 | int w2 = area.width / 2;
99 | int h2 = area.height / 2;
100 |
101 | if (n % 3 == 1)
102 | {
103 | area.width = w2;
104 | }
105 |
106 | if (n % 3 == 0)
107 | {
108 | area.width = w2, area.x += w2;
109 | }
110 |
111 | if (n >= 7)
112 | {
113 | area.height = h2;
114 | } else if (n <= 3)
115 | {
116 | area.height = h2, area.y += h2;
117 | }
118 |
119 | return area;
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/plugins/ipc-rules/meson.build:
--------------------------------------------------------------------------------
1 | all_include_dirs = [wayfire_api_inc, wayfire_conf_inc, plugins_common_inc, ipc_include_dirs]
2 | all_deps = [wlroots, pixman, wfconfig, wftouch, json, plugin_pch_dep]
3 |
4 | shared_module('ipc-rules', ['ipc-rules.cpp'],
5 | include_directories: all_include_dirs,
6 | dependencies: all_deps,
7 | install: true,
8 | install_dir: conf_data.get('PLUGIN_PATH'))
9 |
10 | install_headers(['ipc-rules-common.hpp'], subdir: 'wayfire/plugins/ipc')
11 |
--------------------------------------------------------------------------------
/plugins/ipc/ipc.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include "wayfire/plugins/ipc/ipc-method-repository.hpp"
8 |
9 | namespace wf
10 | {
11 | namespace ipc
12 | {
13 | /**
14 | * Represents a single connected client to the IPC socket.
15 | */
16 | class server_t;
17 | class client_t : public client_interface_t
18 | {
19 | public:
20 | client_t(server_t *server, int client_fd);
21 | ~client_t();
22 | bool send_json(wf::json_t json) override;
23 |
24 | private:
25 | int fd;
26 | wl_event_source *source;
27 | server_t *ipc;
28 |
29 | int current_buffer_valid = 0;
30 | std::vector buffer;
31 | int read_up_to(int n, int *available);
32 |
33 | /** Handle incoming data on the socket */
34 | std::function handle_fd_activity;
35 | void handle_fd_incoming(uint32_t);
36 | };
37 |
38 | /**
39 | * The IPC server is a singleton object accessed via shared_data::ref_ptr_t.
40 | * It represents the IPC socket used for communication with clients.
41 | */
42 | class server_t
43 | {
44 | public:
45 | server_t();
46 | void init(std::string socket_path);
47 | ~server_t();
48 |
49 | private:
50 | friend class client_t;
51 | wf::shared_data::ref_ptr_t method_repository;
52 |
53 | void handle_incoming_message(client_t *client, wf::json_t message);
54 |
55 | void client_disappeared(client_t *client);
56 |
57 | int fd = -1;
58 |
59 | /**
60 | * Setup a socket at the given address, and set it as CLOEXEC and non-blocking.
61 | */
62 | int setup_socket(const char *address);
63 | sockaddr_un saddr;
64 | wl_event_source *source;
65 | std::vector> clients;
66 |
67 | std::function accept_new_client;
68 | void do_accept_new_client();
69 | };
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/plugins/ipc/meson.build:
--------------------------------------------------------------------------------
1 | evdev = dependency('libevdev')
2 |
3 | ipc_include_dirs = include_directories('.', 'wayfire/plugins/ipc')
4 |
5 | ipc = shared_module('ipc',
6 | ['ipc.cpp'],
7 | include_directories: [wayfire_api_inc, wayfire_conf_inc, plugins_common_inc],
8 | dependencies: [wlroots, pixman, wfconfig, wftouch, json, evdev, plugin_pch_dep],
9 | install: true,
10 | install_dir: conf_data.get('PLUGIN_PATH'))
11 |
12 | stipc = shared_module('stipc',
13 | ['stipc.cpp'],
14 | include_directories: [wayfire_api_inc, wayfire_conf_inc, plugins_common_inc],
15 | dependencies: [wlroots, pixman, wfconfig, wftouch, json, evdev, plugin_pch_dep],
16 | install: true,
17 | install_dir: conf_data.get('PLUGIN_PATH'))
18 |
19 | install_headers(['wayfire/plugins/ipc/ipc-method-repository.hpp', 'wayfire/plugins/ipc/ipc-helpers.hpp', 'wayfire/plugins/ipc/ipc-activator.hpp'], subdir: 'wayfire/plugins/ipc')
20 |
--------------------------------------------------------------------------------
/plugins/meson.build:
--------------------------------------------------------------------------------
1 | if get_option('custom_pch')
2 | # Add a workaround for https://github.com/mesonbuild/meson/issues/4350
3 | # We create a PCH ourselves and manage it for all plugins.
4 | pch_file = meson.current_source_dir() / 'pch/plugin_pch.hpp'
5 | custom_pch_flags = ['@INPUT@', '-c', '-o', '@OUTPUT@', '-MD', '-MF', '@DEPFILE@',
6 | '-std=' + get_option('cpp_std'), '-pthread', '-fPIC'] + get_option('cpp_args')
7 |
8 | # Meson enables this unconditionally on everything not-macos and non-msvc
9 | custom_pch_flags += ['-D_FILE_OFFSET_BITS=64']
10 |
11 | # Gather flags from the compiler ...
12 | if get_option('b_ndebug') == 'false' or (get_option('b_ndebug') == 'if-release' and
13 | get_option('buildtype') != 'release')
14 | custom_pch_flags += ['-D_GLIBCXX_ASSERTIONS=1']
15 | else
16 | custom_pch_flags += ['-DNDEBUG']
17 | endif
18 |
19 | custom_pch_flags += ['-O' + get_option('optimization')]
20 | if get_option('debug')
21 | custom_pch_flags += ['-g']
22 | endif
23 |
24 | if has_asan
25 | custom_pch_flags += ['-fsanitize=address']
26 | endif
27 |
28 | pch = custom_target('plugin_pch',
29 | input: pch_file,
30 | output: 'plugin_pch.hpp.gch',
31 | depfile: 'plugin_pch.hpp.d',
32 | command: cpp.cmd_array() + custom_pch_flags)
33 |
34 | fs = import('fs')
35 | if cpp.get_id() == 'clang'
36 | # In clang, everything is simple, we just tell the compiler which PCH file to use
37 | plugin_pch_arg = ['-include-pch', pch.full_path(), '-pthread']
38 | elif cpp.get_id() == 'gcc'
39 | # GCC requires that the .gch and the .hpp file are in the same dir.
40 | fs.copyfile(pch_file) # copy to build dir where .gch is found
41 | plugin_pch_arg = ['-I' + fs.parent(pch.full_path()), '-include', fs.name(pch_file), '-pthread', '-fpch-preprocess']
42 | else
43 | error('Unsupported compiler for custom pch: ' + cpp.get_id())
44 | endif
45 |
46 | plugin_pch_dep = declare_dependency(sources: pch, compile_args: plugin_pch_arg)
47 | else
48 | plugin_pch_args = []
49 | plugin_pch_dep = declare_dependency()
50 | endif
51 |
52 | wobbly_inc = include_directories('wobbly/')
53 | subdir('common')
54 |
55 | subdir('ipc')
56 | subdir('protocols')
57 | subdir('vswitch')
58 | subdir('wobbly')
59 | subdir('grid')
60 | subdir('decor')
61 | subdir('animate')
62 | subdir('cube')
63 | subdir('window-rules')
64 | subdir('blur')
65 | subdir('tile')
66 | subdir('wm-actions')
67 | subdir('scale')
68 | subdir('single_plugins')
69 | subdir('ipc-rules')
70 |
--------------------------------------------------------------------------------
/plugins/pch/plugin_pch.hpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include