… | |
… | |
10 | * Copyright (c) 1996 Chuck Blake <cblake@BBN.COM> |
10 | * Copyright (c) 1996 Chuck Blake <cblake@BBN.COM> |
11 | * Copyright (c) 1997 mj olesen <olesen@me.queensu.ca> |
11 | * Copyright (c) 1997 mj olesen <olesen@me.queensu.ca> |
12 | * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de> |
12 | * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de> |
13 | * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com> |
13 | * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com> |
14 | * - extensive modifications |
14 | * - extensive modifications |
15 | * Copyright (c) 2003-2008 Marc Lehmann <pcg@goof.com> |
15 | * Copyright (c) 2003-2008 Marc Lehmann <schmorp@schmorp.de> |
16 | * |
16 | * |
17 | * This program is free software; you can redistribute it and/or modify |
17 | * This program is free software; you can redistribute it and/or modify |
18 | * it under the terms of the GNU General Public License as published by |
18 | * it under the terms of the GNU General Public License as published by |
19 | * the Free Software Foundation; either version 2 of the License, or |
19 | * the Free Software Foundation; either version 2 of the License, or |
20 | * (at your option) any later version. |
20 | * (at your option) any later version. |
… | |
… | |
60 | #ifdef DISPLAY_IS_IP |
60 | #ifdef DISPLAY_IS_IP |
61 | /* On Solaris link with -lsocket and -lnsl */ |
61 | /* On Solaris link with -lsocket and -lnsl */ |
62 | #include <sys/types.h> |
62 | #include <sys/types.h> |
63 | #include <sys/socket.h> |
63 | #include <sys/socket.h> |
64 | |
64 | |
65 | /* these next is probably only on Sun (not Solaris) */ |
65 | /* these next two are probably only on Sun (not Solaris) */ |
66 | #ifdef HAVE_SYS_SOCKIO_H |
66 | #ifdef HAVE_SYS_SOCKIO_H |
67 | #include <sys/sockio.h> |
67 | #include <sys/sockio.h> |
|
|
68 | #endif |
|
|
69 | #ifdef HAVE_SYS_BYTEORDER_H |
|
|
70 | #include <sys/byteorder.h> |
68 | #endif |
71 | #endif |
69 | |
72 | |
70 | #include <netinet/in.h> |
73 | #include <netinet/in.h> |
71 | #include <arpa/inet.h> |
74 | #include <arpa/inet.h> |
72 | #include <net/if.h> |
75 | #include <net/if.h> |
… | |
… | |
808 | |
811 | |
809 | if (option (Opt_scrollBar)) |
812 | if (option (Opt_scrollBar)) |
810 | scrollBar.resize (); /* create and map scrollbar */ |
813 | scrollBar.resize (); /* create and map scrollbar */ |
811 | #ifdef HAVE_BG_PIXMAP |
814 | #ifdef HAVE_BG_PIXMAP |
812 | { |
815 | { |
813 | bgPixmap.set_target (this); |
816 | bg_init (); |
814 | bgPixmap.invalidate (); |
|
|
815 | |
817 | |
816 | #ifdef ENABLE_TRANSPARENCY |
818 | #ifdef ENABLE_TRANSPARENCY |
817 | if (option (Opt_transparent)) |
819 | if (option (Opt_transparent)) |
818 | { |
820 | { |
819 | bgPixmap.set_transparent (); |
821 | bg_set_transparent (); |
820 | |
822 | |
821 | if (rs [Rs_blurradius]) |
823 | if (rs [Rs_blurradius]) |
822 | bgPixmap.set_blur_radius (rs [Rs_blurradius]); |
824 | bg_set_blur (rs [Rs_blurradius]); |
823 | |
825 | |
824 | if (ISSET_PIXCOLOR (Color_tint)) |
826 | if (ISSET_PIXCOLOR (Color_tint)) |
825 | bgPixmap.set_tint (pix_colors_focused [Color_tint]); |
827 | bg_set_tint (pix_colors_focused [Color_tint]); |
826 | |
828 | |
827 | if (rs [Rs_shade]) |
829 | if (rs [Rs_shade]) |
828 | bgPixmap.set_shade (rs [Rs_shade]); |
830 | bg_set_shade (rs [Rs_shade]); |
829 | |
831 | |
830 | bgPixmap.set_root_pixmap (); |
832 | bg_set_root_pixmap (); |
831 | XSelectInput (dpy, display->root, PropertyChangeMask); |
833 | XSelectInput (dpy, display->root, PropertyChangeMask); |
832 | rootwin_ev.start (display, display->root); |
834 | rootwin_ev.start (display, display->root); |
833 | } |
835 | } |
834 | #endif |
836 | #endif |
835 | |
837 | |
… | |
… | |
839 | const char *p = rs[Rs_backgroundPixmap]; |
841 | const char *p = rs[Rs_backgroundPixmap]; |
840 | |
842 | |
841 | if ((p = strchr (p, ';')) != 0) |
843 | if ((p = strchr (p, ';')) != 0) |
842 | { |
844 | { |
843 | p++; |
845 | p++; |
844 | bgPixmap.set_geometry (p); |
846 | bg_set_geometry (p); |
845 | } |
847 | } |
846 | else |
848 | else |
847 | bgPixmap.set_defaultGeometry (); |
849 | bg_set_default_geometry (); |
848 | |
850 | |
849 | if (bgPixmap.set_file (rs[Rs_backgroundPixmap])) |
851 | if (bg_set_file (rs[Rs_backgroundPixmap])) |
850 | if (!bgPixmap.window_position_sensitive ()) |
852 | if (!bg_window_position_sensitive ()) |
851 | update_background (); |
853 | update_background (); |
852 | } |
854 | } |
853 | #endif |
855 | #endif |
854 | } |
856 | } |
855 | #endif |
857 | #endif |
… | |
… | |
872 | #if ENABLE_XEMBED |
874 | #if ENABLE_XEMBED |
873 | if (rs[Rs_embed]) |
875 | if (rs[Rs_embed]) |
874 | { |
876 | { |
875 | long info[2] = { 0, XEMBED_MAPPED }; |
877 | long info[2] = { 0, XEMBED_MAPPED }; |
876 | |
878 | |
877 | XChangeProperty (dpy, parent[0], xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO], |
879 | XChangeProperty (dpy, parent, xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO], |
878 | 32, PropModeReplace, (unsigned char *)&info, 2); |
880 | 32, PropModeReplace, (unsigned char *)&info, 2); |
879 | } |
881 | } |
880 | #endif |
882 | #endif |
881 | |
883 | |
882 | XMapWindow (dpy, vt); |
884 | XMapWindow (dpy, vt); |
883 | XMapWindow (dpy, parent[0]); |
885 | XMapWindow (dpy, parent); |
884 | |
886 | |
885 | refresh_check (); |
887 | refresh_check (); |
886 | } |
888 | } |
887 | |
889 | |
888 | /*----------------------------------------------------------------------*/ |
890 | /*----------------------------------------------------------------------*/ |
… | |
… | |
914 | |
916 | |
915 | env_display = (char *)rxvt_malloc (strlen (val) + 9); |
917 | env_display = (char *)rxvt_malloc (strlen (val) + 9); |
916 | |
918 | |
917 | sprintf (env_display, "DISPLAY=%s", val); |
919 | sprintf (env_display, "DISPLAY=%s", val); |
918 | |
920 | |
919 | sprintf (env_windowid, "WINDOWID=%lu", (unsigned long)parent[0]); |
921 | sprintf (env_windowid, "WINDOWID=%lu", (unsigned long)parent); |
920 | |
922 | |
921 | /* add entries to the environment: |
923 | /* add entries to the environment: |
922 | * @ DISPLAY: in case we started with -display |
924 | * @ DISPLAY: in case we started with -display |
923 | * @ WINDOWID: X window id number of the window |
925 | * @ WINDOWID: X window id number of the window |
924 | * @ COLORTERM: terminal sub-name and also indicates its color |
926 | * @ COLORTERM: terminal sub-name and also indicates its color |
… | |
… | |
1321 | buffer [1] = h; |
1323 | buffer [1] = h; |
1322 | |
1324 | |
1323 | for (unsigned int i = 0; i < w * h; ++i) |
1325 | for (unsigned int i = 0; i < w * h; ++i) |
1324 | buffer [i + 2] = asbuf [i]; |
1326 | buffer [i + 2] = asbuf [i]; |
1325 | |
1327 | |
1326 | XChangeProperty (dpy, parent[0], xa[XA_NET_WM_ICON], XA_CARDINAL, 32, |
1328 | XChangeProperty (dpy, parent, xa[XA_NET_WM_ICON], XA_CARDINAL, 32, |
1327 | PropModeReplace, (const unsigned char *) buffer, 2 + w * h); |
1329 | PropModeReplace, (const unsigned char *) buffer, 2 + w * h); |
1328 | free (buffer); |
1330 | free (buffer); |
1329 | } |
1331 | } |
1330 | else |
1332 | else |
1331 | rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n"); |
1333 | rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n"); |
… | |
… | |
1378 | } |
1380 | } |
1379 | |
1381 | |
1380 | row += rowstride; |
1382 | row += rowstride; |
1381 | } |
1383 | } |
1382 | |
1384 | |
1383 | XChangeProperty (dpy, parent[0], xa[XA_NET_WM_ICON], XA_CARDINAL, 32, |
1385 | XChangeProperty (dpy, parent, xa[XA_NET_WM_ICON], XA_CARDINAL, 32, |
1384 | PropModeReplace, (const unsigned char *) buffer, 2 + w * h); |
1386 | PropModeReplace, (const unsigned char *) buffer, 2 + w * h); |
1385 | free (buffer); |
1387 | free (buffer); |
1386 | } |
1388 | } |
1387 | else |
1389 | else |
1388 | rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n"); |
1390 | rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n"); |
… | |
… | |
1459 | ext_bwidth, |
1461 | ext_bwidth, |
1460 | depth, InputOutput, visual, |
1462 | depth, InputOutput, visual, |
1461 | CWColormap | CWBackPixel | CWBorderPixel | CWOverrideRedirect, |
1463 | CWColormap | CWBackPixel | CWBorderPixel | CWOverrideRedirect, |
1462 | &attributes); |
1464 | &attributes); |
1463 | |
1465 | |
1464 | this->parent[0] = top; |
1466 | this->parent = top; |
1465 | |
1467 | |
1466 | old_width = szHint.width; |
1468 | old_width = szHint.width; |
1467 | old_height = szHint.height; |
1469 | old_height = szHint.height; |
1468 | |
1470 | |
1469 | set_title (rs [Rs_title]); |
1471 | set_title (rs [Rs_title]); |