Bug #1817
opengtk4 client uses 100% cpu all the time
0%
Description
An arch linux upgrade gave me the gtk4 client. (freeciv 3.2.1-4) Unlike the gtk3.22 client in the previous version, the cpu is stuck on 100% when a game is up, even if nothing is happening. So the machine runs hot and fans start up. No problem before I load & start a game. (No cpu usage while looking at the "load a game" or "select player" screens) Once the game is running, the cpu is running too, even if the terrain is hidden by looking at messages instead. Leaving the game stops the cpu usage.
Freeciv is turn-based, so there is no need to redraw continuously. Switching gtk4 backends between gl and vulkan makes no difference. 100% cpu while the game is up. 100% cpu even if the freeciv window is hidden.
Updated by Dean Brown 9 days ago
Found similar issue on my Mac - gtk4 client, freeciv 3.2.1, built with the MacPorts gtk4 package. Activity Monitor.app shows %CPU about 8-10 times what gtk3.22 shows.
Updated by Marko Lindqvist 8 days ago
There's no support for drawing only dirty part (such as active unit's selection animation area) of the screen in gtk4, but we always have to redraw entire screen (for freeciv side, we always mark entire screen as dirty)
But we've also built on top of that we will be always redrawing entire screen. Both the proper zoom support and animation support of gtk4-client depend on it.
Updated by Dean Brown 5 days ago
Yikes, this could be a deal-breaker for some folks. I don't think we should eliminate zoom support and animation support to fix it. Wonder if gtk5 will have the same issue. If so, we should not drop support for gtk3.22 going forward. I think there was also a plan to make gtk4 the default at some point - maybe that's not a good idea.