Skip to content

Commit

Permalink
Merge pull request yshui#1266 from yshui/plugins
Browse files Browse the repository at this point in the history
Support plugins
  • Loading branch information
yshui authored May 25, 2024
2 parents 8655f38 + bd26302 commit c282bb5
Show file tree
Hide file tree
Showing 49 changed files with 1,318 additions and 880 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@
! fullscreen
border_width = 0
```
* picom now has a rudimentary plugin system. At the moment, the only thing you can do with it is loading custom backends.

## Notable changes

* `override_redirect` in rules now only matches top-level windows that doesn't have a client window. Some window managers (e.g. awesome) set override_redirect for all window manager frame windows, causing this rule to match against everything (#625).
* Marginally improve performance when resizing/opening/closing windows. (#1190)
* Type and format specifiers are no longer used in rules. These specifiers are what you put after the colon (':') in rules, e.g. the `:32c` in `"_GTK_FRAME_EXTENTS@:32c"`. Now this information is ignored and the property is matched regardless of format or type.
* `backend` is now a required option. picom will not start if one is not specified explicitly.

## Deprecated features

Expand Down
3 changes: 3 additions & 0 deletions include/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright (c) Yuxuan Shui <yshuiv7@gmail.com>
subdirs('picom')
33 changes: 33 additions & 0 deletions include/picom/api.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) Yuxuan Shui <yshuiv7@gmail.com>

#pragma once

#include <stdbool.h>
#include <stdint.h>

#define PICOM_API_MAJOR (0UL)
#define PICOM_API_MINOR (1UL)

struct backend_base;

/// The entry point of a backend plugin. Called after the backend is initialized.
typedef void (*picom_backend_plugin_entrypoint)(struct backend_base *backend, void *user_data);
struct picom_api {
/// Add a plugin for a specific backend. The plugin's entry point will be called
/// when the specified backend is initialized.
///
/// @param backend_name The name of the backend to add the plugin to.
/// @param major The major version of the backend API interface this plugin
/// is compatible with.
/// @param minor The minor version of the backend API interface this plugin
/// is compatible with.
/// @param entrypoint The entry point of the plugin.
/// @param user_data The user data to pass to the plugin's entry point.
bool (*add_backend_plugin)(const char *backend_name, uint64_t major, uint64_t minor,
picom_backend_plugin_entrypoint entrypoint,
void *user_data);
};

const struct picom_api *
picom_api_get_interfaces(uint64_t major, uint64_t minor, const char *context);
Loading

0 comments on commit c282bb5

Please sign in to comment.