Android can only run c-shared libraries which means that every
Gio program must create its window and event loop from an init
function.
The same applies to iOS but for a more benign reason: the gio tool
builds programs in c-archive mode for iOS and links the binary with
a Objective-C driver.
Allow Gio programs to run off its main function by linking to and
invoking main even from Android libraries and iOS ditto.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Instead of querying the backing store scale for every pointer event,
use the scale from the last window draw. It might not make any visible
difference because we redraw on scale changes, but it is more correct.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
When moving a window to another monitor, update is called when the
opengl backing store updates its internal size.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Compute and keep constant the pixel density, to avoid window content
changes when moving to another monitor with a different density.
Use backing store scale, not content scale for input events.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
I haven't found a reliable way to re-create the context and redraw
after deminiaturization or app unhide.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
The NSOpenGLView owns the NSOpenGLContext so we can't just CFRelease
the context. Use [NSOpenGLView releaseGLContext] instead.
Signed-off-by: Elias Naur <mail@eliasnaur.com>