94 Commits

Author SHA1 Message Date
Mitchell Hashimoto
678bd0de0c core: surface should not use app mailbox
The surface runs on the same thread as the app so if we use the app
mailbox then we risk filling the queue before it can drain. The surface
should use the app directly.

This commit just changes all the calls to use the app directly. We may
also want to coalesce certain changes to avoid too much CPU but I defer
that to a future change.
2023-09-13 08:34:09 -07:00
Mitchell Hashimoto
56ccadd7f1 core: app needsConfirmQuit to streamline quitting if no active sessions 2023-09-11 15:44:08 -07:00
Mitchell Hashimoto
6a8d302fa0 core: set focused surface pointer to null if matches on delete
We previously never set the focused pointer to null. I thought this
would be fine because a `hasSurface` check would say it doesn't exist.
But I didn't account for the fact that a deleted surface followed very
quickly by a new surface would free the pointer, then the allocation
would reuse the very same pointer, making `hasSurface` return a false
positive.

Well, technically, hasSurface is not wrong, the surface exists, but its
not really the same surface, its just a surface that happens to have the
same pointer as a previously freed surface.

Co-authored-by: Will Pragnell <wpragnell@gmail.com>
2023-08-25 21:01:12 -07:00
Mitchell Hashimoto
0af6edc25b only the app should own the font discovery instance 2023-08-13 11:51:24 -07:00
Mitchell Hashimoto
619d2ade3e only initialize font discovery mechanism once, cache on App
Fontconfig in particular appears unsafe to initialize multiple times.

Font discovery is a singleton object in an application and only ever
accessed from the main thread so we can work around this by only
initializing and caching the font discovery mechanism exactly once on
the app singleton.
2023-08-13 08:01:33 -07:00
Mitchell Hashimoto
bd7cc4b71d core: App looks up resources dir on startup 2023-08-08 09:21:52 -07:00
Mitchell Hashimoto
f31d6fb8fe apprt: clean up how apprt initializes surfaces 2023-05-31 21:08:50 -07:00
Mitchell Hashimoto
553e09eff9 apprt/embedded: new surfaces inherit last focused 2023-05-31 19:12:01 -07:00
Mitchell Hashimoto
a158813a3d app keeps track of last focused surface 2023-05-31 18:59:40 -07:00
Mitchell Hashimoto
f36a35ecc9 core: quit flag is reset after tick 2023-03-27 10:10:06 -07:00
Mitchell Hashimoto
3689f1fe39 apprt/gtk: only show exit confirmation if process is alive 2023-03-25 16:36:12 -07:00
Mitchell Hashimoto
f5c1dfa374 reload_config keybinding (defaults to ctrl+alt+super+space) 2023-03-19 09:50:53 -07:00
Mitchell Hashimoto
a9928cfb90 implement reload_config app message 2023-03-19 09:50:18 -07:00
Mitchell Hashimoto
3e1f975551 move config loading into apprt to prep for reloading 2023-03-19 09:50:17 -07:00
Mitchell Hashimoto
9b10b5d716 surface doesn't store a pointer to Config anymore 2023-03-19 09:49:44 -07:00
Mitchell Hashimoto
7a0411d65a apprt: move newTab to a surface callback rather than app 2023-02-25 10:38:19 -08:00
Mitchell Hashimoto
6acf67ec66 gtk: render! 2023-02-24 07:58:30 -08:00
Mitchell Hashimoto
7f34afa395 gtk: hook up GL area and render a color 2023-02-24 07:58:30 -08:00
Mitchell Hashimoto
fb13838532 apprt newWindow/newTab do not have to return a surface 2023-02-24 07:58:30 -08:00
Mitchell Hashimoto
2adb0c9234 apprt: C API for embedded updated to new style 2023-02-24 07:58:29 -08:00
Mitchell Hashimoto
705d56d18e surface no longer has reference to app 2023-02-24 07:58:29 -08:00
Mitchell Hashimoto
ac772c2d2d inherit font size works again 2023-02-24 07:58:29 -08:00
Mitchell Hashimoto
8c18e1ee48 remove memory pool usage for mac 2023-02-24 07:58:29 -08:00
Mitchell Hashimoto
053748481a more crap 2023-02-24 07:58:29 -08:00
Mitchell Hashimoto
9e4560043a fix crashes on close 2023-02-24 07:58:29 -08:00
Mitchell Hashimoto
fbe35c226b Integrating new surface 2023-02-24 07:58:29 -08:00
Mitchell Hashimoto
3d8c62c41f apprt refactor in progress, launches glfw no window 2023-02-24 07:58:29 -08:00
Mitchell Hashimoto
f268f3955e init gtk app 2023-02-24 07:58:29 -08:00
Mitchell Hashimoto
dff45003e1 macos: hook up clipboards 2023-02-19 15:18:01 -08:00
Mitchell Hashimoto
8889dd7de2 macos: emoji keyboard works 2023-02-19 12:28:17 -08:00
Mitchell Hashimoto
f1ebc6953e macos: mouse scroll events 2023-02-19 10:44:57 -08:00
Mitchell Hashimoto
1659f52175 macos: mouse button and mouse move events 2023-02-19 10:44:57 -08:00
Mitchell Hashimoto
e92d90b8d5 macos: new tab implementation 2023-02-19 10:44:57 -08:00
Mitchell Hashimoto
6b450f7c7d macos: track surface focus state 2023-02-19 10:44:57 -08:00
Mitchell Hashimoto
7a368da099 macos: hook up text input 2023-02-19 10:44:56 -08:00
Mitchell Hashimoto
4b44b2bc95 c: fix enums for input 2023-02-19 10:44:56 -08:00
Mitchell Hashimoto
573b163636 start input, its broken but we're getting there 2023-02-19 10:44:56 -08:00
Mitchell Hashimoto
074664398a macos: correct scale factor propagated 2023-02-19 10:44:56 -08:00
Mitchell Hashimoto
cd77408efc it draws! 2023-02-19 10:44:56 -08:00
Mitchell Hashimoto
ff9af8a07b lots of progress running a surface but still crashes 2023-02-19 10:44:56 -08:00
Mitchell Hashimoto
55b05b22bb c: create/destroy surface API 2023-02-19 10:44:55 -08:00
Mitchell Hashimoto
c68f8082df apprt: can pass options through to Windows 2023-02-19 10:44:55 -08:00
Mitchell Hashimoto
085d462a68 lots of stubbing so window will kind of compile for embedded 2023-02-19 10:44:55 -08:00
Mitchell Hashimoto
eed6979868 apprt: start embedded implement, make App API available to C 2023-02-19 10:44:55 -08:00
Mitchell Hashimoto
ba8f142770 app: only create first window in exe mode 2023-02-19 10:44:55 -08:00
Mitchell Hashimoto
f30d80cabe build: must set run condition to always now 2023-02-19 10:44:55 -08:00
Mitchell Hashimoto
9bd527fe00 macos: config API 2023-02-19 10:44:54 -08:00
Mitchell Hashimoto
8b80e65928 lots of broken stuff 2023-02-19 10:44:54 -08:00
Mitchell Hashimoto
ce490e21ea can specify a wasm target in build 2022-12-31 08:53:11 -08:00
Mitchell Hashimoto
58218af2b5 app: make apprt agnostic 2022-12-30 15:56:42 -08:00