-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hotplugging, buffer scaling and general improvements #25
Changes from 21 commits
0f607f1
85c9432
53443e5
3820cd7
652f33a
628d90b
5406e0e
0c19625
b1dcdce
8954ef5
fa566e3
daf39a1
e869fb6
f864935
f6e132d
639932b
0272164
9c09f70
af6abf2
9753b4a
09e7d21
8fdbc62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -288,14 +288,30 @@ bool CDisplaySettings::OnSettingChanging(std::shared_ptr<const CSetting> setting | |
SetCurrentResolution(newRes, false); | ||
g_graphicsContext.SetVideoResolution(newRes); | ||
|
||
if (m_resolutionChangeInProgress) | ||
{ | ||
// Do not recurse into showing dialogs | ||
return true; | ||
} | ||
|
||
// check if the old or the new resolution was/is windowed | ||
// in which case we don't show any prompt to the user | ||
if (oldRes != RES_WINDOW && newRes != RES_WINDOW && oldRes != newRes) | ||
{ | ||
if (!m_resolutionChangeAborted) | ||
{ | ||
if (HELPERS::ShowYesNoDialogText(CVariant{13110}, CVariant{13111}, CVariant{""}, CVariant{""}, 15000) != | ||
DialogResponse::YES) | ||
m_resolutionChangeInProgress = true; | ||
#if defined(HAVE_WAYLAND) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think here at the latest you noticed that DisplaySettings is a can of worms :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes :-( |
||
// If ReloadSkin() is called when a dialog is shown, it will get aborted, | ||
// so reload the skin later | ||
g_Windowing.SetInhibitSkinReload(true); | ||
#endif | ||
auto response = HELPERS::ShowYesNoDialogText(CVariant{13110}, CVariant{13111}, CVariant{""}, CVariant{""}, 15000); | ||
#if defined(HAVE_WAYLAND) | ||
g_Windowing.SetInhibitSkinReload(false); | ||
#endif | ||
m_resolutionChangeInProgress = false; | ||
if (response != DialogResponse::YES) | ||
{ | ||
m_resolutionChangeAborted = true; | ||
return false; | ||
|
@@ -313,10 +329,26 @@ bool CDisplaySettings::OnSettingChanging(std::shared_ptr<const CSetting> setting | |
SetCurrentResolution(newRes, false); | ||
g_graphicsContext.SetVideoResolution(newRes, true); | ||
|
||
if (m_resolutionChangeInProgress) | ||
{ | ||
// Do not recurse into showing dialogs | ||
return true; | ||
} | ||
|
||
if (!m_resolutionChangeAborted) | ||
{ | ||
if (HELPERS::ShowYesNoDialogText(CVariant{13110}, CVariant{13111}, CVariant{""}, CVariant{""}, 10000) != | ||
DialogResponse::YES) | ||
m_resolutionChangeInProgress = true; | ||
#if defined(HAVE_WAYLAND) | ||
// If ReloadSkin() is called when a dialog is shown, it will get aborted, | ||
// so reload the skin later | ||
g_Windowing.SetInhibitSkinReload(true); | ||
#endif | ||
auto response = HELPERS::ShowYesNoDialogText(CVariant{13110}, CVariant{13111}, CVariant{""}, CVariant{""}, 10000); | ||
#if defined(HAVE_WAYLAND) | ||
g_Windowing.SetInhibitSkinReload(false); | ||
#endif | ||
m_resolutionChangeInProgress = false; | ||
if (response != DialogResponse::YES) | ||
{ | ||
m_resolutionChangeAborted = true; | ||
return false; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok for this branch