Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-08-07 20:49:56

abyss
Member
Registered: 2024-08-07
Posts: 10

Setting Cursor Aspect Ratio

I am ignorant of the exact relationship between GTK versions 2, 3, and 4 with XFCE 4.18 with LibreOffice 7.4.7.2 Community edition. However, I think that the width of the text cursor (the vertical bar the blinks by default, not the arrow pointer for the mouse position) is or can be controlled by a configuration hint to GTK version something or to the XFCE Settings Manager, Settings Editor. This query is to find out how to do that, or that it can't be done.

I am using Linux Debian 12 on a laptop with XFCE 4.18. I don't see a dependency of XFCE 4.18 on a particular GTK library from the apt package manager (using 'apt show xfce4'). I do see the Apt tag 'uitoolkit::gtk'. I guess, just a guess, that XFCE 4.18 has included the GTK library it needs.

I would like to make the text cursor shown in LibreOffice Writer thicker. I was able to do that on Linux Debian 11 with file '.config/gtk-3.0/gtk.css' with the line '* { -GtkWidget-cursor-aspect-ratio: 0.06; }'. Maybe XFCE 4.18 uses GTK4? The variable to control the cursor aspect ratio in GTK4 is documented at webpage "Settings:gtk-cursor-aspect-ratio", https://docs.gtk.org/gtk4/property.Sett … ratio.html .

I also was able to alter the look and behavior of the scrollbars in LibreOffice to my liking. I have the smart-phone style skinny scrollbars with click-to-position behavior. I prefer fatter, stable scrollbars and incremental steps with clicks in the scrollbar not on the slider part. I only mention it for completeness. If I learn how to adjust cursor width, I can probably figure out the scrollbar adjustments.

I have tried much bigger aspect ratio values than '0.06' in various ways and get nothing. I have tried new files '.config/gtk-4.0/gtk.css' and '.config/gtk-4.0/settings.ini' with my guesses on content. I tried adding two cursor aspect properties to the XFCE Settings Editor. I added under last tab named 'xsettings' under 'Gtk' the double type property '/Gtk/CursorAspectRatio' and under 'Net' the double type property '/Net/CursorAspectRatio'. They do nothing. I don't know what 'Net' has to do with property '/Net/CursorBlink', but there is was, and it works. I changed its Boolean value to False and with stop and start of LibreOffice Writer I was able to get the text insert cursor to not blink. I changed it back. I just wanted to see if the properties were working.

Any ideas?

Offline

#2 2024-08-07 23:15:17

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,491

Re: Setting Cursor Aspect Ratio

Hello and welcome.

Xfce uses GTK3, not GTK4. According to https://docs.gtk.org/gtk3/property.Sett … ratio.html, the setting should be "gtk-cursor-aspect-ratio".

