… | |
… | |
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. |
… | |
… | |
55 | |
55 | |
56 | #ifdef HAVE_NL_LANGINFO |
56 | #ifdef HAVE_NL_LANGINFO |
57 | # include <langinfo.h> |
57 | # include <langinfo.h> |
58 | #endif |
58 | #endif |
59 | |
59 | |
|
|
60 | #ifdef HAVE_STARTUP_NOTIFICATION |
|
|
61 | # define SN_API_NOT_YET_FROZEN |
|
|
62 | # include <libsn/sn-launchee.h> |
|
|
63 | #endif |
|
|
64 | |
60 | #ifdef DISPLAY_IS_IP |
65 | #ifdef DISPLAY_IS_IP |
61 | /* On Solaris link with -lsocket and -lnsl */ |
66 | /* On Solaris link with -lsocket and -lnsl */ |
62 | #include <sys/types.h> |
67 | #include <sys/types.h> |
63 | #include <sys/socket.h> |
68 | #include <sys/socket.h> |
64 | |
69 | |
… | |
… | |
143 | |
148 | |
144 | return rval; |
149 | return rval; |
145 | } |
150 | } |
146 | #endif |
151 | #endif |
147 | |
152 | |
148 | const char *const def_colorName[] = |
153 | static const char *const def_colorName[] = |
149 | { |
154 | { |
150 | COLOR_FOREGROUND, |
155 | COLOR_FOREGROUND, |
151 | COLOR_BACKGROUND, |
156 | COLOR_BACKGROUND, |
152 | /* low-intensity colors */ |
157 | /* low-intensity colors */ |
153 | "rgb:00/00/00", // 0: black (Black) |
158 | "rgb:00/00/00", // 0: black (Black) |
… | |
… | |
563 | /*----------------------------------------------------------------------*/ |
568 | /*----------------------------------------------------------------------*/ |
564 | const char ** |
569 | const char ** |
565 | rxvt_term::init_resources (int argc, const char *const *argv) |
570 | rxvt_term::init_resources (int argc, const char *const *argv) |
566 | { |
571 | { |
567 | int i, r_argc; |
572 | int i, r_argc; |
568 | const char **cmd_argv, **r_argv; |
573 | const char **cmd_argv; |
569 | |
574 | |
570 | /* |
575 | /* |
571 | * Look for -e option. Find => split and make cmd_argv[] of command args |
576 | * Look for -e option. Find => split and make cmd_argv[] of command args |
572 | */ |
577 | */ |
573 | for (r_argc = 0; r_argc < argc; r_argc++) |
578 | for (r_argc = 0; r_argc < argc; r_argc++) |
… | |
… | |
586 | cmd_argv[i] = (const char *)argv[i + r_argc + 1]; |
591 | cmd_argv[i] = (const char *)argv[i + r_argc + 1]; |
587 | |
592 | |
588 | cmd_argv[i] = NULL; |
593 | cmd_argv[i] = NULL; |
589 | } |
594 | } |
590 | |
595 | |
591 | r_argv = (const char **)rxvt_malloc (sizeof (char *) * (r_argc + 1)); |
|
|
592 | |
|
|
593 | for (i = 0; i < r_argc; i++) |
|
|
594 | r_argv[i] = (const char *)argv[i]; |
|
|
595 | |
|
|
596 | r_argv[i] = NULL; |
|
|
597 | |
|
|
598 | rs[Rs_name] = rxvt_basename (argv[0]); |
596 | rs[Rs_name] = rxvt_basename (argv[0]); |
599 | |
597 | |
600 | /* |
598 | /* |
601 | * Open display, get options/resources and create the window |
599 | * Open display, get options/resources and create the window |
602 | */ |
600 | */ |
603 | |
601 | |
604 | if ((rs[Rs_display_name] = getenv ("DISPLAY")) == NULL) |
602 | if ((rs[Rs_display_name] = getenv ("DISPLAY")) == NULL) |
605 | rs[Rs_display_name] = ":0"; |
603 | rs[Rs_display_name] = ":0"; |
606 | |
604 | |
607 | get_options (r_argc, r_argv); |
605 | get_options (r_argc, argv); |
608 | |
606 | |
609 | if (!(display = displays.get (rs[Rs_display_name]))) |
607 | if (!(display = displays.get (rs[Rs_display_name]))) |
610 | { |
|
|
611 | free (r_argv); |
|
|
612 | rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); |
608 | rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); |
613 | } |
|
|
614 | |
609 | |
615 | // using a local pointer decreases code size a lot |
610 | // using a local pointer decreases code size a lot |
616 | xa = display->xa; |
611 | xa = display->xa; |
617 | |
612 | |
618 | set (display); |
613 | set (display); |
… | |
… | |
621 | #if XFT |
616 | #if XFT |
622 | if (rs[Rs_depth]) |
617 | if (rs[Rs_depth]) |
623 | select_visual (strtol (rs[Rs_depth], 0, 0)); |
618 | select_visual (strtol (rs[Rs_depth], 0, 0)); |
624 | #endif |
619 | #endif |
625 | |
620 | |
626 | free (r_argv); |
|
|
627 | |
|
|
628 | for (int i = NUM_RESOURCES; i--; ) |
621 | for (int i = NUM_RESOURCES; i--; ) |
629 | if (rs [i] == resval_undef) |
622 | if (rs [i] == resval_undef) |
630 | rs [i] = 0; |
623 | rs [i] = 0; |
631 | |
624 | |
632 | #ifdef HAVE_AFTERIMAGE |
|
|
633 | set_application_name ((char *)rs[Rs_name]); |
|
|
634 | set_output_threshold (OUTPUT_LEVEL_WARNING); |
|
|
635 | #endif |
|
|
636 | |
|
|
637 | #if ENABLE_PERL |
625 | #if ENABLE_PERL |
638 | if (!rs[Rs_perl_ext_1]) |
626 | if (!rs[Rs_perl_ext_1]) |
639 | rs[Rs_perl_ext_1] = "default"; |
627 | rs[Rs_perl_ext_1] = "default"; |
640 | |
628 | |
641 | if ((rs[Rs_perl_ext_1] && *rs[Rs_perl_ext_1]) |
629 | if ((rs[Rs_perl_ext_1] && *rs[Rs_perl_ext_1]) |
… | |
… | |
644 | { |
632 | { |
645 | rxvt_perl.init (this); |
633 | rxvt_perl.init (this); |
646 | HOOK_INVOKE ((this, HOOK_INIT, DT_END)); |
634 | HOOK_INVOKE ((this, HOOK_INIT, DT_END)); |
647 | } |
635 | } |
648 | #endif |
636 | #endif |
|
|
637 | |
|
|
638 | // must be called after initialising the perl interpreter as it |
|
|
639 | // may invoke the `on_register_command' hook |
|
|
640 | extract_keysym_resources (); |
649 | |
641 | |
650 | /* |
642 | /* |
651 | * set any defaults not already set |
643 | * set any defaults not already set |
652 | */ |
644 | */ |
653 | if (cmd_argv && cmd_argv[0]) |
645 | if (cmd_argv && cmd_argv[0]) |
… | |
… | |
762 | return cmd_argv; |
754 | return cmd_argv; |
763 | } |
755 | } |
764 | |
756 | |
765 | /*----------------------------------------------------------------------*/ |
757 | /*----------------------------------------------------------------------*/ |
766 | void |
758 | void |
767 | rxvt_term::init (int argc, const char *const *argv, stringvec *envv) |
759 | rxvt_term::init (int argc, const char *const *argv) |
768 | { |
760 | { |
769 | this->envv = envv; |
|
|
770 | |
|
|
771 | SET_R (this); |
761 | SET_R (this); |
772 | set_locale (""); |
762 | set_locale (""); |
773 | set_environ (envv); // a few things in X do not call setlocale :( |
763 | set_environ (envv); // a few things in X do not call setlocale :( |
774 | |
764 | |
775 | init_vars (); |
765 | init_vars (); |
… | |
… | |
789 | if (chdir (path)) |
779 | if (chdir (path)) |
790 | rxvt_fatal ("unable to change into specified shell working directory, aborting.\n"); |
780 | rxvt_fatal ("unable to change into specified shell working directory, aborting.\n"); |
791 | } |
781 | } |
792 | |
782 | |
793 | if (option (Opt_scrollBar)) |
783 | if (option (Opt_scrollBar)) |
794 | scrollBar.state = STATE_IDLE; /* set existence for size calculations */ |
784 | scrollBar.state = SB_STATE_IDLE; /* set existence for size calculations */ |
795 | |
785 | |
796 | pty = ptytty::create (); |
786 | pty = ptytty::create (); |
|
|
787 | |
|
|
788 | #ifdef HAVE_AFTERIMAGE |
|
|
789 | set_application_name ((char *)rs[Rs_name]); |
|
|
790 | set_output_threshold (OUTPUT_LEVEL_WARNING); |
|
|
791 | #endif |
|
|
792 | |
|
|
793 | // must be called before create_windows, because the latter may call set_icon |
|
|
794 | #ifdef HAVE_PIXBUF |
|
|
795 | g_type_init (); |
|
|
796 | #endif |
797 | |
797 | |
798 | create_windows (argc, argv); |
798 | create_windows (argc, argv); |
799 | |
799 | |
800 | init_xlocale (); |
800 | init_xlocale (); |
801 | |
801 | |
… | |
… | |
807 | |
807 | |
808 | if (option (Opt_scrollBar)) |
808 | if (option (Opt_scrollBar)) |
809 | scrollBar.resize (); /* create and map scrollbar */ |
809 | scrollBar.resize (); /* create and map scrollbar */ |
810 | #ifdef HAVE_BG_PIXMAP |
810 | #ifdef HAVE_BG_PIXMAP |
811 | { |
811 | { |
812 | bgPixmap.set_target (this); |
812 | bg_init (); |
813 | bgPixmap.invalidate (); |
|
|
814 | |
813 | |
815 | #ifdef ENABLE_TRANSPARENCY |
814 | #ifdef ENABLE_TRANSPARENCY |
816 | if (option (Opt_transparent)) |
815 | if (option (Opt_transparent)) |
817 | { |
816 | { |
818 | bgPixmap.set_transparent (); |
817 | bg_set_transparent (); |
819 | |
818 | |
820 | #ifdef HAVE_AFTERIMAGE |
|
|
821 | if (rs [Rs_blurradius]) |
819 | if (rs [Rs_blurradius]) |
822 | bgPixmap.set_blur_radius (rs [Rs_blurradius]); |
820 | bg_set_blur (rs [Rs_blurradius]); |
823 | #endif |
821 | |
824 | if (ISSET_PIXCOLOR (Color_tint)) |
822 | if (ISSET_PIXCOLOR (Color_tint)) |
825 | bgPixmap.set_tint (pix_colors_focused [Color_tint]); |
823 | bg_set_tint (pix_colors_focused [Color_tint]); |
826 | |
824 | |
827 | if (rs [Rs_shade]) |
825 | if (rs [Rs_shade]) |
828 | bgPixmap.set_shade (rs [Rs_shade]); |
826 | bg_set_shade (rs [Rs_shade]); |
829 | |
827 | |
830 | bgPixmap.set_root_pixmap (); |
828 | bg_set_root_pixmap (); |
831 | XSelectInput (dpy, display->root, PropertyChangeMask); |
829 | XSelectInput (dpy, display->root, PropertyChangeMask); |
832 | rootwin_ev.start (display, display->root); |
830 | rootwin_ev.start (display, display->root); |
833 | } |
831 | } |
834 | #endif |
832 | #endif |
835 | |
833 | |
836 | #ifdef BG_IMAGE_FROM_FILE |
834 | #ifdef BG_IMAGE_FROM_FILE |
837 | if (rs[Rs_backgroundPixmap]) |
835 | if (rs[Rs_backgroundPixmap]) |
838 | { |
836 | { |
839 | const char *p = rs[Rs_backgroundPixmap]; |
|
|
840 | |
|
|
841 | if ((p = strchr (p, ';')) != 0) |
|
|
842 | { |
|
|
843 | p++; |
|
|
844 | bgPixmap.set_geometry (p); |
|
|
845 | } |
|
|
846 | else |
|
|
847 | bgPixmap.set_defaultGeometry (); |
|
|
848 | |
|
|
849 | if (bgPixmap.set_file (rs[Rs_backgroundPixmap])) |
837 | if (bg_set_file (rs[Rs_backgroundPixmap])) |
850 | if (!bgPixmap.window_position_sensitive ()) |
838 | if (!bg_window_position_sensitive ()) |
851 | update_background (); |
839 | update_background (); |
852 | } |
840 | } |
853 | #endif |
841 | #endif |
854 | } |
842 | } |
855 | #endif |
843 | #endif |
… | |
… | |
872 | #if ENABLE_XEMBED |
860 | #if ENABLE_XEMBED |
873 | if (rs[Rs_embed]) |
861 | if (rs[Rs_embed]) |
874 | { |
862 | { |
875 | long info[2] = { 0, XEMBED_MAPPED }; |
863 | long info[2] = { 0, XEMBED_MAPPED }; |
876 | |
864 | |
877 | XChangeProperty (dpy, parent[0], xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO], |
865 | XChangeProperty (dpy, parent, xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO], |
878 | 32, PropModeReplace, (unsigned char *)&info, 2); |
866 | 32, PropModeReplace, (unsigned char *)&info, 2); |
879 | } |
867 | } |
880 | #endif |
868 | #endif |
881 | |
869 | |
|
|
870 | #if HAVE_STARTUP_NOTIFICATION |
|
|
871 | SnDisplay *snDisplay; |
|
|
872 | SnLauncheeContext *snContext; |
|
|
873 | |
|
|
874 | snDisplay = sn_display_new (dpy, NULL, NULL); |
|
|
875 | snContext = sn_launchee_context_new_from_environment (snDisplay, DefaultScreen (dpy)); |
|
|
876 | |
|
|
877 | /* Tell the window manager that this window is part of the startup context */ |
|
|
878 | if (snContext) |
|
|
879 | sn_launchee_context_setup_window (snContext, parent); |
|
|
880 | #endif |
|
|
881 | |
882 | XMapWindow (dpy, vt); |
882 | XMapWindow (dpy, vt); |
883 | XMapWindow (dpy, parent[0]); |
883 | XMapWindow (dpy, parent); |
|
|
884 | |
|
|
885 | #if HAVE_STARTUP_NOTIFICATION |
|
|
886 | if (snContext) |
|
|
887 | { |
|
|
888 | /* Mark the startup process as complete */ |
|
|
889 | sn_launchee_context_complete (snContext); |
|
|
890 | |
|
|
891 | sn_launchee_context_unref (snContext); |
|
|
892 | } |
|
|
893 | |
|
|
894 | sn_display_unref (snDisplay); |
|
|
895 | #endif |
884 | |
896 | |
885 | refresh_check (); |
897 | refresh_check (); |
886 | } |
898 | } |
887 | |
899 | |
888 | /*----------------------------------------------------------------------*/ |
900 | /*----------------------------------------------------------------------*/ |
889 | void |
901 | void |
890 | rxvt_term::init_env () |
902 | rxvt_term::init_env () |
891 | { |
903 | { |
892 | int i; |
|
|
893 | char *val; |
904 | char *val; |
894 | |
905 | |
895 | #ifdef DISPLAY_IS_IP |
906 | #ifdef DISPLAY_IS_IP |
896 | /* Fixup display_name for export over pty to any interested terminal |
907 | /* Fixup display_name for export over pty to any interested terminal |
897 | * clients via "ESC[7n" (e.g. shells). Note we use the pure IP number |
908 | * clients via "ESC[7n" (e.g. shells). Note we use the pure IP number |
… | |
… | |
911 | val = XDisplayString (dpy); |
922 | val = XDisplayString (dpy); |
912 | |
923 | |
913 | if (rs[Rs_display_name] == NULL) |
924 | if (rs[Rs_display_name] == NULL) |
914 | rs[Rs_display_name] = val; /* use broken `:0' value */ |
925 | rs[Rs_display_name] = val; /* use broken `:0' value */ |
915 | |
926 | |
916 | i = strlen (val); |
|
|
917 | env_display = (char *)rxvt_malloc (i + 9); |
927 | env_display = (char *)rxvt_malloc (strlen (val) + 9); |
918 | |
928 | |
919 | sprintf (env_display, "DISPLAY=%s", val); |
929 | sprintf (env_display, "DISPLAY=%s", val); |
920 | |
930 | |
921 | sprintf (env_windowid, "WINDOWID=%lu", (unsigned long)parent[0]); |
931 | sprintf (env_windowid, "WINDOWID=%lu", (unsigned long)parent); |
922 | |
932 | |
923 | /* add entries to the environment: |
933 | /* add entries to the environment: |
924 | * @ DISPLAY: in case we started with -display |
934 | * @ DISPLAY: in case we started with -display |
925 | * @ WINDOWID: X window id number of the window |
935 | * @ WINDOWID: X window id number of the window |
926 | * @ COLORTERM: terminal sub-name and also indicates its color |
936 | * @ COLORTERM: terminal sub-name and also indicates its color |
… | |
… | |
1323 | buffer [1] = h; |
1333 | buffer [1] = h; |
1324 | |
1334 | |
1325 | for (unsigned int i = 0; i < w * h; ++i) |
1335 | for (unsigned int i = 0; i < w * h; ++i) |
1326 | buffer [i + 2] = asbuf [i]; |
1336 | buffer [i + 2] = asbuf [i]; |
1327 | |
1337 | |
1328 | XChangeProperty (dpy, parent[0], xa[XA_NET_WM_ICON], XA_CARDINAL, 32, |
1338 | XChangeProperty (dpy, parent, xa[XA_NET_WM_ICON], XA_CARDINAL, 32, |
1329 | PropModeReplace, (const unsigned char *) buffer, 2 + w * h); |
1339 | PropModeReplace, (const unsigned char *) buffer, 2 + w * h); |
1330 | free (buffer); |
1340 | free (buffer); |
1331 | } |
1341 | } |
1332 | else |
1342 | else |
1333 | rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n"); |
1343 | rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n"); |
1334 | |
1344 | |
1335 | destroy_asimage (&result); |
1345 | destroy_asimage (&result); |
1336 | #endif |
1346 | #endif |
|
|
1347 | |
|
|
1348 | #ifdef HAVE_PIXBUF |
|
|
1349 | GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (file, NULL); |
|
|
1350 | if (!pixbuf) |
|
|
1351 | { |
|
|
1352 | rxvt_warn ("Loading image icon failed, continuing without.\n"); |
|
|
1353 | return; |
|
|
1354 | } |
|
|
1355 | |
|
|
1356 | unsigned int w = gdk_pixbuf_get_width (pixbuf); |
|
|
1357 | unsigned int h = gdk_pixbuf_get_height (pixbuf); |
|
|
1358 | |
|
|
1359 | if (!IN_RANGE_INC (w, 1, 16383) || !IN_RANGE_INC (h, 1, 16383)) |
|
|
1360 | { |
|
|
1361 | rxvt_warn ("Icon image too big, continuing without.\n"); |
|
|
1362 | g_object_unref (pixbuf); |
|
|
1363 | return; |
|
|
1364 | } |
|
|
1365 | |
|
|
1366 | if (long *buffer = (long *)malloc ((2 + w * h) * sizeof (long))) |
|
|
1367 | { |
|
|
1368 | int rowstride = gdk_pixbuf_get_rowstride (pixbuf); |
|
|
1369 | unsigned char *row = gdk_pixbuf_get_pixels (pixbuf); |
|
|
1370 | int channels = gdk_pixbuf_get_n_channels (pixbuf); |
|
|
1371 | |
|
|
1372 | buffer [0] = w; |
|
|
1373 | buffer [1] = h; |
|
|
1374 | for (int i = 0; i < h; i++) |
|
|
1375 | { |
|
|
1376 | for (int j = 0; j < w; j++) |
|
|
1377 | { |
|
|
1378 | unsigned char *pixel = row + j * channels; |
|
|
1379 | long value; |
|
|
1380 | |
|
|
1381 | if (channels == 4) |
|
|
1382 | value = pixel[3]; |
|
|
1383 | else |
|
|
1384 | value = (unsigned char)0x00ff; |
|
|
1385 | |
|
|
1386 | value = (value << 8) + pixel[0]; |
|
|
1387 | value = (value << 8) + pixel[1]; |
|
|
1388 | value = (value << 8) + pixel[2]; |
|
|
1389 | buffer[(i * w + j) + 2] = value; |
|
|
1390 | } |
|
|
1391 | |
|
|
1392 | row += rowstride; |
|
|
1393 | } |
|
|
1394 | |
|
|
1395 | XChangeProperty (dpy, parent, xa[XA_NET_WM_ICON], XA_CARDINAL, 32, |
|
|
1396 | PropModeReplace, (const unsigned char *) buffer, 2 + w * h); |
|
|
1397 | free (buffer); |
|
|
1398 | } |
|
|
1399 | else |
|
|
1400 | rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n"); |
|
|
1401 | |
|
|
1402 | g_object_unref (pixbuf); |
|
|
1403 | #endif |
1337 | } |
1404 | } |
1338 | |
1405 | |
1339 | /*----------------------------------------------------------------------*/ |
1406 | /*----------------------------------------------------------------------*/ |
1340 | /* rxvt_Create_Windows () - Open and map the window */ |
1407 | /* Open and map the window */ |
1341 | void |
1408 | void |
1342 | rxvt_term::create_windows (int argc, const char *const *argv) |
1409 | rxvt_term::create_windows (int argc, const char *const *argv) |
1343 | { |
1410 | { |
1344 | XClassHint classHint; |
1411 | XClassHint classHint; |
1345 | XWMHints wmHint; |
1412 | XWMHints wmHint; |
… | |
… | |
1391 | } |
1458 | } |
1392 | #endif |
1459 | #endif |
1393 | |
1460 | |
1394 | window_calc (0, 0); |
1461 | window_calc (0, 0); |
1395 | |
1462 | |
1396 | /* sub-window placement & size in rxvt_resize_subwindows () */ |
1463 | /* sub-window placement & size in rxvt_term::resize_all_windows () */ |
1397 | attributes.background_pixel = pix_colors_focused [Color_border]; |
1464 | attributes.background_pixel = pix_colors_focused [Color_border]; |
1398 | attributes.border_pixel = pix_colors_focused [Color_border]; |
1465 | attributes.border_pixel = pix_colors_focused [Color_border]; |
1399 | attributes.colormap = cmap; |
1466 | attributes.colormap = cmap; |
1400 | |
1467 | |
1401 | top = XCreateWindow (dpy, parent, |
1468 | top = XCreateWindow (dpy, parent, |
… | |
… | |
1404 | ext_bwidth, |
1471 | ext_bwidth, |
1405 | depth, InputOutput, visual, |
1472 | depth, InputOutput, visual, |
1406 | CWColormap | CWBackPixel | CWBorderPixel | CWOverrideRedirect, |
1473 | CWColormap | CWBackPixel | CWBorderPixel | CWOverrideRedirect, |
1407 | &attributes); |
1474 | &attributes); |
1408 | |
1475 | |
1409 | this->parent[0] = top; |
1476 | this->parent = top; |
1410 | |
1477 | |
1411 | old_width = szHint.width; |
1478 | old_width = szHint.width; |
1412 | old_height = szHint.height; |
1479 | old_height = szHint.height; |
1413 | |
1480 | |
1414 | set_title (rs [Rs_title]); |
1481 | set_title (rs [Rs_title]); |
… | |
… | |
1447 | #if ENABLE_EWMH |
1514 | #if ENABLE_EWMH |
1448 | xa[XA_NET_WM_PING], |
1515 | xa[XA_NET_WM_PING], |
1449 | #endif |
1516 | #endif |
1450 | }; |
1517 | }; |
1451 | |
1518 | |
1452 | XSetWMProtocols (dpy, top, protocols, sizeof (protocols) / sizeof (protocols[0])); |
1519 | XSetWMProtocols (dpy, top, protocols, ecb_array_length (protocols)); |
1453 | |
1520 | |
1454 | #if ENABLE_FRILLS |
1521 | #if ENABLE_FRILLS |
1455 | if (rs[Rs_transient_for]) |
1522 | if (rs[Rs_transient_for]) |
1456 | XSetTransientForHint (dpy, top, (Window)strtol (rs[Rs_transient_for], 0, 0)); |
1523 | XSetTransientForHint (dpy, top, (Window)strtol (rs[Rs_transient_for], 0, 0)); |
1457 | #endif |
1524 | #endif |