< prev index next >

src/java.desktop/aix/native/libawt_xawt/awt/awt_InputMethod.c

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -181,11 +181,10 @@
 static void draw_caret(StatusWindow *statusWindow, GC gc, int pos);
 static int  get_next_attr(int len, unsigned long *attr);
 static void draw_preedit(StatusWindow *statusWindow);
 static void align_status(StatusWindow *statusWindow);
 static void shrink_status(StatusWindow *statusWindow);
-static GC create_gc(Window win, Bool isReverse);
 static XFontSet create_fontset(void);
 static Bool is_text_available(XIMText * text);
 static Bool isNativeIm();
 static Window getGrandParent(Window parent);
 static void moveStatusWindow(StatusWindow *statusWindow);

@@ -647,14 +646,16 @@
     statusWindow->rootW = xxwa.width;
     statusWindow->lightGC = XCreateGC(dpy, status, valuemask, &values);
     XSetForeground(dpy, statusWindow->lightGC, light);
     statusWindow->dimGC = XCreateGC(dpy, status, valuemask, &values);
     XSetForeground(dpy, statusWindow->dimGC, dim);
-    statusWindow->fgGC = create_gc(status, FALSE);
+    statusWindow->fgGC = XCreateGC(dpy, status, valuemask, &values);
     XSetForeground(dpy, statusWindow->fgGC, fg);
-    statusWindow->bgGC = create_gc(status, TRUE);
+    XSetBackground(dpy, statusWindow->fgGC, bg);
+    statusWindow->bgGC = XCreateGC(dpy, status, valuemask, &values);
     XSetForeground(dpy, statusWindow->bgGC, bg);
+    XSetBackground(dpy, statusWindow->bgGC, fg);
     statusWindow->status_ready = False;
     wcscpy(statusWindow->status, L"");
     return statusWindow;
 }
 

@@ -1655,29 +1656,10 @@
       xwc.x = statusWindow->rootW - xwc.width;
     }
     XConfigureWindow(dpy, statusWindow->w, value_make, &xwc);
 }
 
-static GC create_gc(Window win, Bool isReverse)
-{
-    XGCValues xgcv;
-    unsigned long mask;
-    AwtScreenDataPtr defaultScreen;
-
-    defaultScreen = getScreenData(DefaultScreen(dpy));
-
-    mask = (GCForeground | GCBackground );
-    if (isReverse) {
-        xgcv.foreground = defaultScreen->whitepixel;
-        xgcv.background = defaultScreen->blackpixel;
-    } else {
-        xgcv.foreground = defaultScreen->blackpixel;
-        xgcv.background = defaultScreen->whitepixel;
-    }
-    return XCreateGC(dpy, win, mask, &xgcv);
-}
-
 static Bool isNativeIm()
 {
 #define XIMMODIFIER          "@im="
 #define XIM_SERVER_CATEGORY  "@server="
     char *immodifiers;
< prev index next >