1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 04:48:06 +01:00

fix for soemthing wrong with piped menus

This commit is contained in:
kojima
2002-02-15 21:30:42 +00:00
parent a26b723c5a
commit 5873385d32
7 changed files with 79 additions and 33 deletions

View File

@@ -80,6 +80,8 @@ wmaker_SOURCES = \
usermenu.h \ usermenu.h \
xdnd.h \ xdnd.h \
xdnd.c \ xdnd.c \
xinerama.h \
xinerama.c \
xmodifier.h \ xmodifier.h \
xmodifier.c \ xmodifier.c \
xutil.c \ xutil.c \

View File

@@ -48,6 +48,7 @@
#include "winspector.h" #include "winspector.h"
#include "workspace.h" #include "workspace.h"
#include "wsound.h" #include "wsound.h"
#include "xinerama.h"
#ifdef GNOME_STUFF #ifdef GNOME_STUFF
# include "gnome.h" # include "gnome.h"
@@ -425,13 +426,13 @@ wMaximizeWindow(WWindow *wwin, int directions)
&& !(directions & MAX_IGNORE_XINERAMA)) { && !(directions & MAX_IGNORE_XINERAMA)) {
WScreen *scr = wwin->screen_ptr; WScreen *scr = wwin->screen_ptr;
WMRect rect; WMRect rect;
rect = wGetRectForHead(scr, wGetHeadForWindow(wwin)); rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
totalArea.x1 = rect.pos.x; totalArea.x1 = rect.pos.x;
totalArea.y1 = rect.pos.y; totalArea.y1 = rect.pos.y;
totalArea.x2 = totalArea.x1 + rect.size.width; totalArea.x2 = totalArea.x1 + rect.size.width;
totalArea.y2 = totalArea.y1 + rect.size.height; totalArea.y2 = totalArea.y1 + rect.size.height;
usableArea.x1 = WMAX(totalArea.x1, usableArea.x1); usableArea.x1 = WMAX(totalArea.x1, usableArea.x1);
usableArea.y1 = WMAX(totalArea.y1, usableArea.y1); usableArea.y1 = WMAX(totalArea.y1, usableArea.y1);
usableArea.x2 = WMIN(totalArea.x2, usableArea.x2); usableArea.x2 = WMIN(totalArea.x2, usableArea.x2);
@@ -490,7 +491,7 @@ wMaximizeWindow(WWindow *wwin, int directions)
wWindowCropSize(wwin, usableArea.x2-usableArea.x1, wWindowCropSize(wwin, usableArea.x2-usableArea.x1,
usableArea.y2-usableArea.y1, usableArea.y2-usableArea.y1,
&new_width, &new_height); &new_width, &new_height);
wWindowConfigure(wwin, new_x, new_y, new_width, new_height); wWindowConfigure(wwin, new_x, new_y, new_width, new_height);

View File

@@ -60,11 +60,31 @@
#include "window.h" #include "window.h"
#include "actions.h" #include "actions.h"
#include "defaults.h" #include "defaults.h"
#include "xinerama.h"
extern WPreferences wPreferences; extern WPreferences wPreferences;
static WMPoint getCenter(WScreen *scr, int width, int height)
{
WMPoint pt;
#ifdef XINERAMA
WMRect rect;
rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
pt.x = rect.pos.x + (rect.size.width - width)/2;
pt.y = rect.pos.y + (rect.size.height - height)/2;
#else
pt.x = (scr->scr_width - width) / 2;
pt.y = (scr->scr_height - height) / 2;
#endif
return pt;
}
int int
wMessageDialog(WScreen *scr, char *title, char *message, wMessageDialog(WScreen *scr, char *title, char *message,
@@ -74,6 +94,7 @@ wMessageDialog(WScreen *scr, char *title, char *message,
Window parent; Window parent;
WWindow *wwin; WWindow *wwin;
int result; int result;
WMPoint center;
panel = WMCreateAlertPanel(scr->wmscreen, NULL, title, message, panel = WMCreateAlertPanel(scr->wmscreen, NULL, title, message,
defBtn, altBtn, othBtn); defBtn, altBtn, othBtn);
@@ -82,9 +103,10 @@ wMessageDialog(WScreen *scr, char *title, char *message,
XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0); XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0);
wwin = wManageInternalWindow(scr, parent, None, NULL,
(scr->scr_width - 400)/2, center = getCenter(scr, 400, 180);
(scr->scr_height - 180)/2, 400, 180); wwin = wManageInternalWindow(scr, parent, None, NULL, center.x, center.y,
400, 180);
wwin->client_leader = WMWidgetXID(panel->win); wwin->client_leader = WMWidgetXID(panel->win);
WMMapWidget(panel->win); WMMapWidget(panel->win);
@@ -173,7 +195,7 @@ wInputDialog(WScreen *scr, char *title, char *message, char **text)
Window parent; Window parent;
WMInputPanel *panel; WMInputPanel *panel;
char *result; char *result;
WMPoint center;
panel = WMCreateInputPanel(scr->wmscreen, NULL, title, message, *text, panel = WMCreateInputPanel(scr->wmscreen, NULL, title, message, *text,
_("OK"), _("Cancel")); _("OK"), _("Cancel"));
@@ -184,9 +206,9 @@ wInputDialog(WScreen *scr, char *title, char *message, char **text)
XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0); XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0);
wwin = wManageInternalWindow(scr, parent, None, NULL, center = getCenter(scr, 320, 160);
(scr->scr_width - 320)/2, wwin = wManageInternalWindow(scr, parent, None, NULL, center.x, center.y,
(scr->scr_height - 160)/2, 320, 160); 320, 160);
wwin->client_leader = WMWidgetXID(panel->win); wwin->client_leader = WMWidgetXID(panel->win);
@@ -753,6 +775,7 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
char *tmp; char *tmp;
int len = (instance ? strlen(instance) : 0) int len = (instance ? strlen(instance) : 0)
+ (class ? strlen(class) : 0) + 32; + (class ? strlen(class) : 0) + 32;
WMPoint center;
tmp = wmalloc(len); tmp = wmalloc(len);
@@ -761,9 +784,10 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
else else
strcpy(tmp, _("Icon Chooser")); strcpy(tmp, _("Icon Chooser"));
wwin = wManageInternalWindow(scr, parent, None, tmp, center = getCenter(scr, 450, 280);
(scr->scr_width - 450)/2,
(scr->scr_height - 280)/2, 450, 280); wwin = wManageInternalWindow(scr, parent, None, tmp, center.x,center.y,
450, 280);
wfree(tmp); wfree(tmp);
} }
@@ -1319,7 +1343,7 @@ wShowInfoPanel(WScreen *scr)
color2.red = 0x50; color2.red = 0x50;
color2.green = 0x50; color2.green = 0x50;
color2.blue = 0x70; color2.blue = 0x70;
logo = renderText(scr->wmscreen, "GNU Window Maker", logo = renderText(scr->wmscreen, "Window Maker",
"-*-utopia-*-r-*-*-25-*", &color1, &color2); "-*-utopia-*-r-*-*-25-*", &color1, &color2);
if (logo) { if (logo) {
WMSetLabelImagePosition(panel->name1L, WIPImageOnly); WMSetLabelImagePosition(panel->name1L, WIPImageOnly);
@@ -1332,7 +1356,7 @@ wShowInfoPanel(WScreen *scr)
WMReleaseFont(font); WMReleaseFont(font);
} }
WMSetLabelTextAlignment(panel->name1L, WACenter); WMSetLabelTextAlignment(panel->name1L, WACenter);
WMSetLabelText(panel->name1L, "GNU Window Maker"); WMSetLabelText(panel->name1L, "Window Maker");
} }
panel->name2L = WMCreateLabel(panel->win); panel->name2L = WMCreateLabel(panel->win);
@@ -1473,9 +1497,13 @@ wShowInfoPanel(WScreen *scr)
WMMapWidget(panel->win); WMMapWidget(panel->win);
wwin = wManageInternalWindow(scr, parent, None, _("Info"), {
(scr->scr_width - 382)/2, WMPoint center = getCenter(scr, 382, 230);
(scr->scr_height - 230)/2, 382, 230);
wwin = wManageInternalWindow(scr, parent, None, _("Info"),
center.x, center.y,
382, 230);
}
WSETUFLAG(wwin, no_closable, 0); WSETUFLAG(wwin, no_closable, 0);
WSETUFLAG(wwin, no_close_button, 0); WSETUFLAG(wwin, no_close_button, 0);
@@ -1587,9 +1615,13 @@ wShowLegalPanel(WScreen *scr)
XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0); XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0);
wwin = wManageInternalWindow(scr, parent, None, _("Legal"), {
(scr->scr_width - 420)/2, WMPoint center = getCenter(scr, 420, 250);
(scr->scr_height - 250)/2, 420, 250);
wwin = wManageInternalWindow(scr, parent, None, _("Legal"),
center.x, center.y,
420, 250);
}
WSETUFLAG(wwin, no_closable, 0); WSETUFLAG(wwin, no_closable, 0);
WSETUFLAG(wwin, no_close_button, 0); WSETUFLAG(wwin, no_close_button, 0);
@@ -2003,9 +2035,13 @@ wShowGNUstepPanel(WScreen *scr)
XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0); XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0);
wwin = wManageInternalWindow(scr, parent, None, _("About GNUstep"), {
(scr->scr_width - 325)/2, WMPoint center = getCenter(scr, 325, 200);
(scr->scr_height - 200)/2, 325, 200);
wwin = wManageInternalWindow(scr, parent, None, _("About GNUstep"),
center.x, center.y,
325, 200);
}
WSETUFLAG(wwin, no_closable, 0); WSETUFLAG(wwin, no_closable, 0);
WSETUFLAG(wwin, no_close_button, 0); WSETUFLAG(wwin, no_close_button, 0);