Since its a setting, you should add it to the file ~/.config/gtk-3.0/settings.ini (create the file if it doesn't exist):

[Settings]
gtk-cursor-aspect-ratio = 0.06

Note that the first line in that file should be "[Settings]".

I tested this with a cursor setting of 1.0 and it worked.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2024-08-08 00:09:55

abyss
Member
Registered: 2024-08-07
Posts: 10

Re: Setting Cursor Aspect Ratio

Thanks, ToZ. I tried what you said (exactly two lines), and variations of what you said, and it just won't work. I made sure to remove the custom properties I defined in the XFCE Settings Manager. I checked the file name (~/.config/gtk-3.0/settings.ini), ownership, and permissions.

I'm using Debian 12.6 (per file '/etc/debian_version'). What OS are you using? Are you sure the section name should not be '[<???> Settings]' in the style of '[Filechooser Settings]'?

Maybe I will think of something, but for now I am stumped.

Offline

#4 2024-08-08 00:42:35

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,491

Re: Setting Cursor Aspect Ratio

Its like I've typed above. Did you log out and back in again?

Try with the following in settings.ini:

[Settings]
gtk-cursor-aspect-ratio = 1.0

...to see if it works for you with a larger value.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2024-08-08 02:02:10

abyss
Member
Registered: 2024-08-07
Posts: 10

Re: Setting Cursor Aspect Ratio

Not working. I get it. I don't know what to try.

Should I mark this as solved? The solution is given. I don't know if I'm doing something stupid or not.

Offline

#6 2024-08-08 09:47:39

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,491

Re: Setting Cursor Aspect Ratio

Lets not mark it solved until it is solved for you.

Can you post back the output of these commands?

cat ~/.config/gtk-3.0/settings.ini
xfconf-query- c xsettings -lv

...as well as posting back the contents of your ~/.xsession-errors file.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#7 2024-08-08 19:51:58

abyss
Member
Registered: 2024-08-07
Posts: 10

Re: Setting Cursor Aspect Ratio

I am just noticing that by browser Firefox 115.13.0esr has a text cursor that is about double the width I would like. That's interesting because I have cursor aspect ratio set to 0.12, which is double the 0.06 I had before installing Debian 12.6 as I have it now (my second time on the same machine). I had a problem with NVIDIA driver that led to kernel updates being blocked on apt package manager. I started with Debian 10 or 11 and got to Debian 12.6 or so before the kernel update problem caused me to reinstall. It looks like LibreOffice Writer needs approximately double the cursor aspect ratio to display as it did. I thought nothing of it until the text cursor I have now to make this message in a text area in Firefox is about double the width I would like.

For the record, I fixed the skinny 1 pixel width text cursor of text editor Geany 1.38 with edit of a configuration file via Tools > Configuration Files > filetypes.common, in which I set 'caret_width=4', which works despite the comment for the property saying the range is limited to 0..3, inclusive.

I don't see how to show preformatted text (your black boxes with text). This is what I have from the command line with commentary:

[doug@burr ~]$ xfconf-query -c xsettings -lv
/Gdk/WindowScalingFactor        1
/Gtk/ButtonImages               true
/Gtk/CanChangeAccels            false
/Gtk/ColorPalette               black:white:gray50:red:purple:blue:light blue:green:yellow:orange:lavender:brown:goldenrod4:dodger blue:pink:light green:gray10:gray30:gray75:gray90
/Gtk/CursorThemeName            default
/Gtk/CursorThemeSize            46
/Gtk/DecorationLayout           menu:minimize,maximize,close
/Gtk/DialogsUseHeader           true
/Gtk/FontName                   Sans 28
/Gtk/IconSizes                 
/Gtk/KeyThemeName               
/Gtk/MenuBarAccel               F10
/Gtk/MenuImages                 true
/Gtk/MonospaceFontName          Monospace 26
/Gtk/TitlebarMiddleClick        lower
/Gtk/ToolbarIconSize            3
/Gtk/ToolbarStyle               icons
/Net/CursorBlink                true
/Net/CursorBlinkTime            1200
/Net/DndDragThreshold           8
/Net/DoubleClickDistance        5
/Net/DoubleClickTime            400
/Net/EnableEventSounds          false
/Net/EnableInputFeedbackSounds  false
/Net/IconThemeName              elementary-xfce
/Net/SoundThemeName             default
/Net/ThemeName                  Arc-Lighter
/Xfce/LastCustomDPI             96
/Xft/Antialias                  -1
/Xft/DPI                        -1
/Xft/Hinting                    -1
/Xft/HintStyle                  hintnone
/Xft/RGBA                       none
[doug@burr ~]$
[doug@burr ~]$ cat .config/gtk-3.0/settings.ini
[Settings]
gtk-primary-button-warps-slider = false
[doug@burr ~]$
[doug@burr ~]$ cat .config/gtk-3.0/gtk.css
/* For my 3840x2160 screen this fixes the narrowness
   of the insertion bar curson in LibreOffice. */
* { -GtkWidget-cursor-aspect-ratio: 0.12; }
[doug@burr ~]$
[doug@burr ~]$ ls -ld .config
drwx------ 26 doug doug 4096 Aug  8 13:28 .config
[doug@burr ~]$
[doug@burr ~]$ ls -ld .config/gtk-3.0/
drwx------ 2 doug doug 4096 Aug  8 14:28 .config/gtk-3.0/
[doug@burr ~]$
[doug@burr ~]$ # I had drwxr-xr-x 2 doug doug 4096 Aug  8 14:28 .config/gtk-3.0/ ,
[doug@burr ~]$ # which apparently prevented gtk-3.0 from working at all.
[doug@burr ~]$ # Good to know I can log out and back in to test my changes with
[doug@burr ~]$ # least overhead. After I reduced permissions on gtk-3.0 to '=700',
[doug@burr ~]$ # I got gtk.ccs to work with cursor aspect ratio and got settings.ini
[doug@burr ~]$ # to work with gtk-primary-button-warps-slider = false, but not
[doug@burr ~]$ # with gtk-cursor-aspect-ratio = 0.06. I have changed to a ratio of 0.12.
[doug@burr ~]$ # Whether I need a bigger aspect ratio because of my worsening eyes
[doug@burr ~]$ # or a change in software I do not know.
[doug@burr ~]$
[doug@burr ~]$ cat /etc/debian_version
12.6
[doug@burr ~]$ lsb_release -a
No LSB modules are available.
Distributor ID:    Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:    12
Codename:    bookworm
[doug@burr ~]$
[doug@burr ~]$ uname -a
Linux burr 6.1.0-23-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15) x86_64 GNU/Linux
[doug@burr ~]$
[doug@burr ~]$ # I am using a proprietary NVIDIA driver for my GeForce RTX 2080 Super/ Max-Q.
[doug@burr ~]$


[doug@burr gtk-3.0]$ # Moved out gtk.css (not shown) and added back to settings.ini
[doug@burr gtk-3.0]$ # the cursor aspect ratio property.
[doug@burr gtk-3.0]$
[doug@burr gtk-3.0]$ nano settings.ini
[doug@burr gtk-3.0]$
[doug@burr gtk-3.0]$ cat settings.ini
[Settings]
gtk-cursor-aspect-ratio = 0.12
gtk-primary-button-warps-slider = false
[doug@burr gtk-3.0]$
[doug@burr gtk-3.0]$ I logged out and back in. The cursor width was too thin,
[doug@burr gtk-3.0]$ seemed to be the default again. However, the property
[doug@burr gtk-3.0]$ # 'gtk-primary-button-warps-slider' works just fine.
[doug@burr gtk-3.0]$ # I am just going to use both files and frankenstein
[doug@burr gtk-3.0]$ # together what works for me in practice. Another day
[doug@burr gtk-3.0]$ # of experimentation and frustration for style points
[doug@burr gtk-3.0]$ # no one will see is not worth it.
[doug@burr gtk-3.0]$

