Patch 8.2.4775

38 views
Skip to first unread message

Bram Moolenaar

unread,
Apr 17, 2022, 12:35:46 PM4/17/22
to vim...@googlegroups.com

Patch 8.2.4775
Problem: SpellBad highlighting does not work in Konsole.
Solution: Do not keep t_8u defined for Konsole. Redraw when t_8u is reset.
(closes #10177)
Files: src/term.c


*** ../vim-8.2.4774/src/term.c 2022-04-17 14:18:07.364733158 +0100
--- src/term.c 2022-04-17 17:28:11.629048582 +0100
***************
*** 4775,4783 ****
// vandyke SecureCRT sends 1;136;0
}

! // Konsole sends 0;115;0
! else if (version == 115 && arg[0] == 0 && arg[2] == 0)
! term_props[TPR_UNDERLINE_RGB].tpr_status = TPR_YES;

// GNU screen sends 83;30600;0, 83;40500;0, etc.
// 30600/40500 is a version number of GNU screen. DA2 support is added
--- 4775,4784 ----
// vandyke SecureCRT sends 1;136;0
}

! // Konsole sends 0;115;0 - but t_u8 does not actually work, therefore
! // commented out.
! // else if (version == 115 && arg[0] == 0 && arg[2] == 0)
! // term_props[TPR_UNDERLINE_RGB].tpr_status = TPR_YES;

// GNU screen sends 83;30600;0, 83;40500;0, etc.
// 30600/40500 is a version number of GNU screen. DA2 support is added
***************
*** 4806,4814 ****
--- 4807,4821 ----

// Unless the underline RGB color is expected to work, disable "t_8u".
// It does not work for the real Xterm, it resets the background color.
+ // This may cause some flicker. Alternative would be to set "t_8u"
+ // here if the terminal is expected to support it, but that might
+ // conflict with what was set in the .vimrc.
if (term_props[TPR_UNDERLINE_RGB].tpr_status != TPR_YES && *T_8U != NUL)
+ {
set_string_option_direct((char_u *)"t_8u", -1, (char_u *)"",
OPT_FREE, 0);
+ redraw_later(CLEAR);
+ }

