forked from speedie/spmenu
fix some x11 stuff
This commit is contained in:
parent
5ecd718daa
commit
29365cd10e
|
@ -27,9 +27,7 @@ void handle_wl(void) {
|
|||
init_disp(&state);
|
||||
|
||||
if (no_display) {
|
||||
protocol = 0;
|
||||
handle();
|
||||
return;
|
||||
die("spmenu: failed to connect to wayland display");
|
||||
}
|
||||
|
||||
create_layer(&state, "spmenu");
|
||||
|
|
|
@ -491,14 +491,21 @@ int roundtrip(struct state *state) {
|
|||
}
|
||||
}
|
||||
|
||||
int connect_display(struct state *state) {
|
||||
state->display = wl_display_connect(NULL);
|
||||
|
||||
if (state->display) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* If this function returns 1, something went wrong.
|
||||
* This may be that the user is using X11, or a compositor like Mutter.
|
||||
* In this case, it may be a good idea to fall back to X11.
|
||||
*/
|
||||
int init_disp(struct state *state) {
|
||||
state->display = wl_display_connect(NULL);
|
||||
|
||||
// Open display
|
||||
if (!state->display) {
|
||||
return 1;
|
||||
} else {
|
||||
|
|
|
@ -129,6 +129,7 @@ static void buttonpress_wl(uint32_t button, double ex, double ey);
|
|||
static int is_correct_modifier(struct state *state, char *modifier);
|
||||
static int roundtrip(struct state *state);
|
||||
static int init_disp(struct state *state);
|
||||
static int connect_display(struct state *state);
|
||||
static int init_keys(struct state *state);
|
||||
static int create_layer(struct state *state, char *name);
|
||||
static int anchor_layer(struct state *state, int position);
|
||||
|
|
Loading…
Reference in a new issue