]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Ah. We seem to be working with the Palette Manager again. Good.
authorBen Harris <bjh21@bjh21.me.uk>
Wed, 24 Feb 1999 21:17:06 +0000 (21:17 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Wed, 24 Feb 1999 21:17:06 +0000 (21:17 +0000)
[originally from svn r61]

mac_res.r
macterm.c

index c4814bcafcac71f478820606ba4d95b424f3361e..d20a4bc2152c522f2e5953f1b655c74531f7d99e 100644 (file)
--- a/mac_res.r
+++ b/mac_res.r
@@ -1,4 +1,4 @@
-/* $Id: mac_res.r,v 1.1.2.3 1999/02/24 01:29:10 ben Exp $ */
+/* $Id: mac_res.r,v 1.1.2.4 1999/02/24 21:17:05 ben Exp $ */
 /* PuTTY resources */
 
 #define PICT_RezTemplateVersion 1
@@ -312,7 +312,7 @@ resource 'DITL' (wFatal, "fatalbox", purgeable) {
 
 /* Terminal window */
 
-resource 'WIND' (PREF_pltt_ID, "terminal", purgeable) {
+resource 'WIND' (wTerminal, "terminal", purgeable) {
     { 0, 0, 200, 200 },
     zoomDocProc,
     invisible,
@@ -322,7 +322,7 @@ resource 'WIND' (PREF_pltt_ID, "terminal", purgeable) {
     staggerParentWindowScreen
 };
 
-resource 'pltt' (wTerminal, "terminal", purgeable) {
+resource 'pltt' (PREF_pltt_ID, "terminal", purgeable) {
     {
        0x0000, 0x0000, 0x0000, pmTolerant, 0x2000,     /* black */
        0x5555, 0x5555, 0x5555, pmTolerant, 0x2000,     /* bright black */
index d4400ad7130aca072d26f4bcd883e6fb6b4b66f9..08179aacacdb3b19f245631055ba45d4fcc5a18a 100644 (file)
--- a/macterm.c
+++ b/macterm.c
@@ -66,6 +66,8 @@ void mac_newsession(void) {
     cfg.try_palette = FALSE;
     cfg.bold_colour = TRUE;
     cfg.colours = GetNewPalette(PREF_pltt_ID);
+    if (cfg.colours == NULL)
+       fatalbox("Failed to get default palette");
     onlysession = s;
        
     /* XXX: Own storage management? */
@@ -78,8 +80,9 @@ void mac_newsession(void) {
     term_size(24, 80, 100);
     mac_initfont(s);
     mac_initpalette(s);
-    /* Set to TRUE to get palette updates in the background. */
-    SetPalette(s->window, s->palette, FALSE); 
+    /* Set to FALSE to not get palette updates in the background. */
+    SetPalette(s->window, s->palette, TRUE); 
+    ActivatePalette(s->window);
     ShowWindow(s->window);
     inbuf_putstr("\033[1mBold\033[m    \033[2mfaint\033[m   \033[3mitalic\033[m  \033[4mu_line\033[m  "
                  "\033[5mslow bl\033[m \033[6mfast bl\033[m \033[7minverse\033[m \033[8mconceal\033[m "
@@ -115,7 +118,11 @@ static void mac_initfont(struct mac_session *s) {
 
 static void mac_initpalette(struct mac_session *s) {
 
-    s->palette = NewPalette(0, NULL, 0, 0);
+    if (mac_qdversion == gestaltOriginalQD)
+       return;
+    s->palette = NewPalette((*cfg.colours)->pmEntries, NULL, pmCourteous, 0);
+    if (s->palette == NULL)
+       fatalbox("Unable to create palette");
     CopyPalette(cfg.colours, s->palette, 0, 0, (*cfg.colours)->pmEntries);
 }