Color patch for GTK2 build

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

Color patch for GTK2 build

Larson, David

The GTK2 build swaps the red and blue foreground colors. The following patch fixes the problem. This patch is made on version 7.1.39.

 

*** vim71/src/gui.c     2007-07-26 12:31:38.000000000 -0700

--- gui.c       2007-07-26 12:31:22.000000000 -0700

***************

*** 2132,2137 ****

--- 2132,2141 ----

  #if defined(AMIGA) || defined(RISCOS)

        gui_mch_set_colors(fg_color, bg_color);

  #else

+ #ifdef HAVE_GTK2

+         /* GTK2 has the red and blue foreground colors swapped */

+         fg_color = ((fg_color & 0xFF)<<16) | (fg_color & 0xFF00) | (fg_color >> 16);

+ #endif

        gui_mch_set_fg_color(fg_color);

        gui_mch_set_bg_color(bg_color);

  #endif

 

 


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Color patch for GTK2 build

Larson, David

The GTK2 build swaps the red and blue foreground colors. The following patch fixes the problem. This patch is made on version 7.1.39.

*** vim71/src/gui.c     2007-07-26 12:31:38.000000000 -0700
--- gui.c       2007-07-26 12:31:22.000000000 -0700
***************
*** 2132,2137 ****
--- 2132,2141 ----
  #if defined(AMIGA) || defined(RISCOS)
        gui_mch_set_colors(fg_color, bg_color);
  #else
+ #ifdef HAVE_GTK2
+         /* GTK2 has the red and blue foreground colors swapped */
+         fg_color = ((fg_color & 0xFF)<<16) | (fg_color & 0xFF00) | (fg_color >> 16);
+ #endif
        gui_mch_set_fg_color(fg_color);
        gui_mch_set_bg_color(bg_color);
  #endif


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

RE: Color patch for GTK2 build

Larson, David
In reply to this post by Larson, David

Sorry for all the resends. These messages did no show up for hours, so I thought they were lost. L

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Larson, David
Sent: Thursday, July 26, 2007 12:35 PM
To: [hidden email]
Subject: Color patch for GTK2 build

 

The GTK2 build swaps the red and blue foreground colors. The following patch fixes the problem. This patch is made on version 7.1.39.

 

*** vim71/src/gui.c     2007-07-26 12:31:38.000000000 -0700

--- gui.c       2007-07-26 12:31:22.000000000 -0700

***************

*** 2132,2137 ****

--- 2132,2141 ----

  #if defined(AMIGA) || defined(RISCOS)

        gui_mch_set_colors(fg_color, bg_color);

  #else

+ #ifdef HAVE_GTK2

+         /* GTK2 has the red and blue foreground colors swapped */

+         fg_color = ((fg_color & 0xFF)<<16) | (fg_color & 0xFF00) | (fg_color >> 16);

+ #endif

        gui_mch_set_fg_color(fg_color);

        gui_mch_set_bg_color(bg_color);

  #endif

 

 



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


Reply | Threaded
Open this post in threaded view
|

Re: Color patch for GTK2 build

Bram Moolenaar
In reply to this post by Larson, David


David Larson wrote:

> The GTK2 build swaps the red and blue foreground colors. The following patch fixes the problem. This patch is made on version 7.1.39.
>
> *** vim71/src/gui.c     2007-07-26 12:31:38.000000000 -0700
> --- gui.c       2007-07-26 12:31:22.000000000 -0700
> ***************
> *** 2132,2137 ****
> --- 2132,2141 ----
>   #if defined(AMIGA) || defined(RISCOS)
>         gui_mch_set_colors(fg_color, bg_color);
>   #else
> + #ifdef HAVE_GTK2
> +         /* GTK2 has the red and blue foreground colors swapped */
> +         fg_color = ((fg_color & 0xFF)<<16) | (fg_color & 0xFF00) | (fg_color >> 16);
> + #endif
>         gui_mch_set_fg_color(fg_color);
>         gui_mch_set_bg_color(bg_color);
>   #endif

I'm pretty sure it works fine without this change for most people.
Perhaps there is something different about your GTK installation?

--
A fine is a tax for doing wrong.  A tax is a fine for doing well.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---