repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: 8eea6077161ec0a151b2d0b53aae5f18905857ec:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit 8eea6077161ec0a151b2d0b53aae5f18905857ec
Author: Marc Lehmann 
Date:   Wed Jan 18 19:43:51 2006 +0000

    *** empty log message ***

diff --git a/Changes b/Changes
index 4412e1cced55312d9cdde0f1ed5f8ce3338a0ade..
index ..695bbffda334b2d1e4b48cccb9cf0bf909152405 100644
--- a/Changes
+++ b/Changes
@@ -37,6 +37,8 @@ TODO: distributed clipboard example
           :-> Matching is now done on UTF-8, which makes it almost instant.
         - perl/selection, perl/selection-autotransform: regexes are now
           being interpreted in the locale urxvt was started.
+        - implemented override-redirect option and enabled it on menus,
+          as kwin puts our windows behind the terminal (what a shoddy wm).
         - fixed struct utmp check in configure for OpenBSD.
         - complete overhaul of the pty/utmp management stuff and configure
           (Emanuele Giaquinta).
diff --git a/doc/rxvt.1.pod b/doc/rxvt.1.pod
index 04df795a04c4a08d20181007de1a469697265496..
index ..0efce5bcadd10469072c47346f26f1ff2cf351c1 100644
--- a/doc/rxvt.1.pod
+++ b/doc/rxvt.1.pod
@@ -299,6 +299,11 @@ Compile I: Set MWM hints to request a borderless window, i.e.
 if honoured by the WM, the rxvt-unicode window will not have window
 decorations; resource B.

+=item B<-override-redirect>
+
+Compile I: Sets override-redirect on the window; resource
+B.
+
 =item B<-sbg>

 Compile I: Disable the usage of the built-in block graphics/line
@@ -954,18 +959,18 @@ Specify the reply rxvt-unicode sends to the shell when an ENQ (control-E)
 character is passed through. It may contain escape values as described
 in the entry on B following.

-=item B I
+=item B I

 Turn on/off secondary screen (default enabled).

-=item B I
+=item B I

 Turn on/off secondary screen scroll (default enabled). If the this
 option is enabled, scrolls on the secondary screen will change the
 scrollback buffer and switching to/from the secondary screen will
 instead scroll the screen up.

-=item B: I
+=item B: I

 Turn on/off hold window after exit support. If enabled, @@RXVT_NAME@@
 will not immediately destroy its window when the program executed within
@@ -1130,7 +1135,12 @@ C and C perl extensions.

 =item B: I

-Sets the WM_TRANSIENT_FOR property to the given window iw.
+Compile I: Sets the WM_TRANSIENT_FOR property to the given window id.
+
+=item B: I
+
+Compile I: Sets override-redirect for the terminal window, making
+it almost invisible to window managers; option B<-override-redirect>.

 =back

diff --git a/src/init.C b/src/init.C
index 63664aad616bf9d4a50c8e14733086e824321e9b..
index ..08c110b881c82943e3084d97df63605e3933c5d1 100644
--- a/src/init.C
+++ b/src/init.C
@@ -930,17 +930,25 @@ rxvt_term::create_windows (int argc, const char *const *argv)
       display->depth = gattr.depth; // doh //TODO, per-term not per-display?
     }

+  /* grab colors before netscape does */
+  Get_Colours ();
+
+  if (!set_fonts ())
+    rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n");
+
+  parent = DefaultRootWindow (disp);
+
+  attributes.override_redirect = !!OPTION (Opt_override_redirect);
+
 #if ENABLE_FRILLS
   if (OPTION (Opt_borderLess))
     {
-      prop = XInternAtom(disp, "_MOTIF_WM_INFO", True);
+      prop = XInternAtom (disp, "_MOTIF_WM_INFO", True);

       if (prop == None)
         {
           /*     print_warning("Window Manager does not support MWM hints.  Bypassing window manager control for borderless window.\n");*/
-#ifdef PREFER_24BIT
           attributes.override_redirect = TRUE;
-#endif
           mwmhints.flags = 0;
         }
       else
@@ -953,14 +961,6 @@ rxvt_term::create_windows (int argc, const char *const *argv)
     mwmhints.flags = 0;
 #endif

-  /* grab colors before netscape does */
-  Get_Colours ();
-
-  if (!set_fonts ())
-    rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n");
-
-  parent = DefaultRootWindow (disp);
-
 #if ENABLE_XEMBED
   if (rs[Rs_embed])
     {
@@ -978,7 +978,6 @@ rxvt_term::create_windows (int argc, const char *const *argv)
   window_calc (0, 0);

   /* sub-window placement & size in rxvt_resize_subwindows () */
-#ifdef PREFER_24BIT
   attributes.background_pixel = pix_colors_focused[Color_border];
   attributes.border_pixel = pix_colors_focused[Color_border];
   attributes.colormap = display->cmap;
@@ -988,15 +987,8 @@ rxvt_term::create_windows (int argc, const char *const *argv)
                        ext_bwidth,
                        display->depth, InputOutput,
                        display->visual,
-                       CWColormap | CWBackPixel | CWBorderPixel, &attributes);
-#else
-  top = XCreateSimpleWindow (disp, parent,
-                             szHint.x, szHint.y,
-                             szHint.width, szHint.height,
-                             ext_bwidth,
-                             pix_colors_focused[Color_border],
-                             pix_colors_focused[Color_border]);
-#endif
+                       CWColormap | CWBackPixel | CWBorderPixel | CWOverrideRedirect,
+                       &attributes);

   this->parent[0] = top;

