Skip to content

Commit

Permalink
feat(application): update app
Browse files Browse the repository at this point in the history
  • Loading branch information
jtheoof committed Dec 1, 2019
1 parent a6d172a commit ce27741
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/application.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,18 @@ static void init_layer_shell(GtkApplication *app, struct swappy_state *state) {
build_ui(state);
}

static gboolean is_geometry_valid(struct swappy_state *state) {
return (state->geometry_str != NULL);
}

static gint command_line_handler(GtkApplication *app,
GApplicationCommandLine *cmdline,
struct swappy_state *state) {
if (!is_geometry_valid(state)) {
g_warning("geometry parameter is missing");
return EXIT_FAILURE;
}

g_debug("geometry is: %s", state->geometry_str);

if (!wayland_screencopy_geometry(state)) {
Expand Down
1 change: 1 addition & 0 deletions src/wayland.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ static void global_registry_handler(void *data, struct wl_registry *registry,
0) {
state->zwlr_screencopy_manager = wl_registry_bind(
registry, name, &zwlr_screencopy_manager_v1_interface, 1);
bound = true;
}

if (bound) {
Expand Down

0 comments on commit ce27741

Please sign in to comment.