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 \
xdnd.h \
xdnd.c \
xinerama.h \
xinerama.c \
xmodifier.h \
xmodifier.c \
xutil.c \

View File

@@ -48,6 +48,7 @@
#include "winspector.h"
#include "workspace.h"
#include "wsound.h"
#include "xinerama.h"
#ifdef GNOME_STUFF
# include "gnome.h"
@@ -426,7 +427,7 @@ wMaximizeWindow(WWindow *wwin, int directions)
WScreen *scr = wwin->screen_ptr;
WMRect rect;
rect = wGetRectForHead(scr, wGetHeadForWindow(wwin));
rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
totalArea.x1 = rect.pos.x;
totalArea.y1 = rect.pos.y;
totalArea.x2 = totalArea.x1 + rect.size.width;

View File

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

View File

@@ -63,6 +63,8 @@
# include "openlook.h"
#endif
#include "xinerama.h"
#include <WINGs/WUtil.h>
#include "defaults.h"
@@ -699,6 +701,11 @@ wScreenInit(int screen_number)
return NULL;
}
#ifdef XINERAMA
wInitXinerama(scr);
#endif
XDefineCursor(dpy, scr->root_win, wCursor[WCUR_ROOT]);
/* screen descriptor for raster graphic library */

View File

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