bug#46493: [feature/pgtk] Low contrast region face

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#46493: [feature/pgtk] Low contrast region face

Basil L. Contovounesios
X-Debbugs-Cc: Yuuki Harano <[hidden email]>
Severity: wishlist

On master:

0. emacs -Q
1. M-2 M-b
2. M-2 M-@



Repeat the same on feature/pgtk:



I understand that each toolkit has its look & feel, and that colour
perception is subjective, but the default contrast on pgtk strikes me as
a bit too low for text editing.

Is there a way for Emacs to control the default (and would we want to do
that), or is this something that users must adjust on their side using
GTK or Emacs themes or the like?

Thanks,

--
Basil

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)
 of 2021-02-13 built on tia
Repository revision: d1be48fdedabb451d5c6cf315fd5f09a632e771f
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12010000
System Description: Debian GNU/Linux bullseye/sid

Configured using:
 'configure 'CC=ccache gcc' 'CFLAGS=-O2 -march=native' --config-cache
 --prefix=/home/blc/.local --enable-checking=structs
 --with-x-toolkit=lucid --with-file-notification=yes --with-x'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11
XAW3D XDBE XIM XPM LUCID ZLIB

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2021-02-13 built on tia
Repository revision: 175ebb010477ff0e174fe5145154397f43dee2d2
Repository branch: feature/pgtk
Windowing system distributor 'System Description: Debian GNU/Linux bullseye/sid

Configured using:
 'configure 'CC=ccache gcc' 'CFLAGS=-O2 -march=native' --config-cache
 --prefix=/home/blc/.local --program-suffix=-pgtk
 --enable-checking=structs --with-file-notification=yes --with-pgtk
 --with-xwidgets'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY
PDUMPER PGTK PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XIM
XWIDGETS GTK3 ZLIB

Important settings:
  value of $LANG: en_IE.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

2021-02-13-165334_709x171_scrot.png (487K) Download Attachment
2021-02-13-165400_721x169_scrot.png (489K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#46493: [feature/pgtk] Low contrast region face

Dmitry Gutov
On 13.02.2021 18:55, Basil L. Contovounesios wrote:
> X-Debbugs-Cc: Yuuki Harano <[hidden email]>
> Severity: wishlist
>
> On master:
>
> 0. emacs -Q
> 1. M-2 M-b
> 2. M-2 M-@

That's not a GTK3 build, though, right?

> Repeat the same on feature/pgtk:
>
>
>
> I understand that each toolkit has its look & feel, and that colour
> perception is subjective, but the default contrast on pgtk strikes me as
> a bit too low for text editing.

Seems like it uses the same background color as the GTK3 build (the
current one)? And that is probably the color of the window background.

My current GTK theme has a bit darker windows, so the background color
looks like fine here, FWIW.

But the screenshot exhibits another (definite) bug: when Emacs is just
started, the cursor shape is hollow. Switch away from its window and
then back: the cursor is now filled.



Reply | Threaded
Open this post in threaded view
|

bug#46493: [feature/pgtk] Low contrast region face

Basil L. Contovounesios
Dmitry Gutov <[hidden email]> writes:

> On 13.02.2021 18:55, Basil L. Contovounesios wrote:
>> X-Debbugs-Cc: Yuuki Harano <[hidden email]>
>> Severity: wishlist
>> On master:
>> 0. emacs -Q
>> 1. M-2 M-b
>> 2. M-2 M-@
>
> That's not a GTK3 build, though, right?

configure.ac suggests otherwise:

  pgtk )
    term_header=pgtkterm.h
    with_gtk3=yes
    USE_X_TOOLKIT=none
  ;;

As does the GTK3 seen in the system-configuration-features part of my
signature in the OP.

>> Repeat the same on feature/pgtk:
>> I understand that each toolkit has its look & feel, and that colour
>> perception is subjective, but the default contrast on pgtk strikes me as
>> a bit too low for text editing.
>
> Seems like it uses the same background color as the GTK3 build (the current
> one)? And that is probably the color of the window background.
>
> My current GTK theme has a bit darker windows, so the background color looks
> like fine here, FWIW.

