Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit 5610334

Browse files
committed
bugfix: remove useless gesture
1 parent f6ef133 commit 5610334

File tree

2 files changed

+18
-22
lines changed

2 files changed

+18
-22
lines changed

HUDMainApplication.mm

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@
1414
#import <UIKit/UIKit.h>
1515
#import "HUDPresetPosition.h"
1616

17+
#define SPAWN_AS_ROOT 0
1718

18-
extern "C" char **environ;
1919

20-
// #define POSIX_SPAWN_PERSONA_FLAGS_OVERRIDE 1
21-
// extern "C" int posix_spawnattr_set_persona_np(const posix_spawnattr_t* __restrict, uid_t, uint32_t);
22-
// extern "C" int posix_spawnattr_set_persona_uid_np(const posix_spawnattr_t* __restrict, uid_t);
23-
// extern "C" int posix_spawnattr_set_persona_gid_np(const posix_spawnattr_t* __restrict, uid_t);
20+
extern "C" char **environ;
2421

22+
#if SPAWN_AS_ROOT
23+
#define POSIX_SPAWN_PERSONA_FLAGS_OVERRIDE 1
24+
extern "C" int posix_spawnattr_set_persona_np(const posix_spawnattr_t* __restrict, uid_t, uint32_t);
25+
extern "C" int posix_spawnattr_set_persona_uid_np(const posix_spawnattr_t* __restrict, uid_t);
26+
extern "C" int posix_spawnattr_set_persona_gid_np(const posix_spawnattr_t* __restrict, uid_t);
27+
#endif
2528

2629
OBJC_EXTERN BOOL IsHUDEnabled(void);
2730
BOOL IsHUDEnabled(void)
@@ -35,9 +38,11 @@ BOOL IsHUDEnabled(void)
3538
posix_spawnattr_t attr;
3639
posix_spawnattr_init(&attr);
3740

38-
// posix_spawnattr_set_persona_np(&attr, 99, POSIX_SPAWN_PERSONA_FLAGS_OVERRIDE);
39-
// posix_spawnattr_set_persona_uid_np(&attr, 0);
40-
// posix_spawnattr_set_persona_gid_np(&attr, 0);
41+
#if SPAWN_AS_ROOT
42+
posix_spawnattr_set_persona_np(&attr, 99, POSIX_SPAWN_PERSONA_FLAGS_OVERRIDE);
43+
posix_spawnattr_set_persona_uid_np(&attr, 0);
44+
posix_spawnattr_set_persona_gid_np(&attr, 0);
45+
#endif
4146

4247
pid_t task_pid;
4348
const char *args[] = { executablePath, "-check", NULL };
@@ -77,9 +82,11 @@ void SetHUDEnabled(BOOL isEnabled)
7782
posix_spawnattr_t attr;
7883
posix_spawnattr_init(&attr);
7984

80-
// posix_spawnattr_set_persona_np(&attr, 99, POSIX_SPAWN_PERSONA_FLAGS_OVERRIDE);
81-
// posix_spawnattr_set_persona_uid_np(&attr, 0);
82-
// posix_spawnattr_set_persona_gid_np(&attr, 0);
85+
#if SPAWN_AS_ROOT
86+
posix_spawnattr_set_persona_np(&attr, 99, POSIX_SPAWN_PERSONA_FLAGS_OVERRIDE);
87+
posix_spawnattr_set_persona_uid_np(&attr, 0);
88+
posix_spawnattr_set_persona_gid_np(&attr, 0);
89+
#endif
8390

8491
if (isEnabled)
8592
{

MainApplication.mm

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,6 @@ - (void)loadView
106106
self.backgroundView.backgroundColor = [UIColor colorWithRed:26.0f/255.0f green:188.0f/255.0f blue:156.0f/255.0f alpha:1.0f]; // rgba(26, 188, 156, 1.0)
107107
[self.view addSubview:self.backgroundView];
108108

109-
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapView:)];
110-
tapGesture.numberOfTapsRequired = 1;
111-
tapGesture.numberOfTouchesRequired = 1;
112-
[self.backgroundView addGestureRecognizer:tapGesture];
113-
[self.backgroundView setUserInteractionEnabled:YES];
114-
115109
BOOL isPad = ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad);
116110

117111
_topLeftButton = [UIButton buttonWithType:UIButtonTypeSystem];
@@ -482,11 +476,6 @@ - (void)reloadModeButtonState
482476
[_topCenterButton setImage:topCenterImage forState:UIControlStateNormal];
483477
}
484478

485-
- (void)tapView:(UITapGestureRecognizer *)sender
486-
{
487-
os_log_debug(OS_LOG_DEFAULT, "- [RootViewController tapView:%{public}@]: %{public}@", sender, NSStringFromCGPoint([sender locationInView:self.backgroundView]));
488-
}
489-
490479
- (void)tapAuthorLabel:(UITapGestureRecognizer *)sender
491480
{
492481
if (_isHUDActive) {

0 commit comments

Comments
 (0)