Skip to content

Commit

Permalink
core: remove various leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
absolutelynothelix committed Oct 18, 2024
1 parent 3a13562 commit 21497af
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 43 deletions.
23 changes: 0 additions & 23 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@

typedef struct session session_t;

/// @brief Possible backends
enum backend {
BKEND_XRENDER,
BKEND_GLX,
BKEND_DUMMY,
BKEND_EGL,
NUM_BKEND,
};

typedef struct win_option_mask {
bool shadow : 1;
bool fade : 1;
Expand Down Expand Up @@ -435,8 +426,6 @@ typedef struct options {
bool has_both_style_of_rules;
} options_t;

extern const char *const BACKEND_STRS[NUM_BKEND + 1];

bool load_plugin(const char *name, const char *include_dir);
static inline void record_problematic_option(struct options *opt, const char *name) {
struct option_name *record = calloc(1, sizeof(*record));
Expand Down Expand Up @@ -488,18 +477,6 @@ bool parse_config_libconfig(options_t *, const char *config_file);
/// same as parse_config_libconfig
bool parse_config(options_t *, const char *config_file);

/**
* Parse a backend option argument.
*/
static inline attr_pure int parse_backend(const char *str) {
for (int i = 0; BACKEND_STRS[i]; ++i) {
if (strcasecmp(str, BACKEND_STRS[i]) == 0) {
return i;
}
}
return NUM_BKEND;
}

/**
* Parse a VSync option argument.
*/
Expand Down
13 changes: 2 additions & 11 deletions src/picom.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,6 @@ const struct wintype_info WINTYPES[] = {
#undef X
};

// clang-format off
/// Names of backends.
const char *const BACKEND_STRS[] = {[BKEND_XRENDER] = "xrender",
[BKEND_GLX] = "glx",
[BKEND_DUMMY] = "dummy",
[BKEND_EGL] = "egl",
NULL};
// clang-format on

// === Global variables ===

/// Pointer to current session, as a global variable. Only used by
Expand Down Expand Up @@ -1203,8 +1194,8 @@ static bool redirect_start(session_t *ps) {

ps->frame_pacing = ps->o.frame_pacing && ps->o.vsync;
if ((ps->o.benchmark || !ps->backend_data->ops.last_render_time) && ps->frame_pacing) {
// Disable frame pacing if we are using a legacy backend or if we are in
// benchmark mode, or if the backend doesn't report render time
// Disable frame pacing if we are in benchmark mode or if the backend
// doesn't report render time.
log_info("Disabling frame pacing.");
ps->frame_pacing = false;
}
Expand Down
9 changes: 0 additions & 9 deletions src/x.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,6 @@ x_get_prop(const struct x_connection *c, xcb_window_t wid, xcb_atom_t atom, int
/// Get the type, format and size in bytes of a window's specific attribute.
winprop_info_t x_get_prop_info(const struct x_connection *c, xcb_window_t w, xcb_atom_t atom);

/// Discard all X events in queue or in flight. Should only be used when the server is
/// grabbed
static inline void x_discard_events(struct x_connection *c) {
xcb_generic_event_t *e;
while ((e = xcb_poll_for_event(c->c))) {
free(e);
}
}

/**
* Get the value of a type-<code>xcb_window_t</code> property of a window.
*
Expand Down

0 comments on commit 21497af

Please sign in to comment.