To keep the things related to the caret at the same place, I used filetypes.common.
In addition to allowing users modify the caret to their needs, this can be used for debugging CPU usage as this should be the only timer in Geany and when set to 0, Geany should (theoretically) use absolutely no CPU.
Fixes #3410. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3901
-- Commit Summary --
* Support setting SCI_SETCARETPERIOD
-- File Changes --
M data/filedefs/filetypes.common (5) M src/highlighting.c (5)
-- Patch Links --
https://github.com/geany/geany/pull/3901.patch https://github.com/geany/geany/pull/3901.diff
https://github.com/geany/geany/issues/3410#issuecomment-2029013815 it'd be nice not to loose this. But then… do we *really* need a setting on our side??
As I repeated on #3410 till I was blue in the face, Geany blinks follow the desktop settings on Cinnamon, there is no need for a Geany setting on sensible systems, especially as the way its implemented here will disconnect Geany from the desktop settings forever.
For fruits and fenesters systems having an option in Geany's UI might make sense since their users would have to edit `settings.ini` otherwise.
So as to not need to make the presence of this option system dependent it needs an extra option to "follow the system settings" which defaults to on for Linux and off for other systems via a teeny leetle ifdef.
(Note GTK4 reads user settings from NSUserDefaults so Macos could be set to follow system again by default when we get there, but still no registry action).
OK, not a big deal, this particular bug report caught my eye because I wanted to force Geany "do nothing" for profiling but yes, it can be set globally (on Linux at least) so there's no particular need to have this feature directly in Geany.
Well, after debugging #3902, the blinking caret on macOS eats ~1% CPU (in comparison, it's pretty much 0% on Linux, judging just from the `top` output). So it might be nice to have it configurable to stop blinking on other platforms (that said, I myself probably won't use it).
https://github.com/geany/geany/issues/3410#issuecomment-2029013815 it'd be nice not to loose this.
We could just have some high default value (say 10000 - nobody wants to see the caret for 10s and have it hidden for another 10 seconds) and when this value is used, the `SCI_SETCARETPERIOD` setting wouldn't be applied. (By default this config option could be commented-out in the config file).
can be set globally (on Linux at least)
On Linux with a GUI, on other systems with `settings.ini` IIUC.
We could just have some high default value (say 10000 - nobody wants to see the caret for 10s and have it hidden for another 10 seconds) and when this value is used, the SCI_SETCARETPERIOD setting wouldn't be applied. (By default this config option could be commented-out in the config file).
What? Do I need more sleep? (probably, but that sentence still doesn't make sense, value for what? 10 seconds on 10 seconds off, what are you talking about? :-).
About this: ```C get_keyfile_ints(config, config_home, "styling", "caret_period", 10000, 0, &common_style_set.styling[GCS_CARET].italic, NULL);
...
if (common_style_set.styling[GCS_CARET].italic < 10000) SSM(sci, SCI_SETCARETPERIOD, common_style_set.styling[GCS_CARET].italic, 0); ``` As I said, nobody will want to see the caret on for 10s and off for 10s so the default value 10000 is safe to use and if such value is set, `SCI_SETCARETPERIOD` won't be applied and you get the default caret period from your system.
Oh, `caret_period`, ok that now makes sense.
@techee pushed 1 commit.
625a6a43028f7c72b8126dcac14fdfa782759739 Support setting SCI_SETCARETPERIOD
We could extend the comment to explain that this setting overrides the GTK default and when changed, the GTK blinking rate is fully ignored. I could imagine this could be still useful when users want different settings for Geany and the rest of the DE.
We could extend the comment to explain that this setting overrides the GTK default and when changed, the GTK blinking rate is fully ignored.
It kind of says that with the last line of the comment:
``` # set to 0 to disable blinking, comment-out to use system default value ```
(Yesterday I force-pushed this so if you pulled this branch before, it might be missing in the comment.)
I could imagine this could be still useful when users want different settings for Geany and the rest of the DE.
…but do people want this? In the related issue, I don't see if the OP wants this specific to Geany (or why), and the other user seems happy with changing the system setting, so should we really add a built-in feature for this?
I'm fine with either decision.
I primarily created this for debugging https://github.com/geany/geany/pull/3902 where I needed to make Geany completely silent. And on macOS or Windows I don't expect it would respect any system settings.
And on macOS or Windows I don't expect it would respect any system settings.
I guess this depends on whether GTK gets its default from the system there, or just has its own default.
I guess this depends on whether GTK gets its default from the system there, or just has its own default.
There isn't even a GUI way to change that system-wide on macOS - I tried
https://ask.libreoffice.org/t/is-there-any-way-to-disable-the-blinding-curso...
but it didn't seem to work.
The GTK settings docs for GTK4 say it follows system settings (if they exist I guess) on Macos, but no mention of on Windows. GTK3 mentions neither.
so should we really add a built-in feature for this?
Well, if it works and the default is to follow the system settings, why not? That way users can set it in a GUI in Geany on non-GTK systems like Windows, Macos, KDE, etc etc
That way users can set it in a GUI in Geany
No sure modifying filetypes.common is a great GUI 😅
Anyway, if you guys like this and it defaults to system settings, sure.
Oh, its not in various prefs, oh well, don't care then.
The GTK settings docs for GTK4 say it follows system settings (if they exist I guess) on Macos
I wasn't even able to modify the cursor behavior for the whole system on macOS - the command-line commands from the link I posted didn't work for me. It was possibly for some older macOS version.
No sure modifying filetypes.common is a great GUI 😅
Well, it was because the rest of the cursor stuff is there (and probably shouldn't be). And storing this settings to `gboolean` isn't beautiful either ;-)
Anyway, as I said, I don't care much myself whether this gets merged - we can just leave this PR open and wait if there are more requests.
I don't have a strong opinion on this either.
I agree that we can postpone this until there might raise actual need. But maybe we could close the PR instead and leaving a comment here that it could be resurrected if needed? The list of open PRs is quite long and one has to search for it anyway.
OK, closing then.
Closed #3901.
github-comments@lists.geany.org