Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
|
|
This is needed for clipping. Unfortunately, the puglEnterContext() and
puglLeaveContext() API was not suitable for this, but this shouldn't matter in
user code because it is only used for setup, and is slated for removal anyway.
Instead, just call the backend functions directly in the implementation.
|
|
This was a hack to support only exposing the rects that were explicitly exposed
with puglPostRedisplayRect(), but it caused flaky drawing issues because it
circumvented the deferral of exposure until the end of the loop. Instead,
simply expand the pending expose to be dispatched later as usual.
This means that only the union will be exposed in the end, so more area might
be drawn than necessary, but this is probably good enough. If not, we will
have to maintain a set of rects and be more clever about combining them.
|
|
|
|
In Xlib, a return value of 0 indicates an error (see "Xlib - C Language X
Interface", Ch. 1, "Errors"). XMoveResizeWindow accordingly returns 1 on
success, but the error check in puglSetFrame used the usual C convention, and
so was backwards.
|
|
This avoids resizing the backend when the window is only moved, which fixes
flicker with Cairo where resizing is expensive.
|
|
|
|
|
|
|
|
Working on Vulkan clarified what has always been slightly smelly about the
design and organization here: not everything that is API specific is really in
a "backend" (a PuglBackend). The concrete example is puglGetProcAddress(),
which only makes sense for GL and is actually implemented in the "backend"
files. Arguably puglGetContext() is also such a thing.
So, rename the headers so they can be the place where API-specific things go in
general, which happens to include a backend most of the time. The stub is a
bit of an exception to this, but whatever. The includes look tidier this way.
In place of the old headers are compatibility stubs that just emit a warning
and include the new version, which will be maintained for a while.
|
|
|
|
|
|
This is a bit ridiculous, but using a "probably big enough" value seems to be
what everyone does. This particular value is the one used by Gtk.
|
|
|
|
This ensure that visibility is properly updated when a window is made visible
or invisible by the user or window system. Unfortunately it does not seem to
propagate automatically to child windows, but this is at least better than the
previous situation, and good enough for most cases.
|
|
|
|
|
|
Towards actual fine-grained exposure. This uses the previous behaviour if
expose events intersect to reduce redundant drawing, but dispatches expose
events immediately (after flushing and pending configure events) if they don't
to support partial redraws.
|
|
|
|
|
|
|
|
|
|
|
|
Prepares the API for proper error handling, even though there isn't any for
these functions yet.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This allows waiting for events for any view in the world. It also improves on
puglWaitForEvent() by the addition of a time parameter that allows indefinite
blocking, non-blocking polling, and blocking polling with a timeout.
|
|
|
|
|
|
|
|
The old API was broken for programs that manage multiple views, since it was
impossible to wait for events on any view. There are also several functions in
the API which are not actually associated with views at all, so those can now
be moved to the more appropriate PuglWorld to make this more clear.
The old puglInit() and puglDestroy() functions are preserved for compatibility,
but marked as deprecated.
|
|
|
|
|
|
|
|
|
|
|
|
It's possible that this does bad things if a UTF8 string is used on a system
that does not support it (because XStoreName is still called), but I have no
idea how likely this scenario is.
Leaving it this way because it means the ASCII case will still work everywhere,
and it's easy enough to avoid if this is a problem.
|
|
|
|
|
|
Taking a page from C++ convention, where "detail" is for things that should not
be included in user code.
|