~mdw
/
sgt
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dlg_listbox_select() now scrolls the list box to ensure that the
[sgt/putty]
/
unix
/
gtkwin.c
diff --git
a/unix/gtkwin.c
b/unix/gtkwin.c
index
5397236
..
f969b04
100644
(file)
--- a/
unix/gtkwin.c
+++ b/
unix/gtkwin.c
@@
-177,6
+177,12
@@
void ldisc_update(void *frontend, int echo, int edit)
*/
}
*/
}
+char *get_ttymode(void *frontend, const char *mode)
+{
+ struct gui_data *inst = (struct gui_data *)frontend;
+ return term_get_ttymode(inst->term, mode);
+}
+
int from_backend(void *frontend, int is_stderr, const char *data, int len)
{
struct gui_data *inst = (struct gui_data *)frontend;
int from_backend(void *frontend, int is_stderr, const char *data, int len)
{
struct gui_data *inst = (struct gui_data *)frontend;
@@
-1346,7
+1352,7
@@
static void real_palette_set(struct gui_data *inst, int n, int r, int g, int b)
gdk_colormap_free_colors(inst->colmap, inst->cols + n, 1);
gdk_colormap_alloc_colors(inst->colmap, inst->cols + n, 1,
gdk_colormap_free_colors(inst->colmap, inst->cols + n, 1);
gdk_colormap_alloc_colors(inst->colmap, inst->cols + n, 1,
- FALSE,
FALS
E, success);
+ FALSE,
TRU
E, success);
if (!success[0])
g_error("%s: couldn't allocate colour %d (#%02x%02x%02x)\n", appname,
n, r, g, b);
if (!success[0])
g_error("%s: couldn't allocate colour %d (#%02x%02x%02x)\n", appname,
n, r, g, b);
@@
-1413,7
+1419,7
@@
void palette_reset(void *frontend)
}
gdk_colormap_alloc_colors(inst->colmap, inst->cols, NALLCOLOURS,
}
gdk_colormap_alloc_colors(inst->colmap, inst->cols, NALLCOLOURS,
- FALSE,
FALS
E, success);
+ FALSE,
TRU
E, success);
for (i = 0; i < NALLCOLOURS; i++) {
if (!success[i])
g_error("%s: couldn't allocate colour %d (#%02x%02x%02x)\n",
for (i = 0; i < NALLCOLOURS; i++) {
if (!success[i])
g_error("%s: couldn't allocate colour %d (#%02x%02x%02x)\n",
@@
-1879,6
+1885,7
@@
void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len,
GdkGC *gc = dctx->gc;
int ncombining, combining;
int nfg, nbg, t, fontid, shadow, rlen, widefactor;
GdkGC *gc = dctx->gc;
int ncombining, combining;
int nfg, nbg, t, fontid, shadow, rlen, widefactor;
+ int monochrome = gtk_widget_get_visual(inst->area)->depth == 1;
if (attr & TATTR_COMBINING) {
ncombining = len;
if (attr & TATTR_COMBINING) {
ncombining = len;
@@
-1886,9
+1893,9
@@
void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len,
} else
ncombining = 1;
} else
ncombining = 1;
- nfg = ((
attr & ATTR_FGMASK
) >> ATTR_FGSHIFT);
- nbg = ((
attr & ATTR_BGMASK
) >> ATTR_BGSHIFT);
- if (
attr & ATTR_REVERSE
) {
+ nfg = ((
monochrome ? ATTR_DEFFG : (attr & ATTR_FGMASK)
) >> ATTR_FGSHIFT);
+ nbg = ((
monochrome ? ATTR_DEFBG : (attr & ATTR_BGMASK)
) >> ATTR_BGSHIFT);
+ if (
!!(attr & ATTR_REVERSE) ^ (monochrome && (attr & TATTR_ACTCURS))
) {
t = nfg;
nfg = nbg;
nbg = t;
t = nfg;
nfg = nbg;
nbg = t;
@@
-1901,7
+1908,7
@@
void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len,
if (nbg < 16) nbg |= 8;
else if (nbg >= 256) nbg |= 1;
}
if (nbg < 16) nbg |= 8;
else if (nbg >= 256) nbg |= 1;
}
- if (
attr & TATTR_ACTCURS
) {
+ if (
(attr & TATTR_ACTCURS) && !monochrome
) {
nfg = 260;
nbg = 261;
}
nfg = 260;
nbg = 261;
}