freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2-demos] master 18cdd48: * graph/x11/grx11.c (gr_x11_surface_in


From: Alexei Podtelezhnikov
Subject: [freetype2-demos] master 18cdd48: * graph/x11/grx11.c (gr_x11_surface_init): Clean up window creation.
Date: Mon, 1 Oct 2018 22:13:30 -0400 (EDT)

branch: master
commit 18cdd48175d759ae100153b385aa46cf9490eff8
Author: Alexei Podtelezhnikov <address@hidden>
Commit: Alexei Podtelezhnikov <address@hidden>

    * graph/x11/grx11.c (gr_x11_surface_init): Clean up window creation.
---
 ChangeLog         |  4 ++++
 graph/x11/grx11.c | 50 +++++++++++++-------------------------------------
 2 files changed, 17 insertions(+), 37 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 366830d..b54254f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2018-10-01  Alexei Podtelezhnikov  <address@hidden>
+
+       * graph/x11/grx11.c (gr_x11_surface_init): Clean up window creation.
+
 2018-09-29  Alexei Podtelezhnikov  <address@hidden>
 
        * src/ftstring.c (Render_Waterfall): Mark the status size.
diff --git a/graph/x11/grx11.c b/graph/x11/grx11.c
index 87e08c8..cf064e3 100644
--- a/graph/x11/grx11.c
+++ b/graph/x11/grx11.c
@@ -1227,11 +1227,11 @@ typedef  unsigned long   uint32;
                    (unsigned int)x_event.xexpose.width,
                    (unsigned int)x_event.xexpose.height );
 #else
-        gr_x11_surface_refresh_rectangle( surface,
-                                          x_event.xexpose.x,
-                                          x_event.xexpose.y,
-                                          x_event.xexpose.width,
-                                          x_event.xexpose.height );
+        gr_x11_surface_refresh_rect( surface,
+                                     x_event.xexpose.x,
+                                     x_event.xexpose.y,
+                                     x_event.xexpose.width,
+                                     x_event.xexpose.height );
 #endif
         break;
 
@@ -1340,39 +1340,31 @@ typedef  unsigned long   uint32;
       return 0;
 
     {
-      XColor                color, dummy;
-      XTextProperty         xtp;
-      XSizeHints            xsh;
+      XTextProperty         xtp = { (unsigned char*)"FreeType", 31, 8, 8 };
+      XSizeHints            xsh = { 0 };
       XSetWindowAttributes  xswa;
-      unsigned long         xswa_mask = CWBackPixel | CWEventMask | CWCursor;
+      unsigned long         xswa_mask = CWEventMask | CWCursor;
 
       pid_t                 pid;
       Atom                  NET_WM_PID;
 
 
-      xswa.border_pixel = BlackPixel( display, screen );
+      xswa.cursor     = x11dev.busy;
+      xswa.event_mask = KeyPressMask | ExposureMask;
 
-      if (surface->visual == DefaultVisual( display, screen ) )
-      {
-        xswa.background_pixel = WhitePixel( display, screen );
+      if ( surface->visual == DefaultVisual( display, screen ) )
         surface->colormap     = DefaultColormap( display, screen );
-      }
       else
       {
-        xswa_mask             |= CWColormap | CWBorderPixel;
+        xswa_mask            |= CWBorderPixel | CWColormap;
+        xswa.border_pixel     = BlackPixel( display, screen );
         xswa.colormap         = XCreateColormap( display,
                                                  RootWindow( display, screen ),
                                                  surface->visual,
                                                  AllocNone );
-        XAllocNamedColor( display, xswa.colormap, "white", &color, &dummy );
-        xswa.background_pixel = color.pixel;
         surface->colormap     = xswa.colormap;
       }
 
-      xswa.cursor           = x11dev.busy;
-
-      xswa.event_mask = KeyPressMask | ExposureMask;
-
       surface->win = XCreateWindow( display,
                                     RootWindow( display, screen ),
                                     0,
@@ -1393,20 +1385,6 @@ typedef  unsigned long   uint32;
       XSetForeground( display, surface->gc, xswa.border_pixel     );
       XSetBackground( display, surface->gc, xswa.background_pixel );
 
-      /* make window manager happy :-) */
-      xtp.value    = (unsigned char*)"FreeType";
-      xtp.encoding = 31;
-      xtp.format   = 8;
-      xtp.nitems   = strlen( (char*)xtp.value );
-
-      xsh.x = 0;
-      xsh.y = 0;
-
-      xsh.width  = bitmap->width;
-      xsh.height = bitmap->rows;
-      xsh.flags  = PPosition | PSize;
-      xsh.flags  = 0;
-
       XSetWMProperties( display, surface->win, &xtp, &xtp,
                         NULL, 0, &xsh, NULL, NULL );
 
@@ -1422,8 +1400,6 @@ typedef  unsigned long   uint32;
     surface->root.set_title    = (grSetTitleFunc)   gr_x11_surface_set_title;
     surface->root.listen_event = 
(grListenEventFunc)gr_x11_surface_listen_event;
 
-    gr_x11_surface_refresh( surface );
-
     return 1;
   }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]