Accepting request 689377 from X11:XOrg
- n_Allow-the-greeter-to-set-the-input-fields-bg-color.patch * reverse applied in order to fix greeter again; related to our heavily adjusted xdm Xresources (boo#1130321) OBS-URL: https://build.opensuse.org/request/show/689377 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xdm?expand=0&rev=76
This commit is contained in:
commit
db9ec94c1b
156
n_Allow-the-greeter-to-set-the-input-fields-bg-color.patch
Normal file
156
n_Allow-the-greeter-to-set-the-input-fields-bg-color.patch
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
From d0e32620bfb3bc8803bffcec3f0f3b1db6440d51 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Matthieu Herrb <matthieu@herrb.eu>
|
||||||
|
Date: Sat, 14 Mar 2015 20:05:25 +0100
|
||||||
|
Subject: [PATCH] Allow the greeter to set the input fields bg color
|
||||||
|
|
||||||
|
A new 'inpColor' resource is added for that.
|
||||||
|
|
||||||
|
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
|
||||||
|
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||||
|
---
|
||||||
|
config/Xresources.in | 1 +
|
||||||
|
greeter/Login.c | 26 ++++++++++++++++++++------
|
||||||
|
greeter/Login.h | 1 +
|
||||||
|
greeter/LoginP.h | 2 ++
|
||||||
|
4 files changed, 24 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/config/Xresources.in b/config/Xresources.in
|
||||||
|
index 0a92270..c880db7 100644
|
||||||
|
--- a/config/Xresources.in
|
||||||
|
+++ b/config/Xresources.in
|
||||||
|
@@ -46,6 +46,7 @@ xlogin*innerFramesWidth: 2
|
||||||
|
xlogin*shdColor: grey30
|
||||||
|
xlogin*hiColor: grey90
|
||||||
|
xlogin*background: grey
|
||||||
|
+xlogin*inpColor: grey80
|
||||||
|
!xlogin*foreground: darkgreen
|
||||||
|
xlogin*greetColor: Blue3
|
||||||
|
xlogin*failColor: red
|
||||||
|
diff --git a/greeter/Login.c b/greeter/Login.c
|
||||||
|
index d899376..6a99050 100644
|
||||||
|
--- a/greeter/Login.c
|
||||||
|
+++ b/greeter/Login.c
|
||||||
|
@@ -156,6 +156,8 @@ static XtResource resources[] = {
|
||||||
|
offset(hipixel), XtRString, XtDefaultForeground},
|
||||||
|
{XtNshdColor, XtCForeground, XtRPixel, sizeof (Pixel),
|
||||||
|
offset(shdpixel), XtRString, XtDefaultForeground},
|
||||||
|
+ {XtNinpColor, XtCForeground, XtRPixel, sizeof (Pixel),
|
||||||
|
+ offset(inppixel), XtRString, XtDefaultBackground},
|
||||||
|
{XtNframeWidth, XtCFrameWidth, XtRInt, sizeof(int),
|
||||||
|
offset(outframewidth), XtRImmediate, (XtPointer) 1},
|
||||||
|
{XtNinnerFramesWidth, XtCFrameWidth, XtRInt, sizeof(int),
|
||||||
|
@@ -325,14 +327,14 @@ XmuXftTextWidth(Display *dpy, XftFont *font, FcChar8 *string, int len);
|
||||||
|
F_ASCENT(greet) + Y_INC(w)) + \
|
||||||
|
(n * PROMPT_SPACE_Y(w)))
|
||||||
|
#define PROMPT_W(w) (w->core.width - (2 * TEXT_X_INC(w)))
|
||||||
|
-#define PROMPT_H(w) (3 * Y_INC(w) / 2)
|
||||||
|
+#define PROMPT_H(w) (5 * Y_INC(w) / 4)
|
||||||
|
#define VALUE_X(w,n) (PROMPT_X(w) + CUR_PROMPT_W(w,n))
|
||||||
|
#define CURSOR_W 5
|
||||||
|
#define MAX_VALUE_W(w,n) (PROMPT_W(w) - VALUE_X (w,n) - CURSOR_W - 1 - \
|
||||||
|
(w->login.inframeswidth * 2) - LOGO_W(w))
|
||||||
|
#define PROMPT_SPACE_Y(w) (10 * Y_INC(w) / 5)
|
||||||
|
|
||||||
|
-#define ERROR_X(w,m) ((int)(w->core.width - STRING_WIDTH (fail, m)) / 2)
|
||||||
|
+#define ERROR_X(w,m) ((int)(w->core.width - LOGO_W(w) - STRING_WIDTH (fail, m)) / 2)
|
||||||
|
#define FAIL_X(w) ERROR_X(w, w->login.fail)
|
||||||
|
#define FAIL_Y(w) (PROMPT_Y(w,1) + 2 * FAIL_Y_INC (w) + F_ASCENT(fail))
|
||||||
|
|
||||||
|
@@ -744,14 +746,15 @@ draw_it (LoginWidget w)
|
||||||
|
int in_width = PROMPT_W(w) - VALUE_X(w,p) - LOGO_W(w);
|
||||||
|
int in_height = PROMPT_H(w) + w->login.inframeswidth + 2;
|
||||||
|
|
||||||
|
- GC topLeftGC, botRightGC;
|
||||||
|
+ GC topLeftGC, botRightGC, inpGC;
|
||||||
|
|
||||||
|
if ((PROMPT_STATE(w, p) == LOGIN_PROMPT_ECHO_ON) ||
|
||||||
|
(PROMPT_STATE(w, p) == LOGIN_PROMPT_ECHO_OFF)) {
|
||||||
|
topLeftGC = w->login.shdGC;
|
||||||
|
botRightGC = w->login.hiGC;
|
||||||
|
+ inpGC = w->login.inpGC;
|
||||||
|
} else {
|
||||||
|
- topLeftGC = botRightGC = w->login.bgGC;
|
||||||
|
+ topLeftGC = botRightGC = inpGC = w->login.bgGC;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* draw borders of editboxes */
|
||||||
|
@@ -775,6 +778,11 @@ draw_it (LoginWidget w)
|
||||||
|
in_frame_x + i-1, in_frame_y + in_height-i,
|
||||||
|
in_frame_x + in_width-i, in_frame_y + in_height-i);
|
||||||
|
}
|
||||||
|
+ XFillRectangle(XtDisplay (w), XtWindow (w), inpGC,
|
||||||
|
+ in_frame_x + w->login.inframeswidth,
|
||||||
|
+ in_frame_y + w->login.inframeswidth,
|
||||||
|
+ in_width - 2*w->login.inframeswidth,
|
||||||
|
+ in_height - 2*w->login.inframeswidth);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GREETING(w)[0]) {
|
||||||
|
@@ -1682,6 +1690,11 @@ static void Initialize (
|
||||||
|
valuemask = GCForeground | GCBackground;
|
||||||
|
w->login.shdGC = XtGetGC(gnew, valuemask, &myXGCV);
|
||||||
|
|
||||||
|
+ myXGCV.foreground = w->login.inppixel;
|
||||||
|
+ myXGCV.background = w->core.background_pixel;
|
||||||
|
+ valuemask = GCForeground | GCBackground;
|
||||||
|
+ w->login.inpGC = XtGetGC(gnew, valuemask, &myXGCV);
|
||||||
|
+
|
||||||
|
myXGCV.foreground = TEXT_COLOR(text);
|
||||||
|
myXGCV.background = w->core.background_pixel;
|
||||||
|
valuemask = GCForeground | GCBackground;
|
||||||
|
@@ -1692,10 +1705,10 @@ static void Initialize (
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
w->login.textGC = XtGetGC(gnew, valuemask, &myXGCV);
|
||||||
|
- myXGCV.foreground = w->core.background_pixel;
|
||||||
|
+ myXGCV.foreground = w->login.inppixel;
|
||||||
|
w->login.bgGC = XtGetGC(gnew, valuemask, &myXGCV);
|
||||||
|
|
||||||
|
- myXGCV.foreground = TEXT_COLOR(text) ^ w->core.background_pixel;
|
||||||
|
+ myXGCV.foreground = TEXT_COLOR(text) ^ w->login.inppixel;
|
||||||
|
myXGCV.function = GXxor;
|
||||||
|
xvaluemask = valuemask | GCFunction;
|
||||||
|
w->login.xorGC = XtGetGC (gnew, xvaluemask, &myXGCV);
|
||||||
|
@@ -1961,6 +1974,7 @@ static void Destroy (Widget gw)
|
||||||
|
#endif
|
||||||
|
XtReleaseGC(gw, w->login.hiGC);
|
||||||
|
XtReleaseGC(gw, w->login.shdGC);
|
||||||
|
+ XtReleaseGC(gw, w->login.inpGC);
|
||||||
|
|
||||||
|
#ifdef XPM
|
||||||
|
if (True == w->login.logoValid)
|
||||||
|
diff --git a/greeter/Login.h b/greeter/Login.h
|
||||||
|
index 9b5212c..6af3369 100644
|
||||||
|
--- a/greeter/Login.h
|
||||||
|
+++ b/greeter/Login.h
|
||||||
|
@@ -111,6 +111,7 @@ from The Open Group.
|
||||||
|
/* added by Amit Margalit Oct 1996 */
|
||||||
|
# define XtNhiColor "hiColor"
|
||||||
|
# define XtNshdColor "shdColor"
|
||||||
|
+# define XtNinpColor "inpColor"
|
||||||
|
# define XtNframeWidth "frameWidth"
|
||||||
|
# define XtCFrameWidth "FrameWidth"
|
||||||
|
# define XtNinnerFramesWidth "innerFramesWidth"
|
||||||
|
diff --git a/greeter/LoginP.h b/greeter/LoginP.h
|
||||||
|
index bd82ce3..57ed182 100644
|
||||||
|
--- a/greeter/LoginP.h
|
||||||
|
+++ b/greeter/LoginP.h
|
||||||
|
@@ -95,6 +95,7 @@ typedef struct {
|
||||||
|
# endif
|
||||||
|
Pixel hipixel; /* frame hilite pixel */
|
||||||
|
Pixel shdpixel; /* shadow frame pixel */
|
||||||
|
+ Pixel inppixel; /* input field bg pixel */
|
||||||
|
GC textGC; /* pointer to GraphicsContext */
|
||||||
|
GC bgGC; /* pointer to GraphicsContext */
|
||||||
|
GC xorGC; /* pointer to GraphicsContext */
|
||||||
|
@@ -105,6 +106,7 @@ typedef struct {
|
||||||
|
# endif
|
||||||
|
GC hiGC; /* for hilight part of frame */
|
||||||
|
GC shdGC; /* for shaded part of frame */
|
||||||
|
+ GC inpGC; /* for input field of frame */
|
||||||
|
char *greeting; /* greeting */
|
||||||
|
char *unsecure_greet;/* message displayed when insecure */
|
||||||
|
char *namePrompt; /* name prompt */
|
||||||
|
--
|
||||||
|
2.21.0
|
||||||
|
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Mar 28 14:03:43 UTC 2019 - Stefan Dirsch <sndirsch@suse.com>
|
||||||
|
|
||||||
|
- n_Allow-the-greeter-to-set-the-input-fields-bg-color.patch
|
||||||
|
* reverse applied in order to fix greeter again; related to our
|
||||||
|
heavily adjusted xdm Xresources (boo#1130321)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Mar 3 09:39:22 UTC 2019 - Stefan Dirsch <sndirsch@suse.com>
|
Sun Mar 3 09:39:22 UTC 2019 - Stefan Dirsch <sndirsch@suse.com>
|
||||||
|
|
||||||
|
3
xdm.spec
3
xdm.spec
@ -52,6 +52,7 @@ Patch1: xdm-tolerant-hostname-changes.diff
|
|||||||
# PATCH-FEATURE-OPENSUSE xdm-with-update-alternative.patch dimstar@opensuse.org -- Choice of default DM by means of u-a
|
# PATCH-FEATURE-OPENSUSE xdm-with-update-alternative.patch dimstar@opensuse.org -- Choice of default DM by means of u-a
|
||||||
Patch2: xdm-with-update-alternative.patch
|
Patch2: xdm-with-update-alternative.patch
|
||||||
# needed for patch0, patch2, patch3, patch4
|
# needed for patch0, patch2, patch3, patch4
|
||||||
|
Patch3: n_Allow-the-greeter-to-set-the-input-fields-bg-color.patch
|
||||||
BuildRequires: libtool
|
BuildRequires: libtool
|
||||||
BuildRequires: pam-devel
|
BuildRequires: pam-devel
|
||||||
BuildRequires: pkgconfig
|
BuildRequires: pkgconfig
|
||||||
@ -129,6 +130,8 @@ pushd xdm
|
|||||||
popd
|
popd
|
||||||
# Special note: patch 2 is applied in install section; tagging it here for the source validator only
|
# Special note: patch 2 is applied in install section; tagging it here for the source validator only
|
||||||
#patch2 -p1
|
#patch2 -p1
|
||||||
|
# reverse apply (boo#1130321)
|
||||||
|
%patch3 -p1 -R
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# needed for patch0
|
# needed for patch0
|
||||||
|
Loading…
Reference in New Issue
Block a user