1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-24 23:22:30 +01:00

Initial update from my source tree. For 0.52.0

This commit is contained in:
kojima
1999-03-15 23:41:22 +00:00
parent c56756dc73
commit 7f9f88940d
67 changed files with 3348 additions and 638 deletions

View File

@@ -139,7 +139,7 @@ wconfig.h.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
SOURCES = $(wmaker_SOURCES)
OBJECTS = $(wmaker_OBJECTS)

View File

@@ -175,7 +175,10 @@ wSetFocusTo(WScreen *scr, WWindow *wwin)
if (napp)
napp->last_workspace = wwin->screen_ptr->current_workspace;
if (wwin->flags.mapped && !WFLAGP(wwin, no_focusable)) {
if (WFLAGP(wwin, no_focusable))
return;
if (wwin->flags.mapped /*&& !WFLAGP(wwin, no_focusable)*/) {
/* install colormap if colormap mode is lock mode */
if (wPreferences.colormap_mode==WKF_CLICK)
wColormapInstallForWindow(scr, wwin);
@@ -203,9 +206,6 @@ wSetFocusTo(WScreen *scr, WWindow *wwin)
XSetInputFocus(dpy, scr->no_focus_win, RevertToParent, timestamp);
}
if (WFLAGP(wwin, no_focusable))
return;
/* if this is not the focused window focus it */
if (focused!=wwin) {
/* change the focus window list order */
@@ -882,6 +882,7 @@ removeIconGrabs(WIcon *icon)
}
#endif
void
wIconifyWindow(WWindow *wwin)
{
@@ -1115,9 +1116,12 @@ static void
hideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int animate)
{
if (wwin->flags.miniaturized) {
XUnmapWindow(dpy, wwin->icon->core->window);
/* XXX wrong fix, can cause side effects, must remove 'if' */
if (wwin->icon) {
XUnmapWindow(dpy, wwin->icon->core->window);
wwin->icon->mapped = 0;
}
wwin->flags.hidden = 1;
wwin->icon->mapped = 0;
#ifdef GNOME_STUFF
wGNOMEUpdateClientStateHint(wwin, False);
#endif
@@ -1337,6 +1341,9 @@ wHideApplication(WApplication *wapp)
if(wPreferences.auto_arrange_icons) {
wArrangeIcons(scr, True);
}
#ifdef HIDDENDOT
wAppIconPaint(wapp->app_icon);
#endif
}
@@ -1490,6 +1497,9 @@ wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurrentWS)
if (wPreferences.auto_arrange_icons) {
wArrangeIcons(scr, True);
}
#ifdef HIDDENDOT
wAppIconPaint(wapp->app_icon);
#endif
}

View File

