mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-09 08:41:31 +00:00
[client] wayland: use nominal refresh for frame demand
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
Use the current wl_output mode for the requested producer cadence. Presentation feedback can follow a slower VRR cadence, feeding that low update rate back into the IDD. Select the fastest nominal mode when a window spans multiple outputs.
This commit is contained in:
@@ -316,8 +316,9 @@ static void outputModeHandler(void * opaque, struct wl_output * wl_output, uint3
|
||||
return;
|
||||
|
||||
struct WaylandOutput * node = opaque;
|
||||
node->modeWidth = width;
|
||||
node->modeHeight = height;
|
||||
node->modeWidth = width;
|
||||
node->modeHeight = height;
|
||||
node->modeRefresh = refresh;
|
||||
}
|
||||
|
||||
static void outputDoneHandler(void * opaque, struct wl_output * output)
|
||||
@@ -483,3 +484,27 @@ struct WaylandScale waylandOutputGetScale(struct wl_output * output)
|
||||
return node->scale;
|
||||
return waylandScaleFromInt(0);
|
||||
}
|
||||
|
||||
bool waylandOutputGetFramePeriod(uint64_t * period)
|
||||
{
|
||||
uint64_t fastest = 0;
|
||||
struct SurfaceOutput * surfaceOutput;
|
||||
wl_list_for_each(surfaceOutput, &wlWm.surfaceOutputs, link)
|
||||
{
|
||||
const struct WaylandOutput * output =
|
||||
outputFind(surfaceOutput->output);
|
||||
if (!output || output->modeRefresh <= 0)
|
||||
continue;
|
||||
|
||||
const uint64_t candidate =
|
||||
1000000000000ULL / (uint64_t)output->modeRefresh;
|
||||
if (!fastest || candidate < fastest)
|
||||
fastest = candidate;
|
||||
}
|
||||
|
||||
if (!fastest)
|
||||
return false;
|
||||
|
||||
*period = fastest;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user