Crash opening settings when Applications was the last used panel
Bisected to c2ef0f6e:
commit c2ef0f6e5e92681809434e779d3c784cbdc0a7be
Author: Nelson Benítez León <nbenitezl@gmail.com>
Date: Sun Jul 16 21:15:29 2023 -0400
shell: prevent loading last-panel unconditionally on startup
We currently load the last-panel every time gnome-control-center
is launched, we do it from the CcWindow contructor method.
But we shouldn't do it when we are explicitly opening a different
panel by eg. using commandline parameter (gnome-control-center keyboard)
or from a DBus method, because otherwise we slow things down by
unnecesarily start launching last-panel just to be cancelled
moments later when the code starts processing the other panel.
We fix it by moving the code that loads last-panel to an idle
handler, so by the time it gets executed the other panel has
already started loading, and we can check for that with the
cc_panel_list_get_current_panel() function we add in this patch.
With this patch, I can feel that panels opened from a
gnome-shell search are presented faster.
Fixes issue #2569
shell/cc-panel-list.c | 14 ++++++++++++++
shell/cc-panel-list.h | 2 ++
shell/cc-window.c | 27 ++++++++++++++++++++-------
3 files changed, 36 insertions(+), 7 deletions(-)