@@ -347,6 +347,22 @@ updateDockNumbers(WScreen *scr)
}
#endif /* WS_INDICATOR */
#ifdef HIDDENDOT
static void
draw_dot(WScreen *scr, Drawable d)
{
GC gc;
int y;
gc = scr->draw_gc;
y = wPreferences.icon_size-6;
XSetForeground(dpy, gc, scr->black_pixel);
XDrawLine(dpy, d, gc, 4, y, 5, y);
XDrawPoint(dpy, d, gc, 4, y+1);
XSetForeground(dpy, gc, scr->white_pixel);
XDrawLine(dpy, d, gc, 6, y, 6, y+1);
XDrawPoint(dpy, d, gc, 5, y+1);
}
#endif /* HIDDENDOT */
void
wAppIconPaint(WAppIcon *aicon)
@@ -369,6 +385,21 @@ wAppIconPaint(WAppIcon *aicon)
scr->dock_dots->height, 0, 0);
}
#ifdef HIDDENDOT
{
WApplication *wapp;
wapp = wApplicationOf(aicon->main_window);
if(wapp)
if(wapp->flags.hidden){
XSetClipMask(dpy, scr->copy_gc, scr->dock_dots->mask);
XSetClipOrigin(dpy, scr->copy_gc, 0, 0);
XCopyArea(dpy, scr->dock_dots->image, aicon->icon->core->window,
scr->copy_gc, 0, 0, 7,
scr->dock_dots->height, 0, 0);
}
}
#endif /* HIDDENDOT */
#ifdef NEWAPPICON
if (!wPreferences.strict_ns && aicon->icon->owner!=NULL) {
int active=0;

View File

@@ -1142,7 +1142,7 @@ wShowInfoPanel(WScreen *scr)
panel->wwin = wwin;
thePanel = panel;
#ifndef SILLYNESS
#ifdef SILLYNESS
if (InitXThing(panel->scr)) {
panel->timer = WMAddTimerHandler(100, logoPushCallback, panel);
panel->cycle = 0;

View File

@@ -324,7 +324,7 @@ ShowDockAppSettingsPanel(WAppIcon *aicon)
WMSetLabelText(panel->dndCommandLabel,
_("%d will be replaced with the file name"));
#else
WMSetTextFieldEnabled(panel->dndCommandField, False);
WMSetTextFieldEditable(panel->dndCommandField, False);
WMSetLabelText(panel->dndCommandLabel,
_("DND support was not compiled in"));
#endif

View File

@@ -298,7 +298,6 @@ DispatchEvent(XEvent *event)
case VisibilityNotify:
handleVisibilityNotify(event);
break;
default:
handleExtensions(event);
break;
@@ -446,6 +445,13 @@ handleExtensions(XEvent *event)
handleShapeNotify(event);
}
#endif
#ifdef KEEP_XKB_LOCK_STATUS
if (wPreferences.modelock && event->type == (0x50|XkbIndicatorStateNotify)){
/* if someone know how to call this 0x50
* or how to clean code this please tell ]d */
handleXkbIndicatorStateNotify(event);
}
#endif /*KEEP_XKB_LOCK_STATUS*/
}
@@ -772,7 +778,7 @@ handleUnmapNotify(XEvent *event)
/* if the window was reparented, do not reparent it back to the
* root window */
wUnmanageWindow(wwin, !reparented, False);
// wUnmanageWindow(wwin, !reparented, False);
}
XUngrabServer(dpy);
}
@@ -1133,6 +1139,31 @@ handleShapeNotify(XEvent *event)
}
#endif /* SHAPE */
#ifdef KEEP_XKB_LOCK_STATUS
/* please help ]d if you know what to do */
handleXkbIndicatorStateNotify(XEvent *event)
{
WWindow *wwin;
WScreen *scr;
XkbStateRec staterec;
int i;
XkbGetState(dpy,XkbUseCoreKbd,&staterec);
for (i=0; i<wScreenCount; i++) {
scr = wScreenWithNumber(i);
wwin = scr->focused_window;
if (wwin->flags.focused) {
wwin->frame->languagemode=staterec.compat_state&32?1:0;
#ifdef XKB_TITLE_HINT
if (wwin->frame->titlebar) {
XClearWindow(dpy, wwin->frame->titlebar->window);
wFrameWindowPaint(wwin->frame);
}
#endif /* XKB_TITLE_HINT */
}
}
}
#endif /*KEEP_XKB_LOCK_STATUS*/
static void
handleColormapNotify(XEvent *event)
@@ -1670,7 +1701,7 @@ handleKeyPress(XEvent *event)
XkbGetState(dpy,XkbUseCoreKbd,&staterec);
/*toggle*/
XkbLockGroup(dpy,XkbUseCoreKbd,
wwin->languagemode=staterec.compat_state&32?0:1);
wwin->frame->languagemode=staterec.compat_state&32?0:1);
}
break;
#endif /* KEEP_XKB_LOCK_STATUS */

View File

@@ -739,8 +739,25 @@ wFrameWindowPaint(WFrameWindow *fwin)
else
allButtons = 0;
}
#ifdef XKB_TITLE_HINT
if(fwin->flags.is_client_window_frame) {
char * freebuff;
freebuff = (char *)wmalloc((strlen(fwin->title)+6)*sizeof(char));
if (fwin->flags.justification == WTJ_RIGHT)
sprintf(freebuff,"%s %s",fwin->title,fwin->languagemode?XKB_ON:XKB_OFF);
else
sprintf(freebuff,"%s %s",fwin->languagemode?XKB_ON:XKB_OFF,fwin->title);
title = ShrinkString(*fwin->font, freebuff,
fwin->titlebar->width - lofs - rofs);
free(freebuff);
}
else title = ShrinkString(*fwin->font, fwin->title,
fwin->titlebar->width - lofs - rofs);
#else
title = ShrinkString(*fwin->font, fwin->title,
fwin->titlebar->width - lofs - rofs);
#endif /* XKB_TITLE_HINT */
titlelen = strlen(title);
w = wTextWidth((*fwin->font)->font, title, titlelen);

