[PATCH 3/3] server: Get and set the console pop-up color attributes

Hugh McMaster hugh.mcmaster at outlook.com
Wed Aug 10 05:01:57 CDT 2016


Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 programs/wineconsole/wineconsole.c |    3 ++-
 server/console.c                   |    9 ++++++++-
 server/protocol.def                |    7 +++++--
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c
index babc3ef..d6efa2f 100644
--- a/programs/wineconsole/wineconsole.c
+++ b/programs/wineconsole/wineconsole.c
@@ -226,7 +226,8 @@ static void WINECON_SetColors(struct inner_data *data, const struct config_data*
     SERVER_START_REQ( set_console_output_info )
     {
         req->handle = wine_server_obj_handle( data->hConOut );
-        req->mask = SET_CONSOLE_OUTPUT_INFO_COLORTABLE;
+        req->mask = SET_CONSOLE_OUTPUT_INFO_COLORTABLE | SET_CONSOLE_OUTPUT_INFO_POPUP_ATTR;
+        req->popup_attr = cfg->popup_attr;
         wine_server_add_data( req, cfg->color_map, color_map_size );
         wine_server_call( req );
     }
diff --git a/server/console.c b/server/console.c
index 00f5d25..1cf402c 100644
--- a/server/console.c
+++ b/server/console.c
@@ -146,7 +146,8 @@ struct screen_buffer
     int                   max_width;     /* size (w-h) of the window given font size */
     int                   max_height;
     char_info_t          *data;          /* the data for each cell - a width x height matrix */
-    unsigned short        attr;          /* default attribute for screen buffer */
+    unsigned short        attr;          /* default fill attributes (screen colors) */
+    unsigned short        popup_attr;    /* pop-up color attributes */
     unsigned int          color_map[16]; /* console ColorTable */
     rectangle_t           win;           /* current visible window on the screen buffer *
 					  * as seen in wineconsole */
@@ -420,6 +421,7 @@ static struct screen_buffer *create_console_output( struct console_input *consol
     screen_buffer->cursor_x       = 0;
     screen_buffer->cursor_y       = 0;
     screen_buffer->attr           = 0x0F;
+    screen_buffer->popup_attr     = 0xF5;
     screen_buffer->win.left       = 0;
     screen_buffer->win.right      = screen_buffer->max_width - 1;
     screen_buffer->win.top        = 0;
@@ -999,6 +1001,10 @@ static int set_console_output_info( struct screen_buffer *screen_buffer,
     {
 	screen_buffer->attr = req->attr;
     }
+    if (req->mask & SET_CONSOLE_OUTPUT_INFO_POPUP_ATTR)
+    {
+        screen_buffer->popup_attr = req->popup_attr;
+    }
     if (req->mask & SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW)
     {
 	if (req->win_left < 0 || req->win_left > req->win_right ||
@@ -1691,6 +1697,7 @@ DECL_HANDLER(get_console_output_info)
         reply->width          = screen_buffer->width;
         reply->height         = screen_buffer->height;
         reply->attr           = screen_buffer->attr;
+        reply->popup_attr     = screen_buffer->popup_attr;
         reply->win_left       = screen_buffer->win.left;
         reply->win_top        = screen_buffer->win.top;
         reply->win_right      = screen_buffer->win.right;
diff --git a/server/protocol.def b/server/protocol.def
index 523e55e..efcb8a5 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -1528,7 +1528,8 @@ struct console_renderer_event
     short int    cursor_y;
     short int    width;         /* width of the screen buffer */
     short int    height;        /* height of the screen buffer */
-    short int    attr;          /* default attribute */
+    short int    attr;          /* default fill attributes (screen colors) */
+    short int    popup_attr;    /* pop-up color attributes */
     short int    win_left;      /* window actually displayed by renderer */
     short int    win_top;       /* the rect area is expressed within the */
     short int    win_right;     /* boundaries of the screen buffer */
@@ -1547,6 +1548,7 @@ struct console_renderer_event
 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE        0x20
 #define SET_CONSOLE_OUTPUT_INFO_FONT            0x40
 #define SET_CONSOLE_OUTPUT_INFO_COLORTABLE      0x80
+#define SET_CONSOLE_OUTPUT_INFO_POPUP_ATTR      0x100
 
 
 /* Get info about a console (output only) */
@@ -1559,7 +1561,8 @@ struct console_renderer_event
     short int    cursor_y;
     short int    width;         /* width of the screen buffer */
     short int    height;        /* height of the screen buffer */
-    short int    attr;          /* default attribute */
+    short int    attr;          /* default fill attributes (screen colors) */
+    short int    popup_attr;    /* pop-up color attributes */
     short int    win_left;      /* window actually displayed by renderer */
     short int    win_top;       /* the rect area is expressed within the */
     short int    win_right;     /* boundaries of the screen buffer */
-- 
2.7.4




More information about the wine-patches mailing list