View File

@@ -1284,7 +1284,8 @@ readMenuPipe(WScreen *scr, char **file_name)
strcat(flat_file, file_name[i]); strcat(flat_file, file_name[i]);
strcat(flat_file, " "); strcat(flat_file, " ");
} }
filename = flat_file+1; filename = flat_file + (flat_file[1]=='|'?2:1);
#ifdef USECPP #ifdef USECPP
if (!wPreferences.flags.nocpp) { if (!wPreferences.flags.nocpp) {

View File

@@ -63,6 +63,8 @@
# include "openlook.h" # include "openlook.h"
#endif #endif
#include "xinerama.h"
#include <WINGs/WUtil.h> #include <WINGs/WUtil.h>
#include "defaults.h" #include "defaults.h"
@@ -698,6 +700,11 @@ wScreenInit(int screen_number)
wfree(scr); wfree(scr);
return NULL; return NULL;
} }
#ifdef XINERAMA
wInitXinerama(scr);
#endif
XDefineCursor(dpy, scr->root_win, wCursor[WCUR_ROOT]); XDefineCursor(dpy, scr->root_win, wCursor[WCUR_ROOT]);

View File

@@ -50,7 +50,6 @@ typedef struct WReservedArea {
} WReservedArea; } WReservedArea;
typedef struct WAppIconChain { typedef struct WAppIconChain {
struct WAppIcon *aicon; struct WAppIcon *aicon;
struct WAppIconChain *next; struct WAppIconChain *next;
@@ -97,7 +96,7 @@ typedef struct _WScreen {
#ifdef XINERAMA #ifdef XINERAMA
XineramaScreenInfo *xine_screens; XineramaScreenInfo *xine_screens;
int xine_count; /* 0 means not active */ int xine_count; /* 0 means not active */
int xine_primary_screen; /* main working screen */ int xine_primary_head; /* main working screen */
#endif #endif
Window no_focus_win; /* window to get focus when nobody Window no_focus_win; /* window to get focus when nobody

View File

@@ -482,13 +482,13 @@ wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace)
wwin->user_flags.emulate_appicon = 0; wwin->user_flags.emulate_appicon = 0;
//WSETUFLAG(wwin, emulate_appicon, 0); //WSETUFLAG(wwin, emulate_appicon, 0);
} }
if (wwin->transient_for!=None if (wwin->transient_for!=None
&& wwin->transient_for!=wwin->screen_ptr->root_win) && wwin->transient_for!=wwin->screen_ptr->root_win)
wwin->user_flags.emulate_appicon = 0; wwin->user_flags.emulate_appicon = 0;
//WSETUFLAG(wwin, emulate_appicon, 0); //WSETUFLAG(wwin, emulate_appicon, 0);
if (wwin->user_flags.sunken && wwin->defined_user_flags.sunken if (wwin->user_flags.sunken && wwin->defined_user_flags.sunken
&& wwin->user_flags.floating && wwin->defined_user_flags.floating) && wwin->user_flags.floating && wwin->defined_user_flags.floating)
wwin->user_flags.sunken = 0; wwin->user_flags.sunken = 0;
//WSETUFLAG(wwin, sunken, 0); //WSETUFLAG(wwin, sunken, 0);