View File

@@ -72,6 +72,10 @@ typedef struct WFrameWindow {
char *title; /* window name (title) */
#ifdef KEEP_XKB_LOCK_STATUS
int languagemode;
#endif /* KEEP_XKB_LOCK_STATUS */
/* thing that uses this frame. passed as data to callbacks */
void *child;

View File

@@ -502,9 +502,9 @@ main(int argc, char **argv)
sprintf(str, "DISPLAY=%s", DisplayName);
putenv(str);
#ifdef DEBUG
//#ifdef DEBUG
XSynchronize(dpy, True);
#endif
//#endif
wXModifierInitialize();

View File

@@ -1456,6 +1456,11 @@ wMouseMoveWindow(WWindow *wwin, XEvent *ev)
/* This needs not to change while moving, else bad things can happen */
int opaqueMove = wPreferences.opaque_move;
MoveData moveData;
#ifdef GHOST_WINDOW_MOVE
RImage *rimg;
rimg = InitGhostWindowMove(scr);
#endif
initMoveData(wwin, &moveData);

View File

@@ -32,6 +32,9 @@
#ifdef SHAPE
#include <X11/extensions/shape.h>
#endif
#ifdef KEEP_XKB_LOCK_STATUS
#include <X11/XKBlib.h>
#endif /* KEEP_XKB_LOCK_STATUS */
#include <wraster.h>
@@ -425,7 +428,8 @@ createPixmaps(WScreen *scr)
image = wDefaultGetImage(scr, "Logo", "WMPanel");
if (!image) {
wwarning(_("could not load logo image for panels"));
wwarning(_("could not load logo image for panels: %s"),
RMessageForError(RErrorCode));
} else {
if (!RConvertImageMask(scr->rcontext, image, &p, &m, 128)) {
wwarning(_("error making logo image for panel:%s"), RMessageForError(RErrorCode));
@@ -529,10 +533,12 @@ createInternalWindows(WScreen *scr)
XCreateWindow(dpy, scr->root_win, 0, 0, 10, 10, 0, scr->w_depth,
CopyFromParent, scr->w_visual, vmask, &attribs);
/* for our window manager info notice board */
scr->info_window =
XCreateWindow(dpy, scr->root_win, 0, 0, 10, 10, 0, CopyFromParent,
CopyFromParent, CopyFromParent, 0, NULL);
CopyFromParent, CopyFromParent, CWOverrideRedirect,
&attribs);
/*
* If the window is clicked without having ButtonPress selected, the
@@ -669,6 +675,11 @@ wScreenInit(int screen_number)
XSelectInput(dpy, scr->root_win, event_mask);
#ifdef KEEP_XKB_LOCK_STATUS
XkbSelectEvents(dpy,XkbUseCoreKbd,XkbIndicatorStateNotifyMask,
XkbIndicatorStateNotifyMask);
#endif /* KEEP_XKB_LOCK_STATUS */
XSync(dpy, False);
XSetErrorHandler(oldHandler);

View File

@@ -521,3 +521,21 @@ InitXThing(WScreen *scr)
}
#endif /* SILLYNESS */
#ifdef GHOST_WINDOW_MOVE
RImage*
InitGhostWindowMove(WScreen *scr)
{
RXImage *ximg;
RImage *img;
ximg = RGetXImage(scr->rcontext, scr->root_win, 0, 0,
scr->scr_width, scr->scr_height);
img = RCreateImageFromXImage(scr->rcontext, ximg->image, NULL);
RDestroyXImage(dpy, ximg);
return img;
}
#endif /* GHOST_WINDOW_MOVE */

View File

@@ -57,7 +57,7 @@
*/
#define USECPP
/* #define CPP_PATH /usr/bin/cpp */
/* #define CPP_PATH /lib/cpp */
/*
* support for OffiX DND drag and drop in the Dock
@@ -154,6 +154,13 @@
#undef WS_INDICATOR
/*
* define HIDDENDOT if you want a dot to be shown in the application icon
* of applications that are hidden.
*/
#undef HIDDENDOT
/*
* Ignores the PPosition hint from clients. This is needed for some
* programs that have buggy implementations of such hint and place
@@ -524,9 +531,11 @@
#undef SHAPED_BALLOON
#endif
#ifdef XKB_MODELOCK
#define KEEP_XKB_LOCK_STATUS
#define XKB_TITLE_HINT
#define XKB_ON "[TH]"
#define XKB_OFF "[EN]"
#endif
#if HAVE_LIBINTL_H && I18N

View File

@@ -154,6 +154,13 @@
#undef WS_INDICATOR
/*
* define HIDDENDOT if you want a dot to be shown in the application icon
* of applications that are hidden.
*/
#undef HIDDENDOT
/*
* Ignores the PPosition hint from clients. This is needed for some
* programs that have buggy implementations of such hint and place
@@ -524,9 +531,11 @@
#undef SHAPED_BALLOON
#endif
#ifdef XKB_MODELOCK
#define KEEP_XKB_LOCK_STATUS
#define XKB_TITLE_HINT
#define XKB_ON "[TH]"
#define XKB_OFF "[EN]"
#endif
#if HAVE_LIBINTL_H && I18N

View File

@@ -27,8 +27,8 @@
#ifdef SHAPE
#include <X11/extensions/shape.h>
#endif
#ifdef KEEP_XKB_LOCK_STATUS
# include <X11/XKBlib.h>
#ifdef KEEP_XKB_LOCK_STATUS
#include <X11/XKBlib.h>
#endif /* KEEP_XKB_LOCK_STATUS */
#include <stdlib.h>
#include <stdio.h>
@@ -1331,6 +1331,8 @@ wUnmanageWindow(WWindow *wwin, Bool restore, Bool destroyed)
XUnmapWindow(dpy, frame->window);
XUnmapWindow(dpy, wwin->client_win);
/* deselect window */
wSelectWindow(wwin, False);
@@ -1487,7 +1489,7 @@ wWindowFocus(WWindow *wwin, WWindow *owin)
#ifdef KEEP_XKB_LOCK_STATUS
if (wPreferences.modelock) {
if (!wwin->flags.focused) {
XkbLockGroup(dpy, XkbUseCoreKbd, wwin->languagemode);
XkbLockGroup(dpy, XkbUseCoreKbd, wwin->frame->languagemode);
}
}
#endif /* KEEP_XKB_LOCK_STATUS */
@@ -1546,17 +1548,6 @@ wWindowFocus(WWindow *wwin, WWindow *owin)
void
wWindowUnfocus(WWindow *wwin)
{
#ifdef KEEP_XKB_LOCK_STATUS
static XkbStateRec staterec;
if (wPreferences.modelock) {
if (wwin->flags.focused) {
XkbGetState(dpy,XkbUseCoreKbd,&staterec);
wwin->languagemode=staterec.compat_state&32?1:0;
XkbLockGroup(dpy,XkbUseCoreKbd,0); /* reset to workspace */
}
}
#endif /* KEEP_XKB_LOCK_STATUS */
CloseWindowMenu(wwin->screen_ptr);
wFrameWindowChangeState(wwin->frame, wwin->flags.semi_focused

View File

@@ -218,10 +218,6 @@ typedef struct WWindow {
FocusMode focus_mode; /* type of keyboard input focus */
#ifdef KEEP_XKB_LOCK_STATUS
int languagemode;
#endif /* KEEP_XKB_LOCK_STATUS */
#ifdef OLWM_HINTS_unfinished
struct WOLWindowState ol_window_state;
#endif

View File

@@ -466,14 +466,12 @@ saveSettings(WMButton *button, InspectorPanel *panel)
insertAttribute(dict, winDic, AStartWorkspace, value, &different, flags);
PLRelease(value);
} else if (WMGetButtonSelected(panel->setRb) != 0) {
char *ws_name = WMGetTextFieldText(panel->wsText);
if (ws_name) {
if (ws_name[0] != 0) {
value = PLMakeString(ws_name);
insertAttribute(dict, winDic, AStartWorkspace, value, &different, flags);
PLRelease(value);
}
free(ws_name);
int i = WMGetPopUpButtonSelectedItem(panel->wsP);
if (i < panel->frame->screen_ptr->workspace_count) {
value = PLMakeString(panel->frame->screen_ptr->workspaces[i]->name);
insertAttribute(dict, winDic, AStartWorkspace, value, &different, flags);
PLRelease(value);
}
}
@@ -911,9 +909,9 @@ revertSettings(WMButton *button, InspectorPanel *panel)
n = wDefaultGetStartWorkspace(wwin->screen_ptr, wm_instance, wm_class);
if (n >= 0 && n <= wwin->screen_ptr->workspace_count) {
if (n >= 0 && n < wwin->screen_ptr->workspace_count) {
WMPerformButtonClick(panel->setRb);
WMSetTextFieldText(panel->wsText, wwin->screen_ptr->workspaces[n]->name);
WMSetPopUpButtonSelectedItem(panel->wsP, n);
} else {
WMPerformButtonClick(panel->curRb);
}
@@ -959,14 +957,11 @@ textEditedObserver(void *observerData, WMNotification *notification)
if ((long)WMGetNotificationClientData(notification) != WMReturnTextMovement)
return;
if (WMGetNotificationObject(notification) == panel->fileText) {
showIconFor(WMWidgetScreen(panel->win), panel, NULL, NULL,
USE_TEXT_FIELD);
showIconFor(WMWidgetScreen(panel->win), panel, NULL, NULL,
USE_TEXT_FIELD);
/*
WMPerformButtonClick(panel->updateIconBtn);
*/
} else
WMPerformButtonClick(panel->setRb);
}
@@ -1240,7 +1235,7 @@ createInspectorForWindow(WWindow *wwin)
panel->iconLbl = WMCreateLabel(panel->iconFrm);
WMMoveWidget(panel->iconLbl, PWIDTH - (2 * 15) - 22 - 64, 30);
WMResizeWidget(panel->iconLbl, 64, 64);
WMSetLabelRelief(panel->iconLbl, WRRaised);
WMSetLabelRelief(panel->iconLbl, WRGroove);
WMSetLabelImagePosition(panel->iconLbl, WIPImageOnly);
panel->browseIconBtn = WMCreateCommandButton(panel->iconFrm);
@@ -1302,21 +1297,19 @@ createInspectorForWindow(WWindow *wwin)
WMGroupButtons(panel->curRb, panel->setRb);
WMSetButtonText(panel->setRb, NULL);
panel->wsText = WMCreateTextField(panel->wsFrm);
WMMoveWidget(panel->wsText, 30, 40);
WMResizeWidget(panel->wsText, PWIDTH - (2 * 15) - 25 - 10 - (2 * 5), 20);
WMAddNotificationObserver(textEditedObserver, panel,
WMTextDidEndEditingNotification,
panel->wsText);
panel->wsP = WMCreatePopUpButton(panel->wsFrm);
WMMoveWidget(panel->wsP, 30, 40);
WMResizeWidget(panel->wsP, PWIDTH - (2 * 15) - 25 - 10 - (2 * 5), 20);
for (i = 0; i < wwin->screen_ptr->workspace_count; i++) {
WMAddPopUpButtonItem(panel->wsP, scr->workspaces[i]->name);
}
i = wDefaultGetStartWorkspace(wwin->screen_ptr, wwin->wm_instance,
wwin->wm_class);
if (i >= 0 && i <= wwin->screen_ptr->workspace_count) {
WMSetButtonSelected(panel->curRb, False);
WMSetButtonSelected(panel->setRb, True);
WMSetTextFieldText(panel->wsText,
wwin->screen_ptr->workspaces[i]->name);
WMSetPopUpButtonSelectedItem(panel->wsP, i);
} else {
WMSetButtonSelected(panel->curRb, True);
WMSetButtonSelected(panel->setRb, False);

View File

@@ -78,7 +78,7 @@ typedef struct InspectorPanel {
WMFrame *wsFrm;
WMButton *curRb;
WMButton *setRb;
WMTextField *wsText;
WMPopUpButton *wsP;
/* 5th page. application wide attributes */
WMFrame *appFrm;