Skip to content

Commit

Permalink
push version to 2.14.3
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixKratz committed Mar 16, 2023
1 parent 2f01d41 commit d8dcf4e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ static bool alias_update_image(struct alias* alias, bool forced) {
CGImageRef image_ref = window_capture(&alias->window);

if (!image_ref) {
window_init(&alias->window);
return false;
}

Expand Down
7 changes: 4 additions & 3 deletions src/sketchybar.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@

#define MAJOR 2
#define MINOR 14
#define PATCH 2
#define PATCH 3

extern CGError SLSRegisterNotifyProc(void* callback, uint32_t event, void* context);
extern int SLSMainConnectionID(void);
extern int RunApplicationEventLoop(void);

Expand Down Expand Up @@ -209,11 +210,11 @@ void system_events(uint32_t event, void* data, size_t data_length, void* context
}
}

extern CGError SLSRegisterNotifyProc(void* callback, uint32_t event, void* context);
int main(int argc, char **argv) {
if (argc > 1) parse_arguments(argc, argv);

if (is_root()) error("sketchybar: running as root is not allowed! abort..\n");
if (is_root())
error("sketchybar: running as root is not allowed! abort..\n");

init_misc_settings();
acquire_lockfile();
Expand Down
6 changes: 3 additions & 3 deletions src/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "bar_manager.h"

extern struct bar_manager g_bar_manager;
extern int64_t g_disable_capture;

void window_init(struct window* window) {
window->context = NULL;
Expand Down Expand Up @@ -241,19 +242,18 @@ void window_disable_shadow(struct window* window) {
CFRelease(shadow_props_cf);
}

extern int64_t g_disable_capture;
CGImageRef window_capture(struct window* window) {
if (g_disable_capture) {
int64_t time = clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW_APPROX);
if (g_disable_capture < 0) {
return NULL;
}
else if (time - g_disable_capture > (int64_t)2e9) {
} else if (time - g_disable_capture > (1ULL << 30)) {
g_disable_capture = 0;
} else {
return NULL;
}
}

CGImageRef image_ref = NULL;

uint64_t wid = window->id;
Expand Down

0 comments on commit d8dcf4e

Please sign in to comment.