dsh-gufa-code 1.2.3 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -70,11 +70,11 @@ dsh plugin add dsh-gufa-code
70
70
  ### 桌面悬浮层(实验功能,macOS arm64)
71
71
 
72
72
  - IDE 标题栏点「显示器」图标 → 屏幕上出现一个**无边框、半透明(0.55)、永远置顶**的独立悬浮窗,里面就是古法编程;
73
- - 顶部 22px 拖动条移动窗口,窗口大小/位置会记住;
73
+ - 顶部 22px 拖动条移动窗口(右键 = 悬浮层菜单),窗口大小/位置会记住;
74
74
  - 菜单栏「古法」图标:
75
75
  - **跟随 App 窗口…**:选一个正在运行的 App 窗口,悬浮层自动对齐并实时跟随它的位置/大小(需要授予「屏幕录制」权限——只读窗口尺寸,不录屏);
76
76
  - **停止跟随**:恢复自由拖动;
77
- - **切换点击穿透**:穿透后鼠标直接操作下层 App;
77
+ - **切换点击穿透**:穿透后鼠标直接操作下层 App(全局快捷键 ⌃⌥⌘G 随时切回);
78
78
  - **关闭悬浮层**。
79
79
  - 限制:目前仅 macOS arm64;跟随多显示器时按主屏坐标换算;helper 未签名(本地 ad-hoc 签名),分发前需要正式签名/notarize。
80
80
 
@@ -21,8 +21,6 @@ static const EventHotKeyID GufaToggleHotKey = {'gufa', 1};
21
21
  static OSStatus GufaHotKeyHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData);
22
22
 
23
23
  @interface GufaDragStrip : NSView
24
- @property (nonatomic, weak) id doubleClickTarget;
25
- @property (nonatomic, assign) SEL doubleClickAction;
26
24
  @end
27
25
 
28
26
  @implementation GufaDragStrip
@@ -36,7 +34,7 @@ static OSStatus GufaHotKeyHandler(EventHandlerCallRef nextHandler, EventRef even
36
34
  NSFontAttributeName: [NSFont systemFontOfSize:10 weight:NSFontWeightMedium],
37
35
  NSForegroundColorAttributeName: [NSColor colorWithCalibratedWhite:1.0 alpha:0.6],
38
36
  };
39
- NSString *label = @"古法编程 · 悬浮层(拖动移动 · 双击穿透 · 右键菜单 · ⌥⌘G 切穿透)";
37
+ NSString *label = @"古法编程 · 悬浮层(拖动移动 · 右键菜单 · ⌃⌥⌘G 切穿透)";
40
38
  NSSize size = [label sizeWithAttributes:attrs];
41
39
  NSPoint origin = NSMakePoint(floor((self.bounds.size.width - size.width) / 2.0), floor((self.bounds.size.height - size.height) / 2.0));
42
40
  [label drawAtPoint:origin withAttributes:attrs];
@@ -56,10 +54,6 @@ static OSStatus GufaHotKeyHandler(EventHandlerCallRef nextHandler, EventRef even
56
54
  }
57
55
 
58
56
  - (void)mouseDown:(NSEvent *)event {
59
- if (event.clickCount == 2 && self.doubleClickTarget != nil && self.doubleClickAction != NULL) {
60
- [NSApp sendAction:self.doubleClickAction to:self.doubleClickTarget from:self];
61
- return;
62
- }
63
57
  [self.window performWindowDragWithEvent:event];
64
58
  }
65
59
 
@@ -187,8 +181,6 @@ static OSStatus GufaHotKeyHandler(EventHandlerCallRef nextHandler, EventRef even
187
181
  GufaDragStrip *strip = [[GufaDragStrip alloc] initWithFrame:NSMakeRect(0, frame.size.height - stripHeight, frame.size.width, stripHeight)];
188
182
  strip.autoresizingMask = NSViewWidthSizable | NSViewMinYMargin;
189
183
  strip.menu = self.mainMenu;
190
- strip.doubleClickTarget = self;
191
- strip.doubleClickAction = @selector(toggleClickThrough:);
192
184
  [container addSubview:strip];
193
185
  self.dragStrip = strip;
194
186
 
@@ -207,7 +199,7 @@ static OSStatus GufaHotKeyHandler(EventHandlerCallRef nextHandler, EventRef even
207
199
  [menu addItemWithTitle:@"跟随 App 窗口…(需屏幕录制权限)" action:@selector(chooseFollowWindow:) keyEquivalent:@""].target = self;
208
200
  [menu addItemWithTitle:@"停止跟随" action:@selector(stopFollow:) keyEquivalent:@""].target = self;
209
201
  [menu addItem:[NSMenuItem separatorItem]];
210
- [menu addItemWithTitle:@"切换点击穿透(⌥⌘G)" action:@selector(toggleClickThrough:) keyEquivalent:@""].target = self;
202
+ [menu addItemWithTitle:@"切换点击穿透(⌃⌥⌘G)" action:@selector(toggleClickThrough:) keyEquivalent:@""].target = self;
211
203
  [menu addItemWithTitle:@"重置窗口位置和大小" action:@selector(resetFrame:) keyEquivalent:@""].target = self;
212
204
  [menu addItem:[NSMenuItem separatorItem]];
213
205
  [menu addItemWithTitle:@"关闭悬浮层" action:@selector(quitApp:) keyEquivalent:@""].target = self;
@@ -389,11 +381,11 @@ static OSStatus GufaHotKeyHandler(EventHandlerCallRef nextHandler, EventRef even
389
381
  [self saveFrame];
390
382
  }
391
383
 
392
- /* 全局快捷键 ⌥⌘G:穿透后窗口收不到鼠标事件,靠它切回来(Carbon 热键不需要辅助功能权限) */
384
+ /* 全局快捷键 ⌃⌥⌘G(四键,避免冲突):穿透后窗口收不到鼠标事件,靠它切回来(Carbon 热键不需要辅助功能权限) */
393
385
  - (void)registerToggleHotKey {
394
386
  EventTypeSpec spec = {kEventClassKeyboard, kEventHotKeyPressed};
395
387
  InstallApplicationEventHandler(NewEventHandlerUPP(GufaHotKeyHandler), 1, &spec, (__bridge void *)self, NULL);
396
- RegisterEventHotKey(kVK_ANSI_G, cmdKey | optionKey, GufaToggleHotKey, GetApplicationEventTarget(), 0, &_hotKeyRef);
388
+ RegisterEventHotKey(kVK_ANSI_G, controlKey | optionKey | cmdKey, GufaToggleHotKey, GetApplicationEventTarget(), 0, &_hotKeyRef);
397
389
  }
398
390
 
399
391
  - (void)toggleClickThrough:(id)sender {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-gufa-code",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "古法编程 · AI 辅助:一键把 DSH 主面板变成 VS Code 风格 IDE(Monaco 编辑器、文件树、Git、SSH、真实终端 + 右侧官方会话);主张亲手写、每个改动心中有数,AI 是助理、你是第一责任人",
5
5
  "icon": "icon.svg",
6
6
  "keywords": [