Skip to content

Commit

Permalink
fix: lose focus if click on candidate box
Browse files Browse the repository at this point in the history
fix: caret coordinates larger than 2^31-1 should be negative
chore: update dependencies
  • Loading branch information
amorphobia committed Sep 10, 2024
1 parent 25fe857 commit 07302f5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Lib/RabbitCandidateBox.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/

global LVM_GETCOLUMNWIDTH := 0x101D
; https://learn.microsoft.com/windows/win32/winmsg/extended-window-styles
global WS_EX_NOACTIVATE := "+E0x8000000"

class CandidateBox extends Gui {
static min_width := 150
Expand All @@ -27,7 +29,7 @@ class CandidateBox extends Gui {

__New() {
super.__New(, , this)
this.Opt("-Caption +Owner AlwaysOnTop")
this.Opt("-Caption +Owner AlwaysOnTop " . WS_EX_NOACTIVATE)
this.MarginX := 3
this.MarginY := 3
this.SetFont("S12", "Microsoft YaHei UI")
Expand Down
6 changes: 6 additions & 0 deletions Lib/RabbitCaret.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,16 @@ GetCaretPos(&caret_x?, &caret_y?, &caret_w?, &caret_h?) {
if !IsSet(left) || !IsSet(top) || !IsSet(right) || !IsSet(bottom)
return GetBuiltInCaretPos(&caret_x, &caret_y, &caret_w, &caret_h)

local max_int := 2147483647
local max_uint := 4294967295
caret_x := left
caret_y := top
caret_w := right - left
caret_h := bottom - top
if caret_x > max_int
caret_x := caret_x - max_uint - 1
if caret_y > max_int
caret_y := caret_y - max_uint - 1

return true
}
Expand Down
2 changes: 1 addition & 1 deletion Lib/librime-ahk
Submodule librime-ahk updated 2 files
+155 −176 rime_api.ahk
+40 −47 rime_levers_api.ahk
2 changes: 1 addition & 1 deletion schemas/jiandao-src

0 comments on commit 07302f5

Please sign in to comment.