Hello,
I try to make opaque resize.
---
WPrefs.app/Expert.c | 7 ++++-
src/WindowMaker.h | 1 +
src/defaults.c | 2 +
src/moveres.c | 60 ++++++++++++++++++++++++++++++++++++++------------
4 files changed, 53 insertions(+), 17 deletions(-)
diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c
index 5ef14a9..66a85b3 100644
--- a/WPrefs.app/Expert.c
+++ b/WPrefs.app/Expert.c
@@ -31,7 +31,7 @@ typedef struct _Panel {
WMWidget *parent;
- WMButton *swi[12];
+ WMButton *swi[13];
} _Panel;
@@ -53,6 +53,7 @@ static void showData(_Panel * panel)
WMSetButtonSelected(panel->swi[9], GetBoolForKey("ShowClipTitle"));
WMSetButtonSelected(panel->swi[10],
GetBoolForKey("BounceAppIconsWhenUrgent"));
WMSetButtonSelected(panel->swi[11],
GetBoolForKey("RaiseAppIconsWhenBouncing"));
+ WMSetButtonSelected(panel->swi[12], GetBoolForKey("OpaqueResize"));
}
static void createPanel(Panel * p)
@@ -67,7 +68,7 @@ static void createPanel(Panel * p)
sv = WMCreateScrollView(panel->box);
WMResizeWidget(sv, 500, 215);
- WMMoveWidget(sv, 12, 10);
+ WMMoveWidget(sv, 13, 10);
WMSetScrollViewRelief(sv, WRSunken);
WMSetScrollViewHasVerticalScroller(sv, True);
WMSetScrollViewHasHorizontalScroller(sv, False);
@@ -95,6 +96,7 @@ static void createPanel(Panel * p)
WMSetButtonText(panel->swi[9], _("Show workspace title on Clip."));
WMSetButtonText(panel->swi[10], _("Bounce AppIcons when the application
wants attention."));
WMSetButtonText(panel->swi[11], _("Raise AppIcons when bouncing."));
+ WMSetButtonText(panel->swi[12], _("Use OpaqueResize."));
/* If the item is default true, enable the button here */
WMSetButtonEnabled(panel->swi[6], True);
@@ -126,6 +128,7 @@ static void storeDefaults(_Panel * panel)
SetBoolForKey(WMGetButtonSelected(panel->swi[9]), "ShowClipTitle");
SetBoolForKey(WMGetButtonSelected(panel->swi[10]),
"BounceAppIconsWhenUrgent");
SetBoolForKey(WMGetButtonSelected(panel->swi[11]),
"RaiseAppIconsWhenBouncing");
+ SetBoolForKey(WMGetButtonSelected(panel->swi[12]), "OpaqueResize");
}
Panel *InitExpert(WMScreen * scr, WMWidget * parent)
diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 8293985..2d57291 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -324,6 +324,7 @@ typedef struct WPreferences {
signed char focus_mode; /* window focusing mode */
char opaque_move; /* update window position during move */
+ char opaque_resize; /* update window position during
resize */
char wrap_menus; /* wrap menus at edge of screen */
char scrollable_menus; /* let them be scrolled */
char align_menus; /* align menu with their parents */
diff --git a/src/defaults.c b/src/defaults.c
index 9f953b1..b5b646c 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -399,6 +399,8 @@ WDefaultEntry optionList[] = {
&wPreferences.use_saveunders, getBool, NULL, NULL, NULL},
{"OpaqueMove", "NO", NULL,
&wPreferences.opaque_move, getBool, NULL, NULL, NULL},
+ {"OpaqueResize", "NO", NULL,
+ &wPreferences.opaque_resize, getBool, NULL, NULL, NULL},
{"DisableAnimations", "NO", NULL,
&wPreferences.no_animations, getBool, NULL, NULL, NULL},
{"DontLinkWorkspaces", "NO", NULL,
diff --git a/src/moveres.c b/src/moveres.c
index c0bf039..106ce28 100644
--- a/src/moveres.c
+++ b/src/moveres.c
@@ -1859,6 +1859,7 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
int head = ((wPreferences.auto_arrange_icons && wXineramaHeads(scr) > 1)
? wGetHeadForWindow(wwin)
: scr->xine_info.primary_head);
+ int opaqueResize = wPreferences.opaque_resize;
if (!IS_RESIZABLE(wwin))
return;
@@ -1892,12 +1893,14 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
switch (event.type) {
case KeyPress:
showGeometry(wwin, fx, fy, fx + fw, fy + fh, res);
- if ((event.xkey.keycode == shiftl || event.xkey.keycode
== shiftr)
- && started) {
- drawTransparentFrame(wwin, fx, fy, fw, fh);
- cycleGeometryDisplay(wwin, fx, fy, fw, fh, res);
- drawTransparentFrame(wwin, fx, fy, fw, fh);
- }
+ if (!opaqueResize) {
+ if ((event.xkey.keycode == shiftl ||
event.xkey.keycode == shiftr)
+ && started) {
+ drawTransparentFrame(wwin, fx, fy, fw,
fh);
+ cycleGeometryDisplay(wwin, fx, fy, fw,
fh, res);
+ drawTransparentFrame(wwin, fx, fy, fw,
fh);
+ }
+ };
showGeometry(wwin, fx, fy, fx + fw, fy + fh, res);
break;
@@ -1997,21 +2000,27 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
/* Draw the resize frame for the first time. */
mapGeometryDisplay(wwin, fx, fy, fw, fh);
-
- drawTransparentFrame(wwin, fx, fy, fw, fh);
-
+ if (!opaqueResize) {
+ drawTransparentFrame(wwin, fx, fy, fw,
fh);
+ };
showGeometry(wwin, fx, fy, fx + fw, fy + fh,
res);
started = 1;
}
if (started) {
if (wPreferences.size_display ==
WDIS_FRAME_CENTER) {
- drawTransparentFrame(wwin, orig_fx,
orig_fy, orig_fw, orig_fh);
+ if (!opaqueResize) {
+ drawTransparentFrame(wwin,
orig_fx, orig_fy, orig_fw, orig_fh);
+ };
moveGeometryDisplayCentered(scr, fx +
fw / 2, fy + fh / 2);
- drawTransparentFrame(wwin, fx, fy, fw,
fh);
+ if (!opaqueResize) {
+ drawTransparentFrame(wwin, fx,
fy, fw, fh);
+ };
} else {
- drawTransparentFrame(wwin, orig_fx,
orig_fy, orig_fw, orig_fh);
- drawTransparentFrame(wwin, fx, fy, fw,
fh);
+ if (!opaqueResize) {
+ drawTransparentFrame(wwin,
orig_fx, orig_fy, orig_fw, orig_fh);
+ drawTransparentFrame(wwin, fx,
fy, fw, fh);
+ };
}
if (fh != orig_fh || fw != orig_fw) {
if (wPreferences.size_display ==
WDIS_NEW) {
@@ -2020,6 +2029,26 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
}
showGeometry(wwin, fx, fy, fx + fw, fy
+ fh, res);
}
+ if (opaqueResize) {
+ showGeometry(wwin, fx, fy, fx + fw, fy
+ fh, res);
+
+
+ XUngrabKeyboard(dpy, CurrentTime);
+ WMUnmapWidget(scr->gview);
+ XUngrabServer(dpy);
+
+ if (wwin->client.width != fw) {
+ wwin->flags.user_changed_width
= 1;
+ wwin->flags.maximized &=
~(MAX_HORIZONTAL | MAX_MAXIMUS);
+ }
+
+ if (wwin->client.height != fh -
vert_border) {
+ wwin->flags.user_changed_height
= 1;
+ wwin->flags.maximized &=
~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS);
+ }
+
+ wWindowConfigure(wwin, fx, fy, fw, fh -
vert_border);
+ };
}
break;
@@ -2033,8 +2062,9 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
if (started) {
showGeometry(wwin, fx, fy, fx + fw, fy + fh,
res);
- drawTransparentFrame(wwin, fx, fy, fw, fh);
-
+ if (!opaqueResize) {
+ drawTransparentFrame(wwin, fx, fy, fw,
fh);
+ }
XUngrabKeyboard(dpy, CurrentTime);
WMUnmapWidget(scr->gview);
XUngrabServer(dpy);