I don't use a desktop environment, and I'm not really familiar with GTK,
but here's my $XDG_CONFIG_HOME/gtk-3.0/settings.ini:

  [Settings]
  gtk-font-name                     = DejaVu Sans 10
  gtk-icon-theme-name               = Adwaita
  gtk-recent-files-enabled          = false
  gtk-recent-files-limit            = 0
  gtk-recent-files-max-age          = 0
  gtk-theme-name                    = Adwaita

> But the screenshot exhibits another (definite) bug: when Emacs is just started,
> the cursor shape is hollow. Switch away from its window and then back: the
> cursor is now filled.

I can't reproduce that here.  My cursor is always filled so long as the
frame is focused.  The hollow cursor in my screenshot seems to be the
result of invoking scrot via gmrun, during which Emacs seems to lose
focus.  I don't know why that doesn't happen with Lucid; I assumed it
was just toolkit-specific behaviour.  [BTW, disabling blink-cursor-mode
does not change anything.]

Is this rather some kind of mishandling of focus events on Emacs' side?

Thanks,

--
Basil



Reply | Threaded
Open this post in threaded view
|

bug#46493: [feature/pgtk] Low contrast region face

Dmitry Gutov
On 13.02.2021 22:53, Basil L. Contovounesios wrote:

> Dmitry Gutov <[hidden email]> writes:
>
>> On 13.02.2021 18:55, Basil L. Contovounesios wrote:
>>> X-Debbugs-Cc: Yuuki Harano <[hidden email]>
>>> Severity: wishlist
>>> On master:
>>> 0. emacs -Q
>>> 1. M-2 M-b
>>> 2. M-2 M-@
>>
>> That's not a GTK3 build, though, right?
>
> configure.ac suggests otherwise:
>
>    pgtk )
>      term_header=pgtkterm.h
>      with_gtk3=yes
>      USE_X_TOOLKIT=none
>    ;;
>
> As does the GTK3 seen in the system-configuration-features part of my
> signature in the OP.

No, I'm talking about your "reference" screenshot.

You are not comparing pgtk to the GTK3 build, which I think should be
the reference when discussing it.

>>> Repeat the same on feature/pgtk:
>>> I understand that each toolkit has its look & feel, and that colour
>>> perception is subjective, but the default contrast on pgtk strikes me as
>>> a bit too low for text editing.
>>
>> Seems like it uses the same background color as the GTK3 build (the current
>> one)? And that is probably the color of the window background.
>>
>> My current GTK theme has a bit darker windows, so the background color looks
>> like fine here, FWIW.
>
> I don't use a desktop environment, and I'm not really familiar with GTK,
> but here's my $XDG_CONFIG_HOME/gtk-3.0/settings.ini:
>
>    [Settings]
>    gtk-font-name                     = DejaVu Sans 10
>    gtk-icon-theme-name               = Adwaita
>    gtk-recent-files-enabled          = false
>    gtk-recent-files-limit            = 0
>    gtk-recent-files-max-age          = 0
>    gtk-theme-name                    = Adwaita

It's some color within the Adwaita theme, then.

>> But the screenshot exhibits another (definite) bug: when Emacs is just started,
>> the cursor shape is hollow. Switch away from its window and then back: the
>> cursor is now filled.
>
> I can't reproduce that here.  My cursor is always filled so long as the
> frame is focused.  The hollow cursor in my screenshot seems to be the
> result of invoking scrot via gmrun, during which Emacs seems to lose
> focus.  I don't know why that doesn't happen with Lucid; I assumed it
> was just toolkit-specific behaviour.  [BTW, disabling blink-cursor-mode
> does not change anything.]
>
> Is this rather some kind of mishandling of focus events on Emacs' side?

Hm, all right. Maybe I'll report it later.

I can easily reproduce it with the current feature/pgtk by just calling
'src/emacs -Q'. The cursor is hollow until I switch windows or drag the
current one.

Not so in the GTK3 build.



Reply | Threaded
Open this post in threaded view
|