diff --git a/src/optinc.h b/src/optinc.h
index efd79eda964f31ed4a07ff89a646dd24c9e9ec23..
index ..fee0e0845509901e094d1f24cab40949fae672fd 100644
--- a/src/optinc.h
+++ b/src/optinc.h
@@ -30,15 +30,17 @@
  def(insecure,             24) // insecure esc sequences
  def(borderLess,           25) // mwm borderless hints
  def(hold,                 26) // hold window open after exit
- def(skipBuiltinGlyphs,    27) // do not use internal glyphs
+ def(override_redirect,    27)
+ def(skipBuiltinGlyphs,    28) // do not use internal glyphs
 #else
  nodef(insecure)
  nodef(borderLess)
  nodef(hold)
  nodef(skipBuiltinGlyphs)
+ nodef(override_redirect)
 #endif
 #if ENABLE_STYLES
- def(intensityStyles,      28) // font styles imply intensity
+ def(intensityStyles,      29) // font styles imply intensity
 #else
  nodef(intensityStyles)
 #endif
diff --git a/src/rsinc.h b/src/rsinc.h
index 36aab7ea515a5d2b303a75841a8154ece3563670..
index ..48db0a4f26696b3306dfab1331d6c802ef58b483 100644
--- a/src/rsinc.h
+++ b/src/rsinc.h
@@ -65,6 +65,7 @@
 #endif
 #if ENABLE_FRILLS
   def (transient_for)
+  def (override_redirect)
   def (pty_fd)
   def (hold)
   def (ext_bwidth)
diff --git a/src/urxvt.pm b/src/urxvt.pm
index 6102082429fa09ea9e55aaf8e54244c327fc91c7..
index ..2e5ff7bbbecd9fb5fbce1a9257a8d4b71e77c028 100644
--- a/src/urxvt.pm
+++ b/src/urxvt.pm
@@ -961,10 +961,10 @@ source file F to see the actual list:

  borderLess console cursorBlink cursorUnderline hold iconic insecure
  intensityStyles jumpScroll loginShell mapAlert meta8 mouseWheelScrollPage
- pastableTabs pointerBlank reverseVideo scrollBar scrollBar_floating
- scrollBar_right scrollTtyKeypress scrollTtyOutput scrollWithBuffer
- secondaryScreen secondaryScroll skipBuiltinGlyphs transparent
- tripleclickwords utmpInhibit visualBell
+ override-redirect pastableTabs pointerBlank reverseVideo scrollBar
+ scrollBar_floating scrollBar_right scrollTtyKeypress scrollTtyOutput
+ scrollWithBuffer secondaryScreen secondaryScroll skipBuiltinGlyphs
+ transparent tripleclickwords utmpInhibit visualBell

 =item $value = $term->resource ($name[, $newval])

@@ -991,14 +991,15 @@ to see the actual list:
   borderLess color cursorBlink cursorUnderline cutchars delete_key
   display_name embed ext_bwidth fade font geometry hold iconName
   imFont imLocale inputMethod insecure int_bwidth intensityStyles
-  italicFont jumpScroll lineSpace loginShell mapAlert menu meta8 modifier
-  mouseWheelScrollPage name pastableTabs path perl_eval perl_ext_1 perl_ext_2
-  perl_lib pointerBlank pointerBlankDelay preeditType print_pipe pty_fd
-  reverseVideo saveLines scrollBar scrollBar_align scrollBar_floating
-  scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput
-  scrollWithBuffer scrollstyle secondaryScreen secondaryScroll selectstyle
-  shade term_name title transparent transparent_all tripleclickwords
-  utmpInhibit visualBell
+  italicFont jumpScroll lineSpace loginShell mapAlert meta8 modifier
+  mouseWheelScrollPage name override_redirect pastableTabs path perl_eval
+  perl_ext_1 perl_ext_2 perl_lib pointerBlank pointerBlankDelay
+  preeditType print_pipe pty_fd reverseVideo saveLines scrollBar
+  scrollBar_align scrollBar_floating scrollBar_right scrollBar_thickness
+  scrollTtyKeypress scrollTtyOutput scrollWithBuffer scrollstyle
+  secondaryScreen secondaryScroll selectstyle shade term_name title
+  transient_for transparent transparent_all tripleclickwords utmpInhibit
+  visualBell

 =cut

@@ -1601,7 +1602,8 @@ sub show {
    $env->{LC_CTYPE} = $self->{term}->locale;

    urxvt::term->new ($env, "popup",
-                     "--perl-lib" => "", "--perl-ext-common" => "", "-pty-fd" => -1, "-sl" => 0, "-b" => 0,
+                     "--perl-lib" => "", "--perl-ext-common" => "",
+                     "-pty-fd" => -1, "-sl" => 0, "-b" => 1, "-bd" => "grey80", "-bl", "-override-redirect",
                      "--transient-for" => $self->{term}->parent,
                      "-display" => $self->{term}->display_id,
                      "-pe" => "urxvt-popup")
diff --git a/src/xdefaults.C b/src/xdefaults.C
index fe3c2bb2d354d3f35c6bae7f638224f091667580..
index ..645a5cecb407a4f08b84e49c681eadc746052528 100644
--- a/src/xdefaults.C
+++ b/src/xdefaults.C
@@ -217,6 +217,7 @@ optList[] = {
 #endif
 #if ENABLE_FRILLS
               RSTRG (Rs_transient_for, "transient-for", "windowid"),
+              BOOL (Rs_override_redirect, "override-redirect", "override-redirect", Opt_override_redirect, "set override-redirect on the terminal window"),
               STRG (Rs_pty_fd, NULL, "pty-fd", "fileno", "file descriptor of pty to use"),
               BOOL (Rs_hold, "hold", "hold", Opt_hold, "retain window after shell exit"),
               STRG (Rs_ext_bwidth, "externalBorder", "w", "number", "external border in pixels"),

-----END OF PAGE-----