Return 0 for wxSYS_CARET_ON_MSEC in wxGTK if appropriate too
For some reason, 7f10d1fa8a
handled
wxSYS_CARET_ON_MSEC and wxSYS_CARET_OFF_MSEC differently in wxGTK, even
though it looks like they should be handled in exactly the same way.
Change the code to do this, which results in returning 0 for the former
setting if the caret doesn't blink at all, just as was already the case
for the latter one.
See https://github.com/wxWidgets/wxWidgets/pull/1285
See #17629.
This commit is contained in:
@@ -196,8 +196,10 @@ enum wxSystemMetric
|
|||||||
/**
|
/**
|
||||||
Time, in milliseconds, for how long a blinking caret should
|
Time, in milliseconds, for how long a blinking caret should
|
||||||
stay visible during a single blink cycle before it disappears.
|
stay visible during a single blink cycle before it disappears.
|
||||||
If this value is negative, the platform does not support the
|
|
||||||
user setting.
|
If this value is zero, caret should be visible all the time
|
||||||
|
instead of blinking. If the value is negative, the platform
|
||||||
|
does not support the user setting.
|
||||||
|
|
||||||
@since 3.1.1
|
@since 3.1.1
|
||||||
*/
|
*/
|
||||||
@@ -206,7 +208,8 @@ enum wxSystemMetric
|
|||||||
/**
|
/**
|
||||||
Time, in milliseconds, for how long a blinking caret should
|
Time, in milliseconds, for how long a blinking caret should
|
||||||
stay invisible during a single blink cycle before it reappears.
|
stay invisible during a single blink cycle before it reappears.
|
||||||
If this value is zero, carets should be visible all the time
|
|
||||||
|
If this value is zero, caret should be visible all the time
|
||||||
instead of blinking. If the value is negative, the platform
|
instead of blinking. If the value is negative, the platform
|
||||||
does not support the user setting.
|
does not support the user setting.
|
||||||
|
|
||||||
|
@@ -975,16 +975,6 @@ int wxSystemSettingsNative::GetMetric( wxSystemMetric index, wxWindow* win )
|
|||||||
return dclick;
|
return dclick;
|
||||||
|
|
||||||
case wxSYS_CARET_ON_MSEC:
|
case wxSYS_CARET_ON_MSEC:
|
||||||
{
|
|
||||||
gint blink_time = -1;
|
|
||||||
g_object_get(GetSettingsForWindowScreen(window),
|
|
||||||
"gtk-cursor-blink-time", &blink_time, NULL);
|
|
||||||
if (blink_time > 0)
|
|
||||||
return blink_time / 2;
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
case wxSYS_CARET_OFF_MSEC:
|
case wxSYS_CARET_OFF_MSEC:
|
||||||
{
|
{
|
||||||
gboolean should_blink = true;
|
gboolean should_blink = true;
|
||||||
|
Reference in New Issue
Block a user