bug#46493: [feature/pgtk] Low contrast region face

Basil L. Contovounesios
Dmitry Gutov <[hidden email]> writes:

> On 13.02.2021 22:53, Basil L. Contovounesios wrote:
>> Dmitry Gutov <[hidden email]> writes:
>>> That's not a GTK3 build, though, right?
>> configure.ac suggests otherwise:
>>    pgtk )
>>      term_header=pgtkterm.h
>>      with_gtk3=yes
>>      USE_X_TOOLKIT=none
>>    ;;
>> As does the GTK3 seen in the system-configuration-features part of my
>> signature in the OP.
>
> No, I'm talking about your "reference" screenshot.
Ah, yes that would be Lucid.

> You are not comparing pgtk to the GTK3 build, which I think should be the
> reference when discussing it.

That's fair, but my intention wasn't so much a comparison with GTK3 as a
question for how [P]GTK3 should work in Emacs.  Let me know if I should
take this elsewhere.

>>>> Repeat the same on feature/pgtk:
>>>> I understand that each toolkit has its look & feel, and that colour
>>>> perception is subjective, but the default contrast on pgtk strikes me as
>>>> a bit too low for text editing.
>>>
>>> Seems like it uses the same background color as the GTK3 build (the current
>>> one)? And that is probably the color of the window background.
>>>
>>> My current GTK theme has a bit darker windows, so the background color looks
>>> like fine here, FWIW.
>> I don't use a desktop environment, and I'm not really familiar with GTK,
>> but here's my $XDG_CONFIG_HOME/gtk-3.0/settings.ini:
>>    [Settings]
>>    gtk-font-name                     = DejaVu Sans 10
>>    gtk-icon-theme-name               = Adwaita
>>    gtk-recent-files-enabled          = false
>>    gtk-recent-files-limit            = 0
>>    gtk-recent-files-max-age          = 0
>>    gtk-theme-name                    = Adwaita
>
> It's some color within the Adwaita theme, then.
Okay, but what alternatives are there?  I have the following directories
under /usr/share/themes: Adwaita, Adwaita-dark, Default, Emacs,
HighContrast, Raleigh.

Replacing Adwaita with Default, Emacs, or Raleigh in settings.ini makes
no difference.

With Adwaita-dark, I see the following:



And with HighContrast seeing is not believing that the region is active:



Is this entirely a misconfiguration on my end, or can Emacs do better?

Thanks,

--
Basil

2021-02-14-124035_722x180_scrot.png (522K) Download Attachment
2021-02-14-124234_717x176_scrot.png (507K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#46493: [feature/pgtk] Low contrast region face

Yuuki Harano-2
In reply to this post by Basil L. Contovounesios

On Sun, 14 Feb 2021 13:00:59 +0000,
        "Basil L. Contovounesios" <[hidden email]> wrote:
> Note how Gedit's "region" takes on a different, much clearer colour.
> Could/should Emacs query GTK3 colours differently here?

Gedit doesn't know anything about coloring.

There is a widget class to edit a text in Gtk, and gedit only use it.
The widget class uses Gtk theming functions.
That is why gedit coloring is consistent with themes.

I looked for another way to get theme color, but nothing found.

--
Yuuki Harano



Reply | Threaded
Open this post in threaded view
|

bug#46493: [feature/pgtk] Low contrast region face

Basil L. Contovounesios
Yuuki Harano <[hidden email]> writes:

> On Sun, 14 Feb 2021 13:00:59 +0000,
> "Basil L. Contovounesios" <[hidden email]> wrote:
>> Note how Gedit's "region" takes on a different, much clearer colour.
>> Could/should Emacs query GTK3 colours differently here?
>
> Gedit doesn't know anything about coloring.
>
> There is a widget class to edit a text in Gtk, and gedit only use it.
> The widget class uses Gtk theming functions.
> That is why gedit coloring is consistent with themes.
>
> I looked for another way to get theme color, but nothing found.

Thanks for looking.  Feel free to close this issue as wontfix if this is
something that can't really be helped.

--
Basil