I have resolved to have two files in directory '.config/gtk-3.0'.

This is file 'gtk.css':
/* For my 3840x2160 screen this fixes the narrowness
   of the insertion bar curson in LibreOffice. */
* { -GtkWidget-cursor-aspect-ratio: 0.12; }

This is file 'settings.ini':
## A line starting with ';' is treated as a
## total parse fail of the whole file not as a comment!!!
##
## Property 'gtk-cursor-aspect-ratio' does not work on my
## Tuxedo XUX7-11, Debian 12.6 OS. --DBM, 08 August 2024.
##gtk-cursor-aspect-ratio = 0.12
gtk-primary-button-warps-slider = false

It works the best I get it to work. I'd rather have the cursor be wide in Firefox than too thin in LibreOffice. As said, Geany is doing it's own thing without XFCE-Gtk 3.0 configuration for cursor width, which is by pixels (perhaps physical screen pixels, as my guess).

That's what I have. I think something is amiss in the software, but where? If someone else has this problem, that someone can identify what constellation of software he or she is using. With enough cases of the same problem, perhaps the supposed software source of this problem I am having could be identified. If it is just user error, that would be really embarrassing for me.

I hope that is useful info. I don't know what else to add, except I now see that I can update Firefox with my apt package manager. Let me see how that changes the text cursor in Firefox that I am using right now.

Last edited by abyss (2024-08-08 19:58:52)

Offline

#8 2024-08-08 19:58:08

abyss
Member
Registered: 2024-08-07
Posts: 10

Re: Setting Cursor Aspect Ratio

My Firefox version is now 115.14.0esr. This text cursor is still twice as fat as I'd like it to be, but I am using twice the cursor aspect ratio I had before a fresh install of Debian 12.6. It is possible I screwed up something in the month since the install. I really don't know.

I don't know why the settings.ini file is working for property 'gtk-primary-button-warps-slider' in LibreOffice Writer (and I have the same page increment behavior in Firefox right now)  but not property 'gtk-cursor-aspect-ratio', which does work with weird divergence between Firefox and Writer.

I just filed bug 162404, "Possible Mishandling of GTK 3.0 Settings Property 'gtk-cursor-aspect-ratio'" with bugs.documentfoundation.org to see if anyone can confirm my problem with setting the text cursor width for Writer.

Last edited by abyss (2024-08-08 21:15:38)

Offline

#9 2024-08-08 21:38:14

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,491

Re: Setting Cursor Aspect Ratio

Okay, so it might be working. Can you test it in a true GTK3 program like mousepad?

Perhaps libreoffice is not built using the GTK toolkit - that would explain why this change isn't having an effect there. What happens when you run libreoffice like this:

SAL_USE_VCLPLUGIN=gtk3 libreoffice

Is the cursor the correct size now?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#10 2024-08-08 22:46:25

abyss
Member
Registered: 2024-08-07
Posts: 10

Re: Setting Cursor Aspect Ratio

ToZ, mousepad and firefox agree on cursor width. I tried 'SAL_USE_VCLPLUGIN=gtk3 libreoffice' and the cursor size and thickness remained unchanged in Writer. I tried it with 'firefox-esr' and the text cursor there was still too fat by about twice (which is the correct behavior as near as I can tell).

How do you make your blocks of text of white on black?

Offline

#11 2024-08-08 23:14:46

abyss
Member
Registered: 2024-08-07
Posts: 10

Re: Setting Cursor Aspect Ratio

ToZ, I removed configuration file 'gtk.css' and used only file 'settings.ini' to set 'gtk-cursor-aspect-ratio' followed by 'gtk-primary-button-warps-slider', I logged out and in, and I visually tested cursor aspect ratio.

Regarding text cursor aspect ratio, Mousepad works perfectly from 'gtk.css' and from 'settings.ini'; and LibreOffice Writer and Firefox work with 'gtk.css' but not with 'settings.ini'. And of course, Firefox works perfectly regarding the property set in 'gtk.css', whereas in Writer the text cursor is too skinny by a factor of two as already identified. From a small sample size it looks like 'settings.ini' has little support at this time.

Debian 12 is a little behind the bleeding edge of Linux development and may not reflect what the latest Firefox and LibreOffice are. I don't know why it looks like I can download LibreOffice 24.2.5 for X86-54 CPU and Linux OS from the relevant website, but I saw no indication of Community Edition for it. Firefox seems to be on version 129.0, which sound reasonable vis-a-vis 115.14.0 on my machine.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.011 seconds, 8 queries executed - Memory usage: 608.75 KiB (Peak: 625.59 KiB) ]