AmendHub

jcs

/

amend

/

amendments

/

76

main: Raise window when dragging, stop responding to activateEvt

Other minor cleanups made here while debugging crash issues

jcs made amendment 76 about 1 month ago
--- main.c Tue Jan 11 20:32:03 2022 +++ main.c Wed Jun 15 10:23:09 2022 @@ -97,6 +97,7 @@ main(void) if (repo) cur_browser = browser_init(repo); + did_initial_open = 1; } break; @@ -120,6 +121,7 @@ main(void) SystemClick(&event, event_win); break; case inDrag: + SelectWindow(event_win); DragWindow(event_win, event.where, &screenBits.bounds); break; case inGoAway: @@ -134,7 +136,7 @@ main(void) case inContent: if (event_win != FrontWindow()) SelectWindow(event_win); - if (event_win == cur_browser->win) + if (cur_browser && event_win == cur_browser->win) browser_mouse_down(cur_browser, &event); else if (cur_browser && cur_browser->committer && event_win == cur_browser->committer->win) @@ -143,27 +145,23 @@ main(void) } break; case updateEvt: - case activateEvt: - event_win = (WindowPtr)event.message; + if (cur_browser == NULL) + break; - if (event.what == updateEvt) { - GetPort(&old_port); - SetPort(event_win); - BeginUpdate(event_win); - } + GetPort(&old_port); - if (cur_browser) { - if (event_win == cur_browser->win) - browser_update(cur_browser, &event); - else if (cur_browser->committer && - event_win == cur_browser->committer->win) - committer_update(cur_browser->committer, &event); - } + event_win = (WindowPtr)event.message; + SetPort(event_win); + BeginUpdate(event_win); - if (event.what == updateEvt) { - EndUpdate(event_win); - SetPort(old_port); - } + if (event_win == cur_browser->win) + browser_update(cur_browser, &event); + else if (cur_browser->committer && + event_win == cur_browser->committer->win) + committer_update(cur_browser->committer, &event); + + EndUpdate(event_win); + SetPort(old_port); break; case app4Evt: if (HiWord(event.message) & (1 << 8)) {