Skip to content

Commit

Permalink
Merge branch 'yshui:next' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
pijulius authored Oct 18, 2024
2 parents 66d253e + 21497af commit 71790ff
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 46 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 @@ -449,8 +440,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 @@ -502,18 +491,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
1 change: 0 additions & 1 deletion src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,6 @@ void options_destroy(struct options *options) {
struct option_name *bad_opt, *next_bad_opt;
HASH_ITER(hh, options->problematic_options, bad_opt, next_bad_opt) {
HASH_DEL(options->problematic_options, bad_opt);
free((void *)bad_opt->name);
free(bad_opt);
}
}
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 @@ -1208,8 +1199,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
11 changes: 9 additions & 2 deletions src/wm/win.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,15 @@ void win_process_image_flags(session_t *ps, struct win *w) {
// Assert that the MAPPED flag is already handled.
assert(!win_check_flags_all(w, WIN_FLAGS_MAPPED));

if (w->state != WSTATE_MAPPED) {
// Flags of invisible windows are processed when they are mapped
if (w->state != WSTATE_MAPPED || !win_check_flags_any(w, WIN_FLAGS_PIXMAP_STALE)) {
// 1. Flags of invisible windows are processed when they are mapped
// 2. We don't need to update window image if pixmap is not stale
return;
}

if (win_check_flags_all(w, WIN_FLAGS_PIXMAP_ERROR)) {
// We have previously failed to bind the pixmap, don't try again.
win_clear_flags(w, WIN_FLAGS_PIXMAP_STALE);
return;
}

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 71790ff

Please sign in to comment.