Fix up frame cadence ordering a bit.
This commit is contained in:
parent
825db84b13
commit
e36f1f6c5b
2 changed files with 38 additions and 4 deletions
27
src/main.cpp
27
src/main.cpp
|
@ -1,3 +1,5 @@
|
|||
#include <X11/Xlib.h>
|
||||
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
#include <vector>
|
||||
|
@ -17,11 +19,15 @@ struct waffle_display *dpy;
|
|||
struct waffle_window *window;
|
||||
struct waffle_context *ctx;
|
||||
|
||||
Display *XWLDpy;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
ac = argc;
|
||||
av = argv;
|
||||
|
||||
XInitThreads();
|
||||
|
||||
initOutput();
|
||||
|
||||
rootston_init(argc, argv);
|
||||
|
@ -90,6 +96,27 @@ void wayland_PushSurface(struct wlr_surface *surf, struct wlr_dmabuf_attributes
|
|||
.attribs = *attribs
|
||||
};
|
||||
g_vecResListEntries.push_back( newEntry );
|
||||
|
||||
static bool bHasNestedDisplay = false;
|
||||
|
||||
if ( bHasNestedDisplay == false )
|
||||
{
|
||||
// This should open the nested XWayland display as our environment changed during Xwayland init
|
||||
XWLDpy = XOpenDisplay( nullptr );
|
||||
|
||||
bHasNestedDisplay = true;
|
||||
}
|
||||
|
||||
static XEvent XWLExposeEvent = {
|
||||
.xexpose {
|
||||
.type = Expose,
|
||||
.window = DefaultRootWindow( XWLDpy ),
|
||||
.width = 1,
|
||||
.height = 1
|
||||
}
|
||||
};
|
||||
|
||||
XSendEvent( XWLDpy , DefaultRootWindow( XWLDpy ), True, ExposureMask, &XWLExposeEvent);
|
||||
}
|
||||
|
||||
int steamCompMgr_PullSurface( struct ResListEntry_t *pResEntry )
|
||||
|
|
|
@ -760,7 +760,15 @@ paint_all (Display *dpy)
|
|||
}
|
||||
|
||||
if ( !w )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// If the window has never been rendered to, there isn't much we can do here, wait a bit.
|
||||
if ( !w->validContents )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't pump new frames if no animation on the focus window, unless we're fading
|
||||
if (!w->damaged && !overlayDamaged && !fadeOutWindow.id)
|
||||
|
@ -1622,8 +1630,6 @@ void check_new_wayland_res(void)
|
|||
w->damaged = 1;
|
||||
w->validContents = True;
|
||||
|
||||
// TODO tickle the frame loop here somehow if we stay multi-threaded like now
|
||||
|
||||
bFound = True;
|
||||
}
|
||||
}
|
||||
|
@ -1823,7 +1829,6 @@ steamcompmgr_main (int argc, char **argv)
|
|||
focusDirty = False;
|
||||
|
||||
do {
|
||||
check_new_wayland_res();
|
||||
XNextEvent (dpy, &ev);
|
||||
if ((ev.type & 0x7f) != KeymapNotify)
|
||||
discard_ignore (dpy, ev.xany.serial);
|
||||
|
@ -2068,6 +2073,8 @@ steamcompmgr_main (int argc, char **argv)
|
|||
struct timespec now;
|
||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||
|
||||
check_new_wayland_res();
|
||||
|
||||
paint_all(dpy);
|
||||
|
||||
// If we're in the middle of a fade, pump an event into the loop to
|
||||
|
|
Loading…
Reference in a new issue