// Only set 'ttymouse' automatically if it was not set
// by the user already.
*** ../vim-8.2.4774/src/version.c 2022-04-17 15:06:31.042622659 +0100
--- src/version.c 2022-04-17 17:31:51.849005319 +0100
***************
*** 748,749 ****
--- 748,751 ----
{ /* Add new patch number below this line */
+ /**/
+ 4775,
/**/

--
"How is your new girlfriend?"
"90-60-90 man!"
"What, pale purple?"

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Hisashi T Fujinaka

unread,
Apr 21, 2022, 1:38:23 PM4/21/22
to vim...@googlegroups.com, br...@vim.org
After this commit I get this error:

gui_gtk_x11.c:4139:14: error: implicit declaration of function 'gdk_window_get_width' is invalid in C99 [-Werror,-Wimplicit-function
-declaration]
int w = gdk_window_get_width(win);
^
gui_gtk_x11.c:4140:14: error: implicit declaration of function 'gdk_window_get_height' is invalid in C99 [-Werror,-Wimplicit-functio
n-declaration]
int h = gdk_window_get_height(win);
^
gui_gtk_x11.c:4140:14: note: did you mean 'gdk_window_get_origin'?
/opt/sw/include/gtk-2.0/gdk/gdkwindow.h:541:12: note: 'gdk_window_get_origin' declared here
gint gdk_window_get_origin (GdkWindow *window,
^
2 errors generated.

The Bisect looks like this:

%git bisect good
280aebfd356c4fc8b84f13314068411157ad72f2 is the first bad commit
commit 280aebfd356c4fc8b84f13314068411157ad72f2
Author: Bram Moolenaar <Br...@vim.org>
Date: Sun Apr 17 17:34:42 2022 +0100

patch 8.2.4775: SpellBad highlighting does not work in Konsole

Problem: SpellBad highlighting does not work in Konsole.
Solution: Do not keep t_8u defined for Konsole. Redraw when t_8u is reset.
(closes #10177)

src/term.c | 13 ++++++++++---
src/version.c | 2 ++
2 files changed, 12 insertions(+), 3 deletions(-)

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE + BSChem + BAEnglish + MSCS + $2.50 = coffee

Bram Moolenaar

unread,
Apr 21, 2022, 3:18:11 PM4/21/22
to vim...@googlegroups.com, Hisashi T Fujinaka
That patch doesn't change anything for the gui_gtk_x11.c file or what
could be related to the error.

The declarations should be in gdk/gdkwindow.h. Don't see a problem with
that.

Perhaps configure didn't run correctly?

--
If you put seven of the most talented OSS developers in a room
and ask them to fix a bug in a spreadsheet program, in one week
you'd have 2 new mail readers and a text-based web browser.

Hisashi T Fujinaka

unread,
Apr 21, 2022, 3:19:19 PM4/21/22
to Bram Moolenaar, vim...@googlegroups.com
Seemed odd to me too, but that's where I ended up with git bisect. I can
retry the bisection if you'd like.

Hisashi T Fujinaka

unread,
Apr 21, 2022, 4:07:58 PM4/21/22
to vim...@googlegroups.com, Bram Moolenaar
OK, looks like it's the NEXT commit.

git bisect bad
9f53e7bd7f0865585a5447fa3665c5d4c4f91408 is the first bad commit
commit 9f53e7bd7f0865585a5447fa3665c5d4c4f91408
Author: Ernie Rael <err...@raelity.com>
Date: Sun Apr 17 18:27:49 2022 +0100

patch 8.2.4776: GTK: 'lines' and 'columns' may change during startup

Problem: GTK: 'lines' and 'columns' may change during startup.
Solution: Ignore stale GTK resize events. (Ernie Rael, closes #10179)

src/gui_gtk_x11.c | 168 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
src/version.c | 2 +
2 files changed, 164 insertions(+), 6 deletions(-)

Bram Moolenaar

unread,
Apr 21, 2022, 5:52:55 PM4/21/22
to vim...@googlegroups.com, Hisashi T Fujinaka
Yes, that makes sense, the functions were added in that patch.

What I don't understand is why the header file isn't found. On my
system the file included from gui_gtk_x11.c includes "gdk/gdk.h",
which is found in /usr/include/gtk-3.0/gdk/gdk.h or in
/usr/include/gtk-2.0/gdk/gdk.h. Both then include gdk/gdkwindow.h in
the same directory which is where the declaration is found.

What is different on your system?

--
hundred-and-one symptoms of being an internet addict:
31. You code your homework in HTML and give your instructor the URL.

Hisashi T Fujinaka

unread,
Apr 21, 2022, 6:21:45 PM4/21/22
to vim...@googlegroups.com
You're using gtk-3. I have gtk-2.

James McCoy

unread,
Apr 21, 2022, 9:22:19 PM4/21/22
to vim...@googlegroups.com
They were added in GDK 2.24 and gtk_widget_get_window was added in GTK
2.14, in case someone wants to make a patch with proper version
checking.

Cheers,
--
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7 2D23 DFE6 91AE 331B A3DB

Ernie Rael

unread,
Apr 22, 2022, 1:38:04 AM4/22/22
to vim...@googlegroups.com
On 4/21/22 6:20 PM, James McCoy wrote:
> On Thu, Apr 21, 2022 at 03:21:41PM -0700, Hisashi T Fujinaka wrote:
>> On Thu, 21 Apr 2022, Bram Moolenaar wrote:
>>> Yes, that makes sense, the functions were added in that patch.
>>>
>>> What I don't understand is why the header file isn't found. On my
>>> system the file included from gui_gtk_x11.c includes "gdk/gdk.h",
>>> which is found in /usr/include/gtk-3.0/gdk/gdk.h or in
>>> /usr/include/gtk-2.0/gdk/gdk.h. Both then include gdk/gdkwindow.h in
>>> the same directory which is where the declaration is found.
>>>
>>> What is different on your system?
>> You're using gtk-3. I have gtk-2.
> They were added in GDK 2.24 and gtk_widget_get_window was added in GTK
> 2.14, in case someone wants to make a patch with proper version
> checking.


Thanks for the info. I'm guessing this needs to be supported?

I'll look around probably be able to craft a patch. "#if <expr>" is
allowed in vim source? Biggest problem will be testing, patch review
probably goes a long way.

-ernie

>
> Cheers,


Bram Moolenaar

unread,
Apr 22, 2022, 5:56:30 AM4/22/22
to vim...@googlegroups.com, Ernie Rael
You can use:
#if GTK_CHECK_VERSION(2,14,0)

Perhaps before GTK 2.14 there was another way to get the window size?
Looks like this is gdk_drawable_get_size(). Although it looks like that
is an even newer function.


--
Have you heard about the new Beowulf cluster? It's so fast, it executes
an infinite loop in 6 seconds.

Ernie Rael

unread,
Apr 22, 2022, 2:56:03 PM4/22/22
to vim...@googlegroups.com
On 4/21/22 6:20 PM, James McCoy wrote:
> On Thu, Apr 21, 2022 at 03:21:41PM -0700, Hisashi T Fujinaka wrote:
>> On Thu, 21 Apr 2022, Bram Moolenaar wrote:
>>> Yes, that makes sense, the functions were added in that patch.
>>>
>>> What I don't understand is why the header file isn't found. On my
>>> system the file included from gui_gtk_x11.c includes "gdk/gdk.h",
>>> which is found in /usr/include/gtk-3.0/gdk/gdk.h or in
>>> /usr/include/gtk-2.0/gdk/gdk.h. Both then include gdk/gdkwindow.h in
>>> the same directory which is where the declaration is found.
>>>
>>> What is different on your system?
>> You're using gtk-3. I have gtk-2.
> They were added in GDK 2.24 and gtk_widget_get_window was added in GTK
> 2.14, in case someone wants to make a patch with proper version
> checking.

I downloaded and built with gtk-2. Looking through the includes didn't
see a clue as to how to determine what version things were introduced.

However, I did come across, and am now using

gtk_window_get_size(GTK_WINDOW(gui.mainwin), &w, &h);

The docs for 2 and 3 indicate it is best used in a configure event, so
cool. And should care about GDK version.

Hoping it is available in all gtk-2 versions. If someone can inform how
to check, I'd appreciate it.

>
> Cheers,


Reply all
Reply to author
Forward
0 new messages