mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-18 20:10:29 +01:00
*** empty log message ***
This commit is contained in:
@@ -7,7 +7,11 @@ Changes since version 0.52.0:
|
||||
- changed configuration updating to use notifications
|
||||
- fixed window move through workspaces in nonopaquemove
|
||||
- added message to immediately reread configuration data
|
||||
|
||||
- fixed some bug in XKB modelock toggling
|
||||
- KDE: added kfm icon selection
|
||||
- fixed crash bug when hiding apps with appicon disabled
|
||||
- fixed wrong initial workspace # being shown on attributes panel
|
||||
- XSMP updates
|
||||
|
||||
Changes since version 0.51.2:
|
||||
.............................
|
||||
|
||||
21
README.KDE
21
README.KDE
@@ -39,17 +39,20 @@ Management X11R6 style SM is being worked.
|
||||
|
||||
Dock kpanel, GNOME panel and Dock kpanel
|
||||
|
||||
Built-in Yes No
|
||||
krootbgwm
|
||||
|
||||
GNOME support Yes No
|
||||
|
||||
Memory Usage(1) 1.85Mb Lite: 1.79Mb In KDE 1.0, 3.13Mb
|
||||
Memory Usage(1) 1.85Mb In KDE 1.0, 3.13Mb
|
||||
In KDE 1.1, probably more
|
||||
|
||||
|
||||
(1) Memory usage was tested by running wmaker and kwm at the same machine
|
||||
with the same windows, on the same screen and similar window texture
|
||||
configurations (at different times, of course). I looked in the output of
|
||||
ps -m, in the SIZE field, right after starting the window managers. The Lite
|
||||
value for wmaker, is for when it was compiled with --enable-lite.
|
||||
ps -m, in the SIZE field, right after starting the window managers.
|
||||
|
||||
|
||||
|
||||
Enabling KDE Support
|
||||
@@ -57,17 +60,7 @@ Enabling KDE Support
|
||||
|
||||
To enable KDE support in Window Maker, you must compile it after
|
||||
configuring it as follows:
|
||||
./configure --enable-kde --enable-lite
|
||||
|
||||
The --enable-lite flag is *optional*, but will reduce some memory
|
||||
usage by removing things that are duplicated in Window Maker and KDE.
|
||||
Do not enable it if you don't care about a few dozen kbytes of memory
|
||||
savings (see table above). It won't make KDE or Window Maker any
|
||||
slower/faster.
|
||||
|
||||
Then, open WPrefs and turn on the "Disable mouse actions"
|
||||
option in the Mouse related options panel. Or enable the
|
||||
DisableWSMouseActions option by hand.
|
||||
./configure --enable-kde
|
||||
|
||||
Then, just replace kwm with wmaker in your startkde script.
|
||||
If you are going to use Window Makers sound server, comment out
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
changes since wmaker 0.52.0:
|
||||
............................
|
||||
|
||||
- added int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
|
||||
|
||||
|
||||
changes since wmaker 0.51.2:
|
||||
............................
|
||||
|
||||
|
||||
@@ -911,6 +911,8 @@ int WMGetBrowserSelectedRowInColumn(WMBrowser *bPtr, int column);
|
||||
|
||||
int WMGetBrowserNumberOfColumns(WMBrowser *bPtr);
|
||||
|
||||
int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
|
||||
|
||||
WMList *WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
|
||||
|
||||
extern char *WMBrowserDidScrollNotification;
|
||||
|
||||
@@ -147,6 +147,13 @@ WMCreateBrowser(WMWidget *parent)
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr)
|
||||
{
|
||||
return bPtr->maxVisibleColumns;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns)
|
||||
{
|
||||
|
||||
@@ -95,9 +95,6 @@ typedef struct W_ColorPanel {
|
||||
WMWindow *win;
|
||||
WMFont *font8;
|
||||
WMFont *font12;
|
||||
|
||||
void *clientData;
|
||||
WMAction *action;
|
||||
|
||||
/* Common Stuff */
|
||||
WMColorWell *colorWell;
|
||||
@@ -198,9 +195,8 @@ typedef struct W_ColorPanel {
|
||||
char *configurationPath;
|
||||
|
||||
struct {
|
||||
unsigned int continuous:1;
|
||||
|
||||
unsigned int dragging:1;
|
||||
unsigned int done:1;
|
||||
} flags;
|
||||
} W_ColorPanel;
|
||||
|
||||
@@ -246,8 +242,6 @@ static int getPickerPart(W_ColorPanel *panel, int x, int y);
|
||||
static void readConfiguration(W_ColorPanel *panel);
|
||||
static void readXColors(W_ColorPanel *panel);
|
||||
|
||||
static void closeWindowCallback(WMWidget *w, void *data);
|
||||
|
||||
static Cursor magnifyGrabPointer(W_ColorPanel *panel);
|
||||
static WMPoint magnifyInitialize(W_ColorPanel *panel);
|
||||
static void magnifyPutCursor(WMWidget *w, void *data);
|
||||
@@ -316,14 +310,6 @@ static void cmykInit(W_ColorPanel *panel);
|
||||
static void hsbInit(W_ColorPanel *panel);
|
||||
|
||||
|
||||
|
||||
void
|
||||
WMSetColorPanelAction(WMColorPanel *panel, WMAction *action, void *data)
|
||||
{
|
||||
panel->action = action;
|
||||
panel->clientData = data;
|
||||
}
|
||||
|
||||
static WMColorPanel*
|
||||
makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
{
|
||||
@@ -346,7 +332,6 @@ makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
panel->win = WMCreateWindowWithStyle(scrPtr, name, WMTitledWindowMask | WMClosableWindowMask | WMResizableWindowMask);
|
||||
WMResizeWidget(panel->win, PWIDTH, PHEIGHT);
|
||||
WMSetWindowTitle(panel->win, "Colors");
|
||||
WMSetWindowCloseAction(panel->win, closeWindowCallback, panel);
|
||||
|
||||
|
||||
/* Set Default ColorPanel Mode(s) */
|
||||
@@ -514,7 +499,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
image = RRenderGradient(141, 16, &from, &to, RGRD_HORIZONTAL);
|
||||
pixmap = WMCreatePixmapFromRImage(scrPtr, image, 0);
|
||||
RDestroyImage(image);
|
||||
W_PaintText(W_VIEW(panel->grayBrightnessS), pixmap->pixmap, panel->font12, 2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, "Brightness", strlen("Brightness"));
|
||||
W_PaintText(W_VIEW(panel->grayBrightnessS), pixmap->pixmap, panel->font12, 2, 0, 100, WALeft, W_GC(scrPtr->white), False, "Brightness", strlen("Brightness"));
|
||||
WMSetSliderImage(panel->grayBrightnessS, pixmap);
|
||||
WMReleasePixmap(pixmap);
|
||||
|
||||
@@ -582,7 +567,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
|
||||
image = RRenderGradient(141, 16, &from, &to, RGRD_HORIZONTAL);
|
||||
pixmap = WMCreatePixmapFromRImage(scrPtr, image, 0);
|
||||
W_PaintText(W_VIEW(panel->rgbRedS), pixmap->pixmap, panel->font12, 2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, "Red", strlen("Red"));
|
||||
W_PaintText(W_VIEW(panel->rgbRedS), pixmap->pixmap, panel->font12, 2, 0, 100, WALeft, W_GC(scrPtr->white), False, "Red", strlen("Red"));
|
||||
RDestroyImage(image);
|
||||
WMSetSliderImage(panel->rgbRedS, pixmap);
|
||||
WMReleasePixmap(pixmap);
|
||||
@@ -609,7 +594,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
|
||||
image = RRenderGradient(141, 16, &from, &to, RGRD_HORIZONTAL);
|
||||
pixmap = WMCreatePixmapFromRImage(scrPtr, image, 0);
|
||||
W_PaintText(W_VIEW(panel->rgbGreenS), pixmap->pixmap, panel->font12, 2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, "Green", strlen("Green"));
|
||||
W_PaintText(W_VIEW(panel->rgbGreenS), pixmap->pixmap, panel->font12, 2, 0, 100, WALeft, W_GC(scrPtr->white), False, "Green", strlen("Green"));
|
||||
RDestroyImage(image);
|
||||
WMSetSliderImage(panel->rgbGreenS, pixmap);
|
||||
WMReleasePixmap(pixmap);
|
||||
@@ -636,7 +621,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
|
||||
image = RRenderGradient(141, 16, &from, &to, RGRD_HORIZONTAL);
|
||||
pixmap = WMCreatePixmapFromRImage(scrPtr, image, 0);
|
||||
W_PaintText(W_VIEW(panel->rgbBlueS), pixmap->pixmap, panel->font12, 2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, "Blue", strlen("Blue"));
|
||||
W_PaintText(W_VIEW(panel->rgbBlueS), pixmap->pixmap, panel->font12, 2, 0, 100, WALeft, W_GC(scrPtr->white), False, "Blue", strlen("Blue"));
|
||||
RDestroyImage(image);
|
||||
WMSetSliderImage(panel->rgbBlueS, pixmap);
|
||||
WMReleasePixmap(pixmap);
|
||||
@@ -689,7 +674,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
|
||||
image = RRenderGradient(141, 16, &from, &to, RGRD_HORIZONTAL);
|
||||
pixmap = WMCreatePixmapFromRImage(scrPtr, image, 0);
|
||||
W_PaintText(W_VIEW(panel->cmykCyanS), pixmap->pixmap, panel->font12, 2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, "Cyan", strlen("Cyan"));
|
||||
W_PaintText(W_VIEW(panel->cmykCyanS), pixmap->pixmap, panel->font12, 2, 0, 100, WALeft, W_GC(scrPtr->black), False, "Cyan", strlen("Cyan"));
|
||||
RDestroyImage(image);
|
||||
WMSetSliderImage(panel->cmykCyanS, pixmap);
|
||||
WMReleasePixmap(pixmap);
|
||||
@@ -716,7 +701,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
|
||||
image = RRenderGradient(141, 16, &from, &to, RGRD_HORIZONTAL);
|
||||
pixmap = WMCreatePixmapFromRImage(scrPtr, image, 0);
|
||||
W_PaintText(W_VIEW(panel->cmykMagentaS), pixmap->pixmap, panel->font12, 2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, "Magenta", strlen("Magenta"));
|
||||
W_PaintText(W_VIEW(panel->cmykMagentaS), pixmap->pixmap, panel->font12, 2, 0, 100, WALeft, W_GC(scrPtr->black), False, "Magenta", strlen("Magenta"));
|
||||
RDestroyImage(image);
|
||||
WMSetSliderImage(panel->cmykMagentaS, pixmap);
|
||||
WMReleasePixmap(pixmap);
|
||||
@@ -743,7 +728,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
|
||||
image = RRenderGradient(141, 16, &from, &to, RGRD_HORIZONTAL);
|
||||
pixmap = WMCreatePixmapFromRImage(scrPtr, image, 0);
|
||||
W_PaintText(W_VIEW(panel->cmykYellowS), pixmap->pixmap, panel->font12, 2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, "Yellow", strlen("Yellow"));
|
||||
W_PaintText(W_VIEW(panel->cmykYellowS), pixmap->pixmap, panel->font12, 2, 0, 100, WALeft, W_GC(scrPtr->black), False, "Yellow", strlen("Yellow"));
|
||||
RDestroyImage(image);
|
||||
WMSetSliderImage(panel->cmykYellowS, pixmap);
|
||||
WMReleasePixmap(pixmap);
|
||||
@@ -771,7 +756,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
|
||||
image = RRenderGradient(141, 16, &from, &to, RGRD_HORIZONTAL);
|
||||
pixmap = WMCreatePixmapFromRImage(scrPtr, image, 0);
|
||||
W_PaintText(W_VIEW(panel->cmykBlackS), pixmap->pixmap, panel->font12, 2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, "Black", strlen("Black"));
|
||||
W_PaintText(W_VIEW(panel->cmykBlackS), pixmap->pixmap, panel->font12, 2, 0, 100, WALeft, W_GC(scrPtr->black), False, "Black", strlen("Black"));
|
||||
RDestroyImage(image);
|
||||
WMSetSliderImage(panel->cmykBlackS, pixmap);
|
||||
WMReleasePixmap(pixmap);
|
||||
@@ -1013,33 +998,52 @@ WMFreeColorPanel(WMColorPanel *panel)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMCloseColorPanel(WMColorPanel *panel)
|
||||
{
|
||||
WMCloseWindow(panel->win);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMShowColorPanel(WMColorPanel *panel)
|
||||
int
|
||||
WMRunColorPanel(WMColorPanel *panel, WMWindow *owner, RColor color)
|
||||
{
|
||||
WMScreen *scr = WMWidgetScreen(panel->win);
|
||||
XEvent event;
|
||||
RHSVColor hsvcolor;
|
||||
GC bgc = W_GC(scr->black);
|
||||
GC wgc = W_GC(scr->white);
|
||||
|
||||
WMChangePanelOwner(panel->win, owner);
|
||||
|
||||
WMSetColorPanelColor(panel, color);
|
||||
panel->wheelMtrx = wheelInitMatrix(panel); /* Needs to be done After Color is set */
|
||||
|
||||
WMSetColorPanelPickerMode(panel, WMWheelModeColorPanel);
|
||||
wheelInit(panel);
|
||||
/* Maybe put this in sub-function ... Initialising selection images */
|
||||
RRGBtoHSV(&color, &hsvcolor);
|
||||
panel->colx = 2 + rint((colorWheelSize / 2.0) * (1 + (hsvcolor.saturation/255.0) * cos( hsvcolor.hue*M_PI/180.0)));
|
||||
panel->coly = 2 + rint((colorWheelSize / 2.0) * (1 + (hsvcolor.saturation/255.0) * sin(-hsvcolor.hue*M_PI/180.0)));
|
||||
wheelUpdateBrightnessGradientFromHSV(panel, hsvcolor);
|
||||
WMSetSliderValue(panel->wheelBrightnessS, 255 - hsvcolor.value);
|
||||
|
||||
panel->selectionImg = XCreatePixmap(scr->display, W_VIEW(panel->wheelFrm)->window, 4, 4, scr->depth);
|
||||
XFillRectangle(scr->display, panel->selectionImg, bgc, 0, 0, 4, 4);
|
||||
XFillRectangle(scr->display, panel->selectionImg, wgc, 1, 1, 2, 2);
|
||||
/* End of initialisation section */
|
||||
|
||||
panel->palx = customPaletteWidth/2;
|
||||
panel->paly = customPaletteHeight/2;
|
||||
|
||||
WMSetPickerMode(panel, WMWheelModeColorPanel);
|
||||
|
||||
panel->flags.done = 0;
|
||||
|
||||
WMMapWidget(panel->win);
|
||||
|
||||
while (!panel->flags.done) {
|
||||
WMNextEvent(scr->display, &event);
|
||||
WMHandleEvent(&event);
|
||||
}
|
||||
|
||||
WMCloseWindow(panel->win);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
closeWindowCallback(WMWidget *w, void *data)
|
||||
{
|
||||
W_ColorPanel *panel = (W_ColorPanel*)data;
|
||||
|
||||
WMCloseWindow(panel->win);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
readConfiguration(W_ColorPanel *panel)
|
||||
@@ -1109,7 +1113,7 @@ readXColors(W_ColorPanel *panel)
|
||||
|
||||
|
||||
void
|
||||
WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode)
|
||||
WMSetPickerMode(WMColorPanel *panel, WMColorPanelMode mode)
|
||||
{
|
||||
W_Screen *scr = WMWidgetScreen(panel->win);
|
||||
|
||||
@@ -1196,73 +1200,17 @@ WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode)
|
||||
}
|
||||
|
||||
void
|
||||
WMSetColorPanelColor(WMColorPanel *panel, WMColor *color)
|
||||
WMSetColorPanelColor(WMColorPanel *panel, RColor color)
|
||||
{
|
||||
WMScreen *scr = WMWidgetScreen(panel->win);
|
||||
RHSVColor hsvcolor;
|
||||
RColor intcolor;
|
||||
GC bgc = WMColorGC(scr->black);
|
||||
GC wgc = WMColorGC(scr->white);
|
||||
int originalHue;
|
||||
|
||||
WMSetColorWellColor(panel->colorWell, color);
|
||||
|
||||
intcolor.red = color->color.red >> 8;
|
||||
intcolor.green = color->color.green >> 8;
|
||||
intcolor.blue = color->color.blue >> 8;
|
||||
|
||||
panel->color = intcolor;
|
||||
|
||||
/* If color was set by HSB-Panel do not convert back to hsv */
|
||||
if (panel->lastChanged != WMHSBModeColorPanel) {
|
||||
|
||||
/* if color is black, hue is undetermined, so it must be restored */
|
||||
if ((panel->color.red == 0) &&
|
||||
(panel->color.green == 0) &&
|
||||
(panel->color.blue == 0) &&
|
||||
(panel->hsvcolor.hue <= 359))
|
||||
{
|
||||
originalHue = panel->hsvcolor.hue;
|
||||
RRGBtoHSV(&panel->color, &panel->hsvcolor);
|
||||
panel->hsvcolor.hue = originalHue;
|
||||
} else {
|
||||
RRGBtoHSV(&panel->color, &panel->hsvcolor);
|
||||
}
|
||||
}
|
||||
|
||||
panel->wheelMtrx = wheelInitMatrix(panel); /* Needs to be done After Color is set */
|
||||
|
||||
/* Maybe put this in a sub-function ... Initialising selected images */
|
||||
RRGBtoHSV(&intcolor, &hsvcolor);
|
||||
panel->colx = 2 + rint((colorWheelSize / 2.0) * (1 + (hsvcolor.saturation/255.0) * cos( hsvcolor.hue*M_PI/180.0)));
|
||||
panel->coly = 2 + rint((colorWheelSize / 2.0) * (1 + (hsvcolor.saturation/255.0) * sin(-hsvcolor.hue*M_PI/180.0)));
|
||||
wheelUpdateBrightnessGradientFromHSV(panel, hsvcolor);
|
||||
WMSetSliderValue(panel->wheelBrightnessS, 255 - hsvcolor.value);
|
||||
|
||||
panel->selectionImg = XCreatePixmap(scr->display, W_VIEW(panel->wheelFrm)->window, 4, 4, scr->depth);
|
||||
XFillRectangle(scr->display, panel->selectionImg, bgc, 0, 0, 4, 4);
|
||||
XFillRectangle(scr->display, panel->selectionImg, wgc, 1, 1, 2, 2);
|
||||
/* End of initialisation section */
|
||||
|
||||
panel->palx = customPaletteWidth/2;
|
||||
panel->paly = customPaletteHeight/2;
|
||||
|
||||
WMSetColorPanelPickerMode(panel, panel->mode);
|
||||
}
|
||||
|
||||
|
||||
updateSwatch(WMColorPanel *panel, RColor color)
|
||||
{
|
||||
WMScreen *scr = WMWidgetScreen(panel->win);
|
||||
WMColor *wellcolor;
|
||||
WMColor *wellcolor;
|
||||
int originalHue;
|
||||
|
||||
wellcolor = WMCreateRGBColor(scr, color.red << 8, color.green << 8, color.blue << 8, True);
|
||||
|
||||
WMSetColorWellColor(panel->colorWell, wellcolor);
|
||||
WMReleaseColor(wellcolor);
|
||||
|
||||
panel->color = color;
|
||||
|
||||
panel->color = color;
|
||||
|
||||
/* If color was set by HSB-Panel do not convert back to hsv */
|
||||
if (panel->lastChanged != WMHSBModeColorPanel) {
|
||||
@@ -1280,10 +1228,6 @@ updateSwatch(WMColorPanel *panel, RColor color)
|
||||
RRGBtoHSV(&panel->color, &panel->hsvcolor);
|
||||
}
|
||||
}
|
||||
|
||||
if (panel->action && (!panel->flags.dragging || panel->flags.continuous)) {
|
||||
(*panel->action)(panel, panel->clientData);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1292,21 +1236,21 @@ modeButtonCallback(WMWidget *w, void *data)
|
||||
W_ColorPanel *panel = (W_ColorPanel*)(data);
|
||||
|
||||
if (w == panel->wheelBtn)
|
||||
WMSetColorPanelPickerMode(panel, WMWheelModeColorPanel);
|
||||
WMSetPickerMode(panel, WMWheelModeColorPanel);
|
||||
else if (w == panel->slidersBtn)
|
||||
WMSetColorPanelPickerMode(panel, panel->slidersmode);
|
||||
WMSetPickerMode(panel, panel->slidersmode);
|
||||
else if (w == panel->customPaletteBtn)
|
||||
WMSetColorPanelPickerMode(panel, WMCustomPaletteModeColorPanel);
|
||||
WMSetPickerMode(panel, WMCustomPaletteModeColorPanel);
|
||||
else if (w == panel->colorListBtn)
|
||||
WMSetColorPanelPickerMode(panel, WMColorListModeColorPanel);
|
||||
WMSetPickerMode(panel, WMColorListModeColorPanel);
|
||||
else if (w == panel->grayBtn)
|
||||
WMSetColorPanelPickerMode(panel, WMGrayModeColorPanel);
|
||||
WMSetPickerMode(panel, WMGrayModeColorPanel);
|
||||
else if (w == panel->rgbBtn)
|
||||
WMSetColorPanelPickerMode(panel, WMRGBModeColorPanel);
|
||||
WMSetPickerMode(panel, WMRGBModeColorPanel);
|
||||
else if (w == panel->cmykBtn)
|
||||
WMSetColorPanelPickerMode(panel, WMCMYKModeColorPanel);
|
||||
WMSetPickerMode(panel, WMCMYKModeColorPanel);
|
||||
else if (w == panel->hsbBtn)
|
||||
WMSetColorPanelPickerMode(panel, WMHSBModeColorPanel);
|
||||
WMSetPickerMode(panel, WMHSBModeColorPanel);
|
||||
}
|
||||
|
||||
|
||||
@@ -1481,6 +1425,7 @@ magnifyCreateView(W_ColorPanel *panel)
|
||||
magView->attribs.save_under = True;
|
||||
|
||||
W_RealizeView(magView);
|
||||
W_MapView(magView);
|
||||
|
||||
return magView;
|
||||
}
|
||||
@@ -1492,7 +1437,7 @@ magnifyGrabPointer(W_ColorPanel *panel)
|
||||
W_Screen *scr = WMWidgetScreen(panel->win);
|
||||
Pixmap magPixmap, magPixmap2;
|
||||
Cursor magCursor;
|
||||
XColor fgColor = {0, 0,0,0, DoRed|DoGreen|DoBlue};
|
||||
XColor fgColor = {0, 0,0,0, DoRed|DoGreen|DoBlue};
|
||||
XColor bgColor = {0, 0xbf00, 0xa000, 0x5000, DoRed|DoGreen|DoBlue};
|
||||
|
||||
/* Cursor creation stuff */
|
||||
@@ -1544,6 +1489,7 @@ magnifyInitialize(W_ColorPanel *panel)
|
||||
panel->magnifyGlass->valid = True;
|
||||
|
||||
pixmap = magnifyCreatePixmap(panel);
|
||||
W_MoveView(panel->magnifyGlass->view, x - Cursor_x_hot +1, y - Cursor_y_hot +1);
|
||||
|
||||
XSetWindowBackgroundPixmap(scr->display, panel->magnifyGlass->view->window, pixmap);
|
||||
XClearWindow(scr->display, panel->magnifyGlass->view->window);
|
||||
@@ -1577,16 +1523,14 @@ magnifyPutCursor(WMWidget *w, void *data)
|
||||
|
||||
/* Create magnifying glass */
|
||||
panel->magnifyGlass = wmalloc(sizeof(MovingView));
|
||||
|
||||
panel->magnifyGlass->view = magnifyCreateView(panel);
|
||||
magCursor = magnifyGrabPointer(panel);
|
||||
|
||||
initialPosition = magnifyInitialize(panel);
|
||||
x = initialPosition.x;
|
||||
y = initialPosition.y;
|
||||
|
||||
W_MoveView(panel->magnifyGlass->view, x - Cursor_x_hot +1, y - Cursor_y_hot +1);
|
||||
W_MapView(panel->magnifyGlass->view);
|
||||
|
||||
magCursor = magnifyGrabPointer(panel);
|
||||
|
||||
while(panel->magnifyGlass->valid)
|
||||
{
|
||||
@@ -1596,7 +1540,7 @@ magnifyPutCursor(WMWidget *w, void *data)
|
||||
{
|
||||
case ButtonPress:
|
||||
if (event.xbutton.button == Button1) {
|
||||
updateSwatch(panel, panel->magnifyGlass->color);
|
||||
WMSetColorPanelColor(panel, panel->magnifyGlass->color);
|
||||
switch (panel->mode) {
|
||||
case WMWheelModeColorPanel:
|
||||
wheelInit(panel);
|
||||
@@ -1646,24 +1590,6 @@ magnifyPutCursor(WMWidget *w, void *data)
|
||||
XFreePixmap(scr->display, pixmap);
|
||||
break;
|
||||
|
||||
case FocusOut: /* fall through */
|
||||
case FocusIn:
|
||||
/*
|
||||
* Color Panel window (panel->win) lost or received focus.
|
||||
* We need to update the pixmap in the magnifying glass.
|
||||
*/
|
||||
XUngrabPointer(scr->display, CurrentTime);
|
||||
W_UnmapView(panel->magnifyGlass->view);
|
||||
|
||||
magnifyInitialize(panel);
|
||||
|
||||
W_MapView(panel->magnifyGlass->view);
|
||||
XGrabPointer (scr->display, panel->magnifyGlass->view->window, True,
|
||||
PointerMotionMask | ButtonPressMask,
|
||||
GrabModeAsync, GrabModeAsync,
|
||||
scr->rootWin, magCursor, CurrentTime);
|
||||
break;
|
||||
|
||||
default:
|
||||
WMHandleEvent(&event);
|
||||
break;
|
||||
@@ -1959,10 +1885,6 @@ wheelHandleActionEvents(XEvent *event, void *data)
|
||||
|
||||
case ButtonRelease:
|
||||
panel->flags.dragging = 0;
|
||||
if (!panel->flags.continuous) {
|
||||
if (panel->action)
|
||||
(*panel->action)(panel->action, panel->clientData);
|
||||
}
|
||||
break;
|
||||
|
||||
case MotionNotify:
|
||||
@@ -2057,7 +1979,7 @@ wheelUpdateSelection(W_ColorPanel *panel)
|
||||
{
|
||||
W_Screen *scr = WMWidgetScreen(panel->win);
|
||||
|
||||
updateSwatch(panel, panel->color);
|
||||
WMSetColorPanelColor(panel, panel->color);
|
||||
panel->lastChanged = WMWheelModeColorPanel;
|
||||
|
||||
/* Redraw color selector (and make a backup of the part it will cover) */
|
||||
@@ -2200,7 +2122,7 @@ grayBrightnessSliderCallback(WMWidget *w, void *data)
|
||||
WMSetTextFieldText(panel->grayBrightnessT, tmp);
|
||||
color.red = color.green = color.blue = rint(2.55*value);
|
||||
|
||||
updateSwatch(panel, color);
|
||||
WMSetColorPanelColor(panel, color);
|
||||
panel->lastChanged = WMGrayModeColorPanel;
|
||||
}
|
||||
|
||||
@@ -2228,7 +2150,7 @@ grayPresetButtonCallback(WMWidget *w, void *data)
|
||||
|
||||
WMSetSliderValue(panel->grayBrightnessS, rint(100.0*i/6.0));
|
||||
|
||||
updateSwatch(panel, color);
|
||||
WMSetColorPanelColor(panel, color);
|
||||
panel->lastChanged = WMGrayModeColorPanel;
|
||||
}
|
||||
|
||||
@@ -2251,7 +2173,7 @@ grayBrightnessTextFieldCallback(void *observerData, WMNotification *notification
|
||||
WMSetSliderValue(panel->grayBrightnessS, value);
|
||||
|
||||
color.red = color.green = color.blue = rint(255.0*value/100.0);
|
||||
updateSwatch(panel, color);
|
||||
WMSetColorPanelColor(panel, color);
|
||||
panel->lastChanged = WMGrayModeColorPanel;
|
||||
}
|
||||
|
||||
@@ -2281,7 +2203,7 @@ rgbSliderCallback(WMWidget *w, void *data)
|
||||
color.green = value[1];
|
||||
color.blue = value[2];
|
||||
|
||||
updateSwatch(panel, color);
|
||||
WMSetColorPanelColor(panel, color);
|
||||
panel->lastChanged = WMRGBModeColorPanel;
|
||||
}
|
||||
|
||||
@@ -2320,7 +2242,7 @@ rgbTextFieldCallback(void *observerData, WMNotification *notification)
|
||||
color.green = value[1];
|
||||
color.blue = value[2];
|
||||
|
||||
updateSwatch(panel, color);
|
||||
WMSetColorPanelColor(panel, color);
|
||||
panel->lastChanged = WMRGBModeColorPanel;
|
||||
}
|
||||
|
||||
@@ -2354,7 +2276,7 @@ cmykSliderCallback(WMWidget *w, void *data)
|
||||
color.green = rint((255.0 - (value[1] * 2.55)) * (1.0 - (value[3] / 100.0)));
|
||||
color.blue = rint((255.0 - (value[2] * 2.55)) * (1.0 - (value[3] / 100.0)));
|
||||
|
||||
updateSwatch(panel, color);
|
||||
WMSetColorPanelColor(panel, color);
|
||||
panel->lastChanged = WMCMYKModeColorPanel;
|
||||
}
|
||||
|
||||
@@ -2397,7 +2319,7 @@ cmykTextFieldCallback(void *observerData, WMNotification *notification)
|
||||
color.green = rint((255.0 - (value[1] * 2.55)) * (1.0 - (value[3] / 100.0)));
|
||||
color.blue = rint((255.0 - (value[2] * 2.55)) * (1.0 - (value[3] / 100.0)));
|
||||
|
||||
updateSwatch(panel, color);
|
||||
WMSetColorPanelColor(panel, color);
|
||||
panel->lastChanged = WMCMYKModeColorPanel;
|
||||
}
|
||||
|
||||
@@ -2430,7 +2352,7 @@ hsbSliderCallback(WMWidget *w, void *data)
|
||||
RHSVtoRGB(&panel->hsvcolor, &color);
|
||||
|
||||
panel->lastChanged = WMHSBModeColorPanel;
|
||||
updateSwatch(panel, color);
|
||||
WMSetColorPanelColor(panel, color);
|
||||
|
||||
if (w != panel->hsbBrightnessS)
|
||||
hsbUpdateBrightnessGradient(panel);
|
||||
@@ -2483,7 +2405,7 @@ hsbTextFieldCallback(void *observerData, WMNotification *notification)
|
||||
RHSVtoRGB(&panel->hsvcolor, &color);
|
||||
|
||||
panel->lastChanged = WMHSBModeColorPanel;
|
||||
updateSwatch(panel, color);
|
||||
WMSetColorPanelColor(panel, color);
|
||||
|
||||
hsbUpdateBrightnessGradient(panel);
|
||||
hsbUpdateSaturationGradient(panel);
|
||||
@@ -2509,7 +2431,7 @@ hsbUpdateBrightnessGradient(W_ColorPanel *panel)
|
||||
sliderImg = RRenderGradient(141, 16, &from, &to, RGRD_HORIZONTAL);
|
||||
sliderPxmp = WMCreatePixmapFromRImage(scr, sliderImg, 0);
|
||||
RDestroyImage(sliderImg);
|
||||
W_PaintText(W_VIEW(panel->hsbBrightnessS), sliderPxmp->pixmap, panel->font12, 2, 0, 100, WALeft, WMColorGC(scr->white), False, "Brightness", strlen("Brightness"));
|
||||
W_PaintText(W_VIEW(panel->hsbBrightnessS), sliderPxmp->pixmap, panel->font12, 2, 0, 100, WALeft, W_GC(scr->white), False, "Brightness", strlen("Brightness"));
|
||||
WMSetSliderImage(panel->hsbBrightnessS, sliderPxmp);
|
||||
WMReleasePixmap(sliderPxmp);
|
||||
}
|
||||
@@ -2535,9 +2457,9 @@ hsbUpdateSaturationGradient(W_ColorPanel *panel)
|
||||
sliderPxmp = WMCreatePixmapFromRImage(scr, sliderImg, 0);
|
||||
RDestroyImage(sliderImg);
|
||||
if (hsvcolor.value < 128)
|
||||
W_PaintText(W_VIEW(panel->hsbSaturationS), sliderPxmp->pixmap, panel->font12, 2, 0, 100, WALeft, WMColorGC(scr->white), False, "Saturation", strlen("Saturation"));
|
||||
W_PaintText(W_VIEW(panel->hsbSaturationS), sliderPxmp->pixmap, panel->font12, 2, 0, 100, WALeft, W_GC(scr->white), False, "Saturation", strlen("Saturation"));
|
||||
else
|
||||
W_PaintText(W_VIEW(panel->hsbSaturationS), sliderPxmp->pixmap, panel->font12, 2, 0, 100, WALeft, WMColorGC(scr->black), False, "Saturation", strlen("Saturation"));
|
||||
W_PaintText(W_VIEW(panel->hsbSaturationS), sliderPxmp->pixmap, panel->font12, 2, 0, 100, WALeft, W_GC(scr->black), False, "Saturation", strlen("Saturation"));
|
||||
|
||||
WMSetSliderImage(panel->hsbSaturationS, sliderPxmp);
|
||||
WMReleasePixmap(sliderPxmp);
|
||||
@@ -2567,9 +2489,9 @@ hsbUpdateHueGradient(W_ColorPanel *panel)
|
||||
sliderPxmp = WMCreatePixmapFromRImage(scr, sliderImg, 0);
|
||||
RDestroyImage(sliderImg);
|
||||
if (hsvcolor.value < 128)
|
||||
W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap, panel->font12, 2, 0, 100, WALeft, WMColorGC(scr->white), False, "Hue", strlen("Hue"));
|
||||
W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap, panel->font12, 2, 0, 100, WALeft, W_GC(scr->white), False, "Hue", strlen("Hue"));
|
||||
else
|
||||
W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap, panel->font12, 2, 0, 100, WALeft, WMColorGC(scr->black), False, "Hue", strlen("Hue"));
|
||||
W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap, panel->font12, 2, 0, 100, WALeft, W_GC(scr->black), False, "Hue", strlen("Hue"));
|
||||
|
||||
WMSetSliderImage(panel->hsbHueS, sliderPxmp);
|
||||
WMReleasePixmap(sliderPxmp);
|
||||
@@ -2689,7 +2611,7 @@ customPalettePositionSelection(W_ColorPanel *panel, int x, int y)
|
||||
panel->color.green = panel->customPaletteImg->data[1][ofs];
|
||||
panel->color.blue = panel->customPaletteImg->data[2][ofs];
|
||||
|
||||
updateSwatch(panel, panel->color);
|
||||
WMSetColorPanelColor(panel, panel->color);
|
||||
panel->lastChanged = WMCustomPaletteModeColorPanel;
|
||||
|
||||
/* Redraw color selector (and make a backup of the part it will cover) */
|
||||
@@ -2747,10 +2669,6 @@ customPaletteHandleActionEvents(XEvent *event, void *data)
|
||||
|
||||
case ButtonRelease:
|
||||
panel->flags.dragging = 0;
|
||||
if (!panel->flags.continuous) {
|
||||
if (panel->action)
|
||||
(*panel->action)(panel->action, panel->clientData);
|
||||
}
|
||||
break;
|
||||
|
||||
case MotionNotify:
|
||||
@@ -2815,7 +2733,7 @@ customPaletteMenuNewFromFile(W_ColorPanel *panel)
|
||||
WMSetFilePanelCanChooseFiles(browseP, 1);
|
||||
|
||||
/* Get a filename */
|
||||
if (WMRunModalFilePanelForDirectory(browseP, panel->win, spath,
|
||||
if (WMRunModalOpenPanelForDirectory(browseP, panel->win, spath,
|
||||
"Open Palette",
|
||||
RSupportedFileFormats()) ) {
|
||||
filepath = WMGetFilePanelFileName(browseP);
|
||||
@@ -3197,7 +3115,7 @@ colorListSelect(WMWidget *w, void *data)
|
||||
RColor color = *((RColor *)WMGetListSelectedItem(w)->clientData);
|
||||
|
||||
panel->lastChanged = WMColorListModeColorPanel;
|
||||
updateSwatch(panel, color);
|
||||
WMSetColorPanelColor(panel, color);
|
||||
}
|
||||
|
||||
|
||||
@@ -3290,15 +3208,12 @@ generateNewFilename(char *curName)
|
||||
char *ptr;
|
||||
char *newName;
|
||||
|
||||
|
||||
assert(curName);
|
||||
|
||||
ptr = curName;
|
||||
|
||||
if (
|
||||
((ptr = strrchr(ptr, '{')) == 0) ||
|
||||
sscanf(ptr, "{%i}%c", &n, &c) != 1
|
||||
)
|
||||
while ((ptr = strrchr(ptr, '{')) && !(sscanf(ptr, "{%i}%c", &n, &c)==1)) {
|
||||
ptr++;
|
||||
}
|
||||
if (!ptr)
|
||||
return wstrappend(curName, " {1}");
|
||||
|
||||
baseLen = ptr - curName -1;
|
||||
|
||||
@@ -613,13 +613,15 @@ updateImage(TexturePanel *panel, char *path)
|
||||
}
|
||||
|
||||
if (WMGetPopUpButtonSelectedItem(panel->typeP) == TYPE_PIXMAP) {
|
||||
pixmap = WMCreatePixmapFromRImage(scr, image, 128);
|
||||
if (image) {
|
||||
pixmap = WMCreatePixmapFromRImage(scr, image, 128);
|
||||
|
||||
size = WMGetPixmapSize(pixmap);
|
||||
WMSetLabelImage(panel->imageL, pixmap);
|
||||
WMResizeWidget(panel->imageL, size.width, size.height);
|
||||
size = WMGetPixmapSize(pixmap);
|
||||
WMSetLabelImage(panel->imageL, pixmap);
|
||||
WMResizeWidget(panel->imageL, size.width, size.height);
|
||||
|
||||
WMReleasePixmap(pixmap);
|
||||
WMReleasePixmap(pixmap);
|
||||
}
|
||||
} else {
|
||||
updateTGradImage(panel);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
/****/
|
||||
|
||||
#define WVERSION "0.30"
|
||||
#define WMVERSION "0.51.x"
|
||||
#define WMVERSION "0.52.x"
|
||||
|
||||
|
||||
typedef struct _Panel Panel;
|
||||
|
||||
@@ -1405,7 +1405,8 @@ wHideApplication(WApplication *wapp)
|
||||
wArrangeIcons(scr, True);
|
||||
}
|
||||
#ifdef HIDDENDOT
|
||||
wAppIconPaint(wapp->app_icon);
|
||||
if (wapp->app_icon)
|
||||
wAppIconPaint(wapp->app_icon);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
19
src/event.c
19
src/event.c
@@ -1702,11 +1702,20 @@ handleKeyPress(XEvent *event)
|
||||
break;
|
||||
#ifdef KEEP_XKB_LOCK_STATUS
|
||||
case WKBD_TOGGLE:
|
||||
if(wPreferences.modelock){
|
||||
XkbGetState(dpy,XkbUseCoreKbd,&staterec);
|
||||
/*toggle*/
|
||||
XkbLockGroup(dpy,XkbUseCoreKbd,
|
||||
wwin->frame->languagemode=staterec.compat_state&32?0:1);
|
||||
if(wPreferences.modelock) {
|
||||
/*toggle*/
|
||||
wwin = scr->focused_window;
|
||||
|
||||
if (wwin && wwin->flags.mapped
|
||||
&& wwin->frame->workspace == wwin->screen_ptr->current_workspace
|
||||
&& !wwin->flags.miniaturized && !wwin->flags.hidden) {
|
||||
XkbGetState(dpy,XkbUseCoreKbd,&staterec);
|
||||
|
||||
wwin->frame->languagemode = staterec.compat_state&32
|
||||
? 0 : 1;
|
||||
XkbLockGroup(dpy,XkbUseCoreKbd, wwin->frame->languagemode);
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif /* KEEP_XKB_LOCK_STATUS */
|
||||
|
||||
@@ -75,8 +75,12 @@ appearanceObserver(void *self, WMNotification *notif)
|
||||
if (flags & WColorSettings) {
|
||||
}
|
||||
*/
|
||||
|
||||
wIconPaint(icon);
|
||||
|
||||
/* so that the appicon expose handlers will paint the appicon specific
|
||||
* stuff */
|
||||
XClearArea(dpy, icon->core->window, 0, 0, 1, 1, True);
|
||||
/* wIconPaint(icon);*/
|
||||
}
|
||||
|
||||
|
||||
@@ -86,8 +90,9 @@ tileObserver(void *self, WMNotification *notif)
|
||||
WIcon *icon = (WIcon*)self;
|
||||
|
||||
icon->force_paint = 1;
|
||||
wIconPaint(icon);
|
||||
|
||||
XClearArea(dpy, icon->core->window, 0, 0, 1, 1, True);
|
||||
/* wIconPaint(icon);*/
|
||||
}
|
||||
|
||||
/************************************/
|
||||
|
||||
166
src/kwm.c
166
src/kwm.c
@@ -24,6 +24,9 @@
|
||||
*
|
||||
* Supported stuff:
|
||||
* ================
|
||||
*
|
||||
* kfm icon selection from krootbgwm
|
||||
*
|
||||
* kwm.h function/method Notes
|
||||
*----------------------------------------------------------------------------
|
||||
* setUnsavedDataHint() currently, only gives visual clue that
|
||||
@@ -115,6 +118,12 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <signal.h>
|
||||
|
||||
|
||||
#include "WindowMaker.h"
|
||||
@@ -130,6 +139,7 @@
|
||||
#include "actions.h"
|
||||
#include "workspace.h"
|
||||
#include "dialog.h"
|
||||
#include "stacking.h"
|
||||
|
||||
#include "kwm.h"
|
||||
|
||||
@@ -1636,16 +1646,30 @@ wKWMSendEventMessage(WWindow *wwin, WKWMEventMessage message)
|
||||
sendToModules(wwin ? wwin->screen_ptr : NULL, msg, wwin, 0);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
static void
|
||||
writeSocket(int sock, char *data)
|
||||
{
|
||||
char buffer[128];
|
||||
|
||||
sprintf(buffer, "%i ", strlen(data));
|
||||
write(sock, buffer, strlen(buffer));
|
||||
write(sock, data, strlen(data));
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
connectKFM(WScreen *scr)
|
||||
{
|
||||
char *pidf;
|
||||
char *path;
|
||||
char buffer[128];
|
||||
char *ptr;
|
||||
FILE *f;
|
||||
|
||||
pidf = wstrappend(whomedir(), "/.kde/share/apps/kfm/pid");
|
||||
int pid;
|
||||
int sock = 0;
|
||||
struct sockaddr_un addr;
|
||||
|
||||
path = wstrappend(wgethomedir(), "/.kde/share/apps/kfm/pid");
|
||||
strcpy(buffer, getenv("DISPLAY"));
|
||||
|
||||
ptr = strchr(buffer, ':');
|
||||
@@ -1661,98 +1685,80 @@ connectKFM(WScreen *scr)
|
||||
sprintf(b, ".%i", scr->screen);
|
||||
strcat(buffer, b);
|
||||
}
|
||||
ptr = pidf;
|
||||
pidf = wstrappend(ptr, buffer);
|
||||
ptr = path;
|
||||
path = wstrappend(ptr, buffer);
|
||||
free(ptr);
|
||||
|
||||
/* pid file */
|
||||
f = fopen(pidf, "r");
|
||||
|
||||
char buffer[ 1024 ];
|
||||
f = fopen(path, "r");
|
||||
free(path);
|
||||
if (!f)
|
||||
return -1;
|
||||
|
||||
buffer[0] = 0;
|
||||
fgets( buffer, 1023, f );
|
||||
int pid = atoi( buffer );
|
||||
if ( pid <= 0 )
|
||||
{
|
||||
warning("ERROR: Invalid PID");
|
||||
fclose( f );
|
||||
return;
|
||||
}
|
||||
fgets(buffer, 123, f);
|
||||
pid = atoi(buffer);
|
||||
if (pid <= 0)
|
||||
return -1;
|
||||
|
||||
// Is the PID ok ?
|
||||
if ( kill( pid, 0 ) != 0 )
|
||||
{
|
||||
// Did we already try to start a new kfm ?
|
||||
if ( flag == 0 && allowRestart )
|
||||
{
|
||||
flag = 1;
|
||||
// Try to start a new kfm
|
||||
system( "kfm -d &" );
|
||||
sleep( 10 );
|
||||
fclose( f );
|
||||
init();
|
||||
return;
|
||||
}
|
||||
if (kill(pid, 0) != 0)
|
||||
return -1;
|
||||
|
||||
warning("ERROR: KFM crashed");
|
||||
fclose( f );
|
||||
return;
|
||||
}
|
||||
|
||||
// Read the socket's name
|
||||
buffer[0] = 0;
|
||||
fscanf(f, "%s", buffer);
|
||||
fclose( f );
|
||||
char * slot = strdup( buffer );
|
||||
if ( slot == (void *) 0 )
|
||||
{
|
||||
warning("ERROR: Invalid Slot");
|
||||
return;
|
||||
}
|
||||
|
||||
// Connect to KFM
|
||||
ipc = new KfmIpc( slot );
|
||||
free(slot);
|
||||
fscanf(f, "%s", buffer);
|
||||
fclose(f);
|
||||
|
||||
connect( ipc, SIGNAL( finished() ), this, SLOT( slotFinished() ) );
|
||||
connect( ipc, SIGNAL( error( int, const char* ) ),
|
||||
this, SLOT( slotError( int, const char* ) ) );
|
||||
connect( ipc, SIGNAL( dirEntry( const char*, const char*, const char*, const char*, const char*, int ) ),
|
||||
this, SLOT( slotDirEntry( const char*, const char*, const char*, const char*, const char*, int ) ) );
|
||||
sock = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
if (sock < 0)
|
||||
return -1;
|
||||
addr.sun_family = AF_UNIX;
|
||||
strcpy(addr.sun_path, buffer);
|
||||
|
||||
// Read the password
|
||||
QString fn = KApplication::localkdedir() + "/share/apps/kfm/magic";
|
||||
f = fopen( fn.data(), "rb" );
|
||||
if ( f == 0L )
|
||||
{
|
||||
QString ErrorMessage;
|
||||
ksprintf(&ErrorMessage, i18n("You dont have the file %s\n"
|
||||
"Could not do Authorization"), fn.data());
|
||||
|
||||
QMessageBox::message( i18n("KFM Error"), ErrorMessage );
|
||||
return;
|
||||
}
|
||||
char *p = fgets( buffer, 1023, f );
|
||||
fclose( f );
|
||||
if ( p == 0L )
|
||||
{
|
||||
QString ErrorMessage;
|
||||
ksprintf(&ErrorMessage, i18n("The file %s is corrupted\n"
|
||||
"Could not do Authorization"), fn.data());
|
||||
QMessageBox::message( i18n("KFM Error"), ErrorMessage );
|
||||
return;
|
||||
if (connect(sock, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
|
||||
close(sock);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ipc->auth( buffer );
|
||||
|
||||
ok = TRUE;
|
||||
path = wstrappend(wgethomedir(), "/.kde/share/apps/kfm/magic");
|
||||
f = fopen(path, "r");
|
||||
if (!f) {
|
||||
return -1;
|
||||
}
|
||||
ptr = fgets(buffer, 123, f);
|
||||
fclose(f);
|
||||
if (!ptr) {
|
||||
return -1;
|
||||
}
|
||||
puts(buffer);
|
||||
|
||||
ptr = wstrappend("auth", buffer);
|
||||
|
||||
writeSocket(sock, ptr);
|
||||
free(ptr);
|
||||
|
||||
return sock;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
wKWMSendRootSelection(WScreen *scr, int x, int y, int w, int h, Bool control)
|
||||
wKWMSelectRootRegion(WScreen *scr, int x, int y, int w, int h, Bool control)
|
||||
{
|
||||
char buffer[128];
|
||||
int sock;
|
||||
|
||||
puts("CONNECTING");
|
||||
sock = connectKFM(scr);
|
||||
if (sock < 0)
|
||||
return;
|
||||
puts("SENDING DATA");
|
||||
|
||||
writeSocket(sock, "refreshDesktop");
|
||||
|
||||
sprintf(buffer, "selectRootIcons %i %i %i %i %c", x, y, w, h, control);
|
||||
writeSocket(sock, buffer);
|
||||
|
||||
close(sock);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* KWM_HINTS */
|
||||
|
||||
@@ -95,5 +95,8 @@ char *wKWMGetWorkspaceName(WScreen *scr, int workspace);
|
||||
|
||||
Bool wKWMGetIconGeometry(WWindow *wwin, WArea *area);
|
||||
|
||||
void wKWMSelectRootRegion(WScreen *scr, int x, int y, int w, int h,
|
||||
Bool control);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -41,6 +41,10 @@
|
||||
|
||||
#include "list.h"
|
||||
|
||||
#ifdef KWM_HINTS
|
||||
#include "kwm.h"
|
||||
#endif
|
||||
|
||||
/* How many different types of geometry/position
|
||||
display thingies are there? */
|
||||
#define NUM_DISPLAYS 4
|
||||
@@ -1395,24 +1399,30 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
|
||||
XUngrabKeyboard(dpy, CurrentTime);
|
||||
XUngrabPointer(dpy, CurrentTime);
|
||||
XUngrabServer(dpy);
|
||||
if(done==2){
|
||||
|
||||
if(done==2) {
|
||||
if (wwin->flags.shaded || scr->selected_windows) {
|
||||
LinkedList *list;
|
||||
list=scr->selected_windows;
|
||||
if(!scr->selected_windows){
|
||||
if (!scr->selected_windows) {
|
||||
wWindowMove(wwin, src_x+off_x, src_y+off_y);
|
||||
wWindowSynthConfigureNotify(wwin);
|
||||
} else {
|
||||
doWindowMove(wwin,scr->selected_windows,off_x,off_y);
|
||||
while (list) {
|
||||
wWindowSynthConfigureNotify(list->head);
|
||||
list = list->tail;
|
||||
}
|
||||
}
|
||||
else {
|
||||
doWindowMove(wwin,scr->selected_windows,off_x,off_y);
|
||||
while (list) {
|
||||
wWindowSynthConfigureNotify(list->head);
|
||||
list = list->tail;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
wWindowConfigure(wwin, src_x+off_x, src_y+off_y, ww, wh - vert_border);
|
||||
} else {
|
||||
if (wwin->client.width != ww)
|
||||
wwin->flags.user_changed_width = 1;
|
||||
|
||||
if (wwin->client.height != wh - vert_border)
|
||||
wwin->flags.user_changed_height = 1;
|
||||
|
||||
wWindowConfigure(wwin, src_x+off_x, src_y+off_y,
|
||||
ww, wh - vert_border);
|
||||
wWindowSynthConfigureNotify(wwin);
|
||||
}
|
||||
wWindowChangeWorkspace(wwin, scr->current_workspace);
|
||||
@@ -1530,10 +1540,11 @@ wMouseMoveWindow(WWindow *wwin, XEvent *ev)
|
||||
if (!warped && !wPreferences.no_autowrap) {
|
||||
int oldWorkspace = scr->current_workspace;
|
||||
|
||||
drawFrames(wwin, scr->selected_windows,
|
||||
moveData.realX - wwin->frame_x,
|
||||
moveData.realY - wwin->frame_y);
|
||||
|
||||
if (!opaqueMove) {
|
||||
drawFrames(wwin, scr->selected_windows,
|
||||
moveData.realX - wwin->frame_x,
|
||||
moveData.realY - wwin->frame_y);
|
||||
}
|
||||
if (checkWorkspaceChange(wwin, &moveData, opaqueMove)) {
|
||||
if (scr->current_workspace != oldWorkspace
|
||||
&& wPreferences.edge_resistance > 0
|
||||
@@ -1542,9 +1553,11 @@ wMouseMoveWindow(WWindow *wwin, XEvent *ev)
|
||||
warped = 1;
|
||||
}
|
||||
|
||||
drawFrames(wwin, scr->selected_windows,
|
||||
moveData.realX - wwin->frame_x,
|
||||
moveData.realY - wwin->frame_y);
|
||||
if (!opaqueMove) {
|
||||
drawFrames(wwin, scr->selected_windows,
|
||||
moveData.realX - wwin->frame_x,
|
||||
moveData.realY - wwin->frame_y);
|
||||
}
|
||||
} else {
|
||||
warped = 0;
|
||||
}
|
||||
@@ -1859,12 +1872,19 @@ wMouseResizeWindow(WWindow *wwin, XEvent *ev)
|
||||
|
||||
if (started) {
|
||||
showGeometry(wwin, fx, fy, fx + fw, fy + fh, res);
|
||||
|
||||
|
||||
drawTransparentFrame(wwin, fx, fy, fw, fh);
|
||||
|
||||
|
||||
XUngrabKeyboard(dpy, CurrentTime);
|
||||
unmapGeometryDisplay(wwin);
|
||||
XUngrabServer(dpy);
|
||||
|
||||
if (wwin->client.width != fw)
|
||||
wwin->flags.user_changed_width = 1;
|
||||
|
||||
if (wwin->client.height != fh - vert_border)
|
||||
wwin->flags.user_changed_height = 1;
|
||||
|
||||
wWindowConfigure(wwin, fx, fy, fw, fh - vert_border);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
@@ -1984,6 +2004,12 @@ wSelectWindows(WScreen *scr, XEvent *ev)
|
||||
XUngrabServer(dpy);
|
||||
XUngrabPointer(dpy, CurrentTime);
|
||||
selectWindowsInside(scr, x, y, x + w, y + h);
|
||||
|
||||
#ifdef KWM_HINTS
|
||||
wKWMSelectRootRegion(scr, x, y, w, h,
|
||||
event.xbutton.state & ControlMask);
|
||||
#endif /* KWM_HINTS */
|
||||
|
||||
#ifdef DEBUG
|
||||
puts("End window selection");
|
||||
#endif
|
||||
|
||||
155
src/session.c
155
src/session.c
@@ -682,15 +682,35 @@ wSessionSendSaveYourself(WScreen *scr)
|
||||
*/
|
||||
|
||||
|
||||
static char*
|
||||
getWindowRole(Window window)
|
||||
{
|
||||
XTextProperty prop;
|
||||
static Atom atom = 0;
|
||||
|
||||
if (!atom)
|
||||
atom = XInternAtom(dpy, "WM_WINDOW_ROLE", False);
|
||||
|
||||
if (XGetTextProperty(dpy, window, &prop, atom)) {
|
||||
if (prop.encoding == XA_STRING && prop.format == 8 && prop.nitems > 0)
|
||||
return prop.value;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Windows are identified as:
|
||||
* WM_CLASS(instance.class).WM_WINDOW_ROLE
|
||||
*
|
||||
* Saved Info:
|
||||
*
|
||||
* WM_CLASS.instance
|
||||
* WM_CLASSS.class
|
||||
*
|
||||
* WM_WINDOW_ROLE
|
||||
*
|
||||
* WM_CLASS.instance
|
||||
* WM_CLASS.class
|
||||
* WM_NAME
|
||||
* WM_COMMAND
|
||||
*
|
||||
* geometry
|
||||
* state = (miniaturized, shaded, etc)
|
||||
* attribute
|
||||
@@ -736,6 +756,64 @@ makeAppState(WWindow *wwin)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Bool
|
||||
wSessionGetStateFor(WWindow *wwin, WSessionData *state)
|
||||
{
|
||||
char *str;
|
||||
proplist_t slist;
|
||||
proplist_t elem;
|
||||
proplist_t value;
|
||||
int index = 0;
|
||||
|
||||
index = 3;
|
||||
|
||||
/* geometry */
|
||||
value = PLGetArrayElement(slist, index++);
|
||||
str = PLGetString(value);
|
||||
|
||||
sscanf(str, "%i %i %i %i %i %i", &state->x, &state->y,
|
||||
&state->width, &state->height,
|
||||
&state->user_changed_width, &state->user_changed_height);
|
||||
|
||||
|
||||
/* state */
|
||||
value = PLGetArrayElement(slist, index++);
|
||||
str = PLGetString(value);
|
||||
|
||||
sscanf(str, "%i %i %i", &state->miniaturized, &state->shaded,
|
||||
&state->maximized);
|
||||
|
||||
|
||||
/* attributes */
|
||||
value = PLGetArrayElement(slist, index++);
|
||||
str = PLGetString(value);
|
||||
|
||||
getAttributeState(str, &state->mflags, &state->flags);
|
||||
|
||||
|
||||
/* workspace */
|
||||
value = PLGetArrayElement(slist, index++);
|
||||
str = PLGetString(value);
|
||||
|
||||
sscanf(str, "%i", &state->workspace);
|
||||
|
||||
|
||||
/* app state (repeated for all windows of the app) */
|
||||
value = PLGetArrayElement(slist, index++);
|
||||
str = PLGetString(value);
|
||||
|
||||
/* ???? */
|
||||
|
||||
/* shortcuts */
|
||||
value = PLGetArrayElement(slist, index++);
|
||||
str = PLGetString(value);
|
||||
|
||||
sscanf(str, "%i", &state->shortcuts);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static proplist_t
|
||||
makeAttributeState(WWindow *wwin)
|
||||
{
|
||||
@@ -745,7 +823,8 @@ makeAttributeState(WWindow *wwin)
|
||||
#define W_FLAG(wwin, FLAG) ((wwin)->defined_user_flags.FLAG \
|
||||
? (wwin)->user_flags.FLAG : -1)
|
||||
|
||||
sprintf(buffer, "%i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i",
|
||||
sprintf(buffer,
|
||||
"%i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i",
|
||||
W_FLAG(no_titlebar),
|
||||
W_FLAG(no_resizable),
|
||||
W_FLAG(no_closable),
|
||||
@@ -779,6 +858,17 @@ makeAttributeState(WWindow *wwin)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
appendStringInArray(proplist_t array, char *str)
|
||||
{
|
||||
proplist_t val;
|
||||
|
||||
val = PLMakeString(str);
|
||||
PLAppendArrayElement(array, val);
|
||||
PLRelease(val);
|
||||
}
|
||||
|
||||
|
||||
static proplist_t
|
||||
makeClientState(WWindow *wwin)
|
||||
{
|
||||
@@ -787,47 +877,62 @@ makeClientState(WWindow *wwin)
|
||||
char *str;
|
||||
char buffer[256];
|
||||
int i;
|
||||
|
||||
unsigned shortcuts;
|
||||
|
||||
state = PLMakeArrayWithElements(NULL, NULL);
|
||||
|
||||
/* spec */
|
||||
PLAppendArrayElement(state, PLMakeString(wwin->wm_instance));
|
||||
PLAppendArrayElement(state, PLMakeString(wwin->wm_class));
|
||||
/* WM_WINDOW_ROLE */
|
||||
str = getWindowRole(wwin->client_win);
|
||||
if (!str)
|
||||
appendStringInArray(state, "");
|
||||
else {
|
||||
appendStringInArray(state, str);
|
||||
XFree(str);
|
||||
}
|
||||
|
||||
PLAppendArrayElement(state, PLMakeString(str));
|
||||
/* WM_CLASS.instance */
|
||||
appendStringInArray(state, wwin->wm_instance);
|
||||
|
||||
/* WM_CLASS.class */
|
||||
appendStringInArray(state, wwin->wm_class);
|
||||
|
||||
/* WM_NAME */
|
||||
|
||||
|
||||
/* geometry */
|
||||
sprintf(buffer, "%i %i %i %i", wwin->frame_x, wwin->frame_y,
|
||||
wwin->frame->core->width, wwin->frame->core->height);
|
||||
PLAppendArrayElement(state, PLMakeString(buffer));
|
||||
sprintf(buffer, "%i %i %i %i %i %i", wwin->frame_x, wwin->frame_y,
|
||||
wwin->client.width, wwin->client.height,
|
||||
wwin->flags.user_changed_width, wwin->flags.user_changed_height);
|
||||
appendStringInArray(state, buffer);
|
||||
|
||||
/* state */
|
||||
sprintf(buffer, "%i %i %i", wwin->flags.miniaturized,
|
||||
wwin->flags.shaded, wwin->flags.maximized);
|
||||
PLAppendArrayElement(state, PLMakeString(buffer));
|
||||
appendStringInArray(state, buffer);
|
||||
|
||||
/* attributes */
|
||||
PLAppendArrayElement(state, makeAttributeState(wwin));
|
||||
tmp = makeAttributeState(wwin);
|
||||
PLAppendArrayElement(state, tmp);
|
||||
PLRelease(tmp);
|
||||
|
||||
/* workspace */
|
||||
sprintf(buffer, "%i", wwin->frame->workspace);
|
||||
PLAppendArrayElement(state, PLMakeString(buffer));
|
||||
appendStringInArray(state, buffer);
|
||||
|
||||
/* app state (repeated for all windows of the app) */
|
||||
PLAppendArrayElement(state, makeAppState(wwin));
|
||||
tmp = makeAppState(wwin);
|
||||
PLAppendArrayElement(state, tmp);
|
||||
PLRelease(tmp);
|
||||
|
||||
/* shortcuts */
|
||||
tmp = PLMakeArrayWithElements(NULL, NULL);
|
||||
|
||||
shortcuts = 0;
|
||||
for (i = 0; i < MAX_WINDOW_SHORTCUTS; i++) {
|
||||
|
||||
if (scr->shortcutWindow[i] == wwin) {
|
||||
|
||||
sprintf(buffer, "%i", i);
|
||||
PLAppendArrayElement(tmp, PLMakeString(buffer));
|
||||
shortcuts |= 1 << i;
|
||||
}
|
||||
}
|
||||
PLAppendArrayElement(state, tmp);
|
||||
sprintf(buffer, "%ui", shortcuts);
|
||||
appendStringInArray(tmp, buffer);
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,28 @@
|
||||
#ifndef WMSESSION_H_
|
||||
#define WMSESSION_H_
|
||||
|
||||
|
||||
typedef struct {
|
||||
int x;
|
||||
int y;
|
||||
unsigned int w; /* client size */
|
||||
unsigned int h;
|
||||
|
||||
int workspace;
|
||||
unsigned shortcuts; /* mask like 1<<shortcut_number */
|
||||
|
||||
WWindowAttributes mflags;
|
||||
WWindowAttributes flags;
|
||||
|
||||
char miniaturized;
|
||||
char shaded;
|
||||
char maximized;
|
||||
|
||||
char user_changed_width;
|
||||
char user_changed_height;
|
||||
} WSessionData;
|
||||
|
||||
|
||||
void wSessionSaveState(WScreen *scr);
|
||||
|
||||
void wSessionSaveClients(WScreen *scr);
|
||||
|
||||
@@ -447,14 +447,14 @@ wDefaultGetStartWorkspace(WScreen *scr, char *instance, char *class)
|
||||
|
||||
if (!tmp || strlen(tmp)==0)
|
||||
return -1;
|
||||
|
||||
|
||||
if (sscanf(tmp, "%i", &w)!=1) {
|
||||
w = -1;
|
||||
for (i=0; i < scr->workspace_count; i++) {
|
||||
if (strcmp(scr->workspaces[i]->name, tmp)==0) {
|
||||
w = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
w--;
|
||||
|
||||
@@ -268,6 +268,10 @@ typedef struct WWindow {
|
||||
unsigned int obscured:1; /* window is obscured */
|
||||
|
||||
unsigned int dragged_while_fmaximized;
|
||||
|
||||
unsigned int user_changed_width:1;
|
||||
unsigned int user_changed_height:1;
|
||||
|
||||
#ifdef KWM_HINTS
|
||||
unsigned int kwm_hidden_for_modules:1;
|
||||
unsigned int kwm_managed:1;
|
||||
|
||||
@@ -1295,7 +1295,7 @@ createInspectorForWindow(WWindow *wwin)
|
||||
i = wDefaultGetStartWorkspace(wwin->screen_ptr, wwin->wm_instance,
|
||||
wwin->wm_class);
|
||||
if (i >= 0 && i <= wwin->screen_ptr->workspace_count) {
|
||||
WMSetPopUpButtonSelectedItem(panel->wsP, i);
|
||||
WMSetPopUpButtonSelectedItem(panel->wsP, i + 1);
|
||||
} else {
|
||||
WMSetPopUpButtonSelectedItem(panel->wsP, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user