mirror of
https://github.com/gryf/wmaker.git
synced 2026-06-10 20:25:24 +02:00
- Check whether libXft is at least version 2.1.2 else refuse to compile.
- Fixed bug in icon chooser dialog that could cause a segmentation fault in some cases (Pascal Hofstee <caelian@gmail.com>) - Fixed crash in asm code in wrlib, with new versions of gcc. - Fixed bug in the x86_PseudoColor_32_to_8() function which incorrectly used the r, g, b fields in the conversion. - Fixed x86 ASM code in wrlib to work on 64 bit architectures. - Fixed the focus flicker seen with some apps (notably gtk2) (Alexey Spiridonov <snarkmaster@gmail.com>) - Fixed all crashing bugs that were generated by wmaker starting with the WMState file missing. - Added NetWM support (a modified version of the patch originaly written by Peter Zijlstra <a.p.zijlstra@chello.nl>) - Applied patch to enhance the Virtual Desktop behaviour, and to integrate it with the NetWM code (Peter Zijlstra <a.p.zijlstra@chello.nl>) - Applied a few xinerama and placement fixes (Peter Zijlstra <a.p.zijlstra@chello.nl>) - Fixed memory leak in dock code. - Fixed and enhanced the text wrapping in WINGs. - Fixed the layout of some elements in WPrefs.app - Added workaround for aplications that don't set the required hints on the client leader window, but they set them on normal windows (observer with KDE 3.3.0 mainly). This will allow these apps to get an appicon again. (they should be fixed still) - Added workaround for applications that do not set a command with XSetCommand(), but instead they set the _NET_WM_PID property. This works with operating systems that offer a /proc interface similar to what linux has. (This also is to fix problems with KDE 3.3.0 apps, but not only them). - Fixed bug with autostart and exit scripts not being executed if user GNUstep path was different from ~/GNUstep (when setting GNUSTEP_USER_ROOT) - Added utf8 support in WINGs (removed old X core font code) - Added utility to convert old font names to new font names in style files
This commit is contained in:
+5
-1
@@ -96,6 +96,8 @@ wmaker_SOURCES = \
|
||||
winmenu.c \
|
||||
winspector.h \
|
||||
winspector.c \
|
||||
wmspec.h \
|
||||
wmspec.c \
|
||||
workspace.c \
|
||||
workspace.h \
|
||||
wsound.c \
|
||||
@@ -104,7 +106,9 @@ wmaker_SOURCES = \
|
||||
text.h
|
||||
|
||||
|
||||
AM_CPPFLAGS = @CPPFLAGS@ $(DFLAGS) -DLOCALEDIR=\"$(NLSDIR)\"
|
||||
AM_CPPFLAGS = $(DFLAGS) -DLOCALEDIR=\"$(NLSDIR)\"
|
||||
|
||||
AM_CFLAGS = -fno-strict-aliasing
|
||||
|
||||
|
||||
INCLUDES = \
|
||||
|
||||
+32
-30
@@ -70,6 +70,7 @@ enum {
|
||||
WMSubmenuLevel = 6,
|
||||
WMMainMenuLevel = 20,
|
||||
WMStatusLevel = 21,
|
||||
WMFullscreenLevel = 50,
|
||||
WMModalLevel = 100,
|
||||
WMPopUpLevel = 101,
|
||||
WMScreensaverLevel = 1000,
|
||||
@@ -118,40 +119,41 @@ typedef enum {
|
||||
#define WBUT_ICONIFY 2
|
||||
#define WBUT_KILL 3
|
||||
#ifdef XKB_BUTTON_HINT
|
||||
#define WBUT_XKBGROUP1 4
|
||||
#define WBUT_XKBGROUP2 5
|
||||
#define WBUT_XKBGROUP3 6
|
||||
#define WBUT_XKBGROUP4 7
|
||||
#define WBUT_XKBGROUP1 4
|
||||
#define WBUT_XKBGROUP2 5
|
||||
#define WBUT_XKBGROUP3 6
|
||||
#define WBUT_XKBGROUP4 7
|
||||
#define PRED_BPIXMAPS 8 /* reserved for 4 groups */
|
||||
#else
|
||||
#define PRED_BPIXMAPS 4 /* count of WBUT icons */
|
||||
#endif /* XKB_BUTTON_HINT */
|
||||
|
||||
/* cursors */
|
||||
#define WCUR_DEFAULT 0
|
||||
#define WCUR_NORMAL 0
|
||||
#define WCUR_MOVE 1
|
||||
#define WCUR_RESIZE 2
|
||||
#define WCUR_DEFAULT 0
|
||||
#define WCUR_NORMAL 0
|
||||
#define WCUR_MOVE 1
|
||||
#define WCUR_RESIZE 2
|
||||
#define WCUR_TOPLEFTRESIZE 3
|
||||
#define WCUR_TOPRIGHTRESIZE 4
|
||||
#define WCUR_BOTTOMLEFTRESIZE 5
|
||||
#define WCUR_BOTTOMRIGHTRESIZE 6
|
||||
#define WCUR_VERTICALRESIZE 7
|
||||
#define WCUR_HORIZONRESIZE 8
|
||||
#define WCUR_WAIT 9
|
||||
#define WCUR_ARROW 10
|
||||
#define WCUR_QUESTION 11
|
||||
#define WCUR_TEXT 12
|
||||
#define WCUR_SELECT 13
|
||||
#define WCUR_ROOT 14
|
||||
#define WCUR_LAST 15
|
||||
#define WCUR_VERTICALRESIZE 7
|
||||
#define WCUR_HORIZONRESIZE 8
|
||||
#define WCUR_WAIT 9
|
||||
#define WCUR_ARROW 10
|
||||
#define WCUR_QUESTION 11
|
||||
#define WCUR_TEXT 12
|
||||
#define WCUR_SELECT 13
|
||||
#define WCUR_ROOT 14
|
||||
#define WCUR_EMPTY 15
|
||||
#define WCUR_LAST 16
|
||||
|
||||
/* geometry displays */
|
||||
#define WDIS_NEW 0 /* new style */
|
||||
#define WDIS_CENTER 1 /* center of screen */
|
||||
#define WDIS_TOPLEFT 2 /* top left corner of screen */
|
||||
#define WDIS_FRAME_CENTER 3 /* center of the frame */
|
||||
#define WDIS_NONE 4
|
||||
#define WDIS_NEW 0 /* new style */
|
||||
#define WDIS_CENTER 1 /* center of screen */
|
||||
#define WDIS_TOPLEFT 2 /* top left corner of screen */
|
||||
#define WDIS_FRAME_CENTER 3 /* center of the frame */
|
||||
#define WDIS_NONE 4
|
||||
|
||||
/* keyboard input focus mode */
|
||||
#define WKF_CLICK 0
|
||||
@@ -181,10 +183,10 @@ typedef enum {
|
||||
#define WIS_RANDOM 4 /* secret */
|
||||
|
||||
/* switchmenu actions */
|
||||
#define ACTION_ADD 0
|
||||
#define ACTION_REMOVE 1
|
||||
#define ACTION_CHANGE 2
|
||||
#define ACTION_CHANGE_WORKSPACE 3
|
||||
#define ACTION_ADD 0
|
||||
#define ACTION_REMOVE 1
|
||||
#define ACTION_CHANGE 2
|
||||
#define ACTION_CHANGE_WORKSPACE 3
|
||||
#define ACTION_CHANGE_STATE 4
|
||||
|
||||
|
||||
@@ -202,8 +204,8 @@ typedef enum {
|
||||
#define WS_PFOCUSED 2
|
||||
|
||||
/* clip title colors */
|
||||
#define CLIP_NORMAL 0
|
||||
#define CLIP_COLLAPSED 1
|
||||
#define CLIP_NORMAL 0
|
||||
#define CLIP_COLLAPSED 1
|
||||
|
||||
|
||||
/* icon yard position */
|
||||
@@ -420,8 +422,8 @@ typedef struct WPreferences {
|
||||
unsigned int vedge_bordersize;
|
||||
unsigned int vedge_hscrollspeed;
|
||||
unsigned int vedge_vscrollspeed;
|
||||
unsigned int vedge_maxheight;
|
||||
unsigned int vedge_maxwidth;
|
||||
unsigned int vedge_resistance;
|
||||
unsigned int vedge_attraction;
|
||||
#endif
|
||||
|
||||
char ws_cycle; /* Cycle existing workspaces */
|
||||
|
||||
+220
-127
@@ -69,6 +69,8 @@ extern WPreferences wPreferences;
|
||||
|
||||
extern Atom _XA_WM_TAKE_FOCUS;
|
||||
|
||||
extern void ProcessPendingEvents();
|
||||
|
||||
|
||||
/******* Local Variables *******/
|
||||
static struct {
|
||||
@@ -85,37 +87,6 @@ static struct {
|
||||
#define SHADE_DELAY shadePars[(int)wPreferences.shade_speed].delay
|
||||
|
||||
|
||||
static int ignoreTimestamp=0;
|
||||
|
||||
|
||||
#ifdef ANIMATIONS
|
||||
static void
|
||||
processEvents(int event_count)
|
||||
{
|
||||
XEvent event;
|
||||
|
||||
/*
|
||||
* This is a hack. When animations are enabled, processing of
|
||||
* events ocurred during a animation are delayed until it's end.
|
||||
* Calls that consider the TimeStamp, like XSetInputFocus(), will
|
||||
* fail because the TimeStamp is too old. Then, for example, if
|
||||
* the user changes window focus while a miniaturize animation is
|
||||
* in course, the window will not get focus properly after the end
|
||||
* of the animation. This tries to workaround it by passing CurrentTime
|
||||
* as the TimeStamp for XSetInputFocus() for all events ocurred during
|
||||
* the animation.
|
||||
*/
|
||||
ignoreTimestamp=1;
|
||||
while (XPending(dpy) && event_count--) {
|
||||
WMNextEvent(dpy, &event);
|
||||
WMHandleEvent(&event);
|
||||
}
|
||||
ignoreTimestamp=0;
|
||||
}
|
||||
#endif /* ANIMATIONS */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
* wSetFocusTo--
|
||||
@@ -139,33 +110,21 @@ wSetFocusTo(WScreen *scr, WWindow *wwin)
|
||||
int timestamp=LastTimestamp;
|
||||
WApplication *oapp=NULL, *napp=NULL;
|
||||
int wasfocused;
|
||||
|
||||
if (scr->flags.ignore_focus_events || LastFocusChange > timestamp)
|
||||
return;
|
||||
|
||||
if (!old_scr)
|
||||
old_scr=scr;
|
||||
old_focused=old_scr->focused_window;
|
||||
|
||||
/*
|
||||
* Safeguard: make sure the timestamp is monotonically increasing
|
||||
* (very unlikely that this will be needed, still a safeguard)
|
||||
*/
|
||||
if (timestamp <= LastFocusChange)
|
||||
timestamp = LastFocusChange + 1;
|
||||
|
||||
LastFocusChange = timestamp;
|
||||
|
||||
/*
|
||||
* This is a hack, because XSetInputFocus() should have a proper
|
||||
* timestamp instead of CurrentTime but it seems that some times
|
||||
* clients will not receive focus properly that way.
|
||||
*/
|
||||
if (ignoreTimestamp)
|
||||
timestamp = CurrentTime;
|
||||
|
||||
if (old_focused)
|
||||
oapp = wApplicationOf(old_focused->main_window);
|
||||
|
||||
if (wwin == NULL) {
|
||||
XSetInputFocus(dpy, scr->no_focus_win, RevertToParent, timestamp);
|
||||
XSetInputFocus(dpy, scr->no_focus_win, RevertToParent, CurrentTime);
|
||||
if (old_focused) {
|
||||
wWindowUnfocus(old_focused);
|
||||
}
|
||||
@@ -199,12 +158,12 @@ wSetFocusTo(WScreen *scr, WWindow *wwin)
|
||||
/* set input focus */
|
||||
switch (wwin->focus_mode) {
|
||||
case WFM_NO_INPUT:
|
||||
XSetInputFocus(dpy, scr->no_focus_win, RevertToParent, timestamp);
|
||||
XSetInputFocus(dpy, scr->no_focus_win, RevertToParent, CurrentTime);
|
||||
break;
|
||||
|
||||
case WFM_PASSIVE:
|
||||
case WFM_LOCALLY_ACTIVE:
|
||||
XSetInputFocus(dpy, wwin->client_win, RevertToParent, timestamp);
|
||||
XSetInputFocus(dpy, wwin->client_win, RevertToParent, CurrentTime);
|
||||
break;
|
||||
|
||||
case WFM_GLOBALLY_ACTIVE:
|
||||
@@ -216,7 +175,7 @@ wSetFocusTo(WScreen *scr, WWindow *wwin)
|
||||
}
|
||||
XSync(dpy, False);
|
||||
} else {
|
||||
XSetInputFocus(dpy, scr->no_focus_win, RevertToParent, timestamp);
|
||||
XSetInputFocus(dpy, scr->no_focus_win, RevertToParent, CurrentTime);
|
||||
}
|
||||
if (WFLAGP(wwin, no_focusable))
|
||||
return;
|
||||
@@ -333,9 +292,8 @@ wShadeWindow(WWindow *wwin)
|
||||
|
||||
#ifdef ANIMATIONS
|
||||
if (!wwin->screen_ptr->flags.startup) {
|
||||
/* Look at processEvents() for reason of this code. */
|
||||
XSync(dpy, 0);
|
||||
processEvents(XPending(dpy));
|
||||
/* Catch up with events not processed while animation was running */
|
||||
ProcessPendingEvents();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -419,7 +377,7 @@ wMaximizeWindow(WWindow *wwin, int directions)
|
||||
int changed_h, changed_v, shrink_h, shrink_v;
|
||||
WArea usableArea, totalArea;
|
||||
|
||||
if (WFLAGP(wwin, no_resizable))
|
||||
if (!IS_RESIZABLE(wwin))
|
||||
return;
|
||||
|
||||
totalArea.x1 = 0;
|
||||
@@ -550,6 +508,65 @@ wUnmaximizeWindow(WWindow *wwin)
|
||||
wSoundPlay(WSOUND_UNMAXIMIZE);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
wFullscreenWindow(WWindow *wwin)
|
||||
{
|
||||
int head;
|
||||
WMRect rect;
|
||||
|
||||
if (wwin->flags.fullscreen)
|
||||
return;
|
||||
|
||||
wwin->flags.fullscreen = True;
|
||||
|
||||
wWindowConfigureBorders(wwin);
|
||||
|
||||
ChangeStackingLevel(wwin->frame->core, WMFullscreenLevel);
|
||||
|
||||
wwin->bfs_geometry.x = wwin->frame_x;
|
||||
wwin->bfs_geometry.y = wwin->frame_y;
|
||||
wwin->bfs_geometry.width = wwin->frame->core->width;
|
||||
wwin->bfs_geometry.height = wwin->frame->core->height;
|
||||
|
||||
head = wGetHeadForWindow(wwin);
|
||||
rect = wGetRectForHead(wwin->screen_ptr, head);
|
||||
wWindowConfigure(wwin, rect.pos.x, rect.pos.y,
|
||||
rect.size.width, rect.size.height);
|
||||
|
||||
WMPostNotificationName(WMNChangedState, wwin, "fullscreen");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
wUnfullscreenWindow(WWindow *wwin)
|
||||
{
|
||||
if (!wwin->flags.fullscreen)
|
||||
return;
|
||||
|
||||
wwin->flags.fullscreen = False;
|
||||
|
||||
if (wwin->frame->core->stacking->window_level == WMFullscreenLevel) {
|
||||
if (WFLAGP(wwin, sunken)) {
|
||||
ChangeStackingLevel(wwin->frame->core, WMSunkenLevel);
|
||||
} else if (WFLAGP(wwin, floating)) {
|
||||
ChangeStackingLevel(wwin->frame->core, WMFloatingLevel);
|
||||
} else {
|
||||
ChangeStackingLevel(wwin->frame->core, WMNormalLevel);
|
||||
}
|
||||
}
|
||||
|
||||
wWindowConfigure(wwin, wwin->bfs_geometry.x, wwin->bfs_geometry.y,
|
||||
wwin->bfs_geometry.width, wwin->bfs_geometry.height);
|
||||
|
||||
wWindowConfigureBorders(wwin);
|
||||
// seems unnecessary, but also harmless (doesn't generate flicker) -Dan
|
||||
wFrameWindowPaint(wwin->frame);
|
||||
|
||||
WMPostNotificationName(WMNChangedState, wwin, "fullscreen");
|
||||
}
|
||||
|
||||
|
||||
#ifdef ANIMATIONS
|
||||
static void
|
||||
animateResizeFlip(WScreen *scr, int x, int y, int w, int h,
|
||||
@@ -943,7 +960,11 @@ wIconifyWindow(WWindow *wwin)
|
||||
GrabModeAsync, None, None, CurrentTime);
|
||||
}
|
||||
|
||||
if (!wPreferences.disable_miniwindows) {
|
||||
if (!wPreferences.disable_miniwindows
|
||||
#ifdef NETWM_HINTS
|
||||
&& !wwin->flags.net_handle_icon
|
||||
#endif
|
||||
) {
|
||||
if (!wwin->flags.icon_moved) {
|
||||
PlaceIcon(wwin->screen_ptr, &wwin->icon_x, &wwin->icon_y, wGetHeadForWindow(wwin));
|
||||
}
|
||||
@@ -968,7 +989,11 @@ wIconifyWindow(WWindow *wwin)
|
||||
* something before the animation starts (and the server is grabbed) */
|
||||
XSync(dpy, 0);
|
||||
|
||||
if (wPreferences.disable_miniwindows)
|
||||
if (wPreferences.disable_miniwindows
|
||||
#ifdef NETWM_HINTS
|
||||
|| wwin->flags.net_handle_icon
|
||||
#endif
|
||||
)
|
||||
wClientSetState(wwin, IconicState, None);
|
||||
else
|
||||
wClientSetState(wwin, IconicState, wwin->icon->icon_win);
|
||||
@@ -979,7 +1004,11 @@ wIconifyWindow(WWindow *wwin)
|
||||
&& !wPreferences.no_animations) {
|
||||
int ix, iy, iw, ih;
|
||||
|
||||
if (!wPreferences.disable_miniwindows) {
|
||||
if (!wPreferences.disable_miniwindows
|
||||
#ifdef NETWM_HINTS
|
||||
&& !wwin->flags.net_handle_icon
|
||||
#endif
|
||||
) {
|
||||
ix = wwin->icon_x;
|
||||
iy = wwin->icon_y;
|
||||
iw = wwin->icon->core->width;
|
||||
@@ -995,6 +1024,14 @@ wIconifyWindow(WWindow *wwin)
|
||||
ih = area.y2 - iy;
|
||||
} else
|
||||
#endif /* KWM_HINTS */
|
||||
#ifdef NETWM_HINTS
|
||||
if (wwin->flags.net_handle_icon) {
|
||||
ix = wwin->icon_x;
|
||||
iy = wwin->icon_y;
|
||||
iw = wwin->icon_w;
|
||||
ih = wwin->icon_h;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
ix = 0;
|
||||
iy = 0;
|
||||
@@ -1011,7 +1048,11 @@ wIconifyWindow(WWindow *wwin)
|
||||
|
||||
wwin->flags.skip_next_animation = 0;
|
||||
|
||||
if (!wPreferences.disable_miniwindows) {
|
||||
if (!wPreferences.disable_miniwindows
|
||||
#ifdef NETWM_HINTS
|
||||
&& !wwin->flags.net_handle_icon
|
||||
#endif
|
||||
) {
|
||||
|
||||
if (wwin->screen_ptr->current_workspace==wwin->frame->workspace ||
|
||||
IS_OMNIPRESENT(wwin) || wPreferences.sticky_icons)
|
||||
@@ -1051,20 +1092,27 @@ wIconifyWindow(WWindow *wwin)
|
||||
|
||||
#ifdef ANIMATIONS
|
||||
if (!wwin->screen_ptr->flags.startup) {
|
||||
/* Catch up with events not processed while animation was running */
|
||||
Window clientwin = wwin->client_win;
|
||||
|
||||
XSync(dpy, 0);
|
||||
processEvents(XPending(dpy));
|
||||
ProcessPendingEvents();
|
||||
|
||||
/* the window can disappear while doing the processEvents() */
|
||||
if (!wWindowFor(clientwin))
|
||||
/* the window can disappear while ProcessPendingEvents() runs */
|
||||
if (!wWindowFor(clientwin)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
if (wwin->flags.selected && !wPreferences.disable_miniwindows)
|
||||
/* maybe we want to do this regardless of net_handle_icon
|
||||
* it seems to me we might break behaviour this way.
|
||||
*/
|
||||
if (wwin->flags.selected && !wPreferences.disable_miniwindows
|
||||
#ifdef NETWM_HINTS
|
||||
&& !wwin->flags.net_handle_icon
|
||||
#endif
|
||||
)
|
||||
wIconSelect(wwin->icon);
|
||||
|
||||
WMPostNotificationName(WMNChangedState, wwin, "iconify");
|
||||
@@ -1076,7 +1124,16 @@ wIconifyWindow(WWindow *wwin)
|
||||
void
|
||||
wDeiconifyWindow(WWindow *wwin)
|
||||
{
|
||||
wWindowChangeWorkspace(wwin, wwin->screen_ptr->current_workspace);
|
||||
#ifdef NETWM_HINTS
|
||||
/* we're hiding for show_desktop */
|
||||
int netwm_hidden = wwin->flags.net_show_desktop &&
|
||||
wwin->frame->workspace!=wwin->screen_ptr->current_workspace;
|
||||
#else
|
||||
int netwm_hidden = False;
|
||||
#endif
|
||||
|
||||
if (!netwm_hidden)
|
||||
wWindowChangeWorkspace(wwin, wwin->screen_ptr->current_workspace);
|
||||
|
||||
if (!wwin->flags.miniaturized)
|
||||
return;
|
||||
@@ -1094,86 +1151,121 @@ wDeiconifyWindow(WWindow *wwin)
|
||||
}
|
||||
|
||||
wwin->flags.miniaturized = 0;
|
||||
if (!wwin->flags.shaded)
|
||||
|
||||
if (!netwm_hidden && !wwin->flags.shaded) {
|
||||
wwin->flags.mapped = 1;
|
||||
|
||||
if (!wPreferences.disable_miniwindows && wwin->icon != NULL) {
|
||||
if (wwin->icon->selected)
|
||||
wIconSelect(wwin->icon);
|
||||
|
||||
XUnmapWindow(dpy, wwin->icon->core->window);
|
||||
}
|
||||
|
||||
wSoundPlay(WSOUND_DEICONIFY);
|
||||
if (!netwm_hidden || wPreferences.sticky_icons) {
|
||||
/* maybe we want to do this regardless of net_handle_icon
|
||||
* it seems to me we might break behaviour this way.
|
||||
*/
|
||||
if (!wPreferences.disable_miniwindows
|
||||
#ifdef NETWM_HINTS
|
||||
&& !wwin->flags.net_handle_icon
|
||||
#endif
|
||||
&& wwin->icon != NULL) {
|
||||
if (wwin->icon->selected)
|
||||
wIconSelect(wwin->icon);
|
||||
|
||||
XUnmapWindow(dpy, wwin->icon->core->window);
|
||||
}
|
||||
}
|
||||
|
||||
if (!netwm_hidden)
|
||||
wSoundPlay(WSOUND_DEICONIFY);
|
||||
|
||||
/* if the window is in another workspace, do it silently */
|
||||
if (!netwm_hidden) {
|
||||
#ifdef ANIMATIONS
|
||||
if (!wwin->screen_ptr->flags.startup && !wPreferences.no_animations
|
||||
&& !wwin->flags.skip_next_animation && wwin->icon != NULL) {
|
||||
int ix, iy, iw, ih;
|
||||
if (!wwin->screen_ptr->flags.startup && !wPreferences.no_animations
|
||||
&& !wwin->flags.skip_next_animation && wwin->icon != NULL) {
|
||||
int ix, iy, iw, ih;
|
||||
|
||||
if (!wPreferences.disable_miniwindows) {
|
||||
ix = wwin->icon_x;
|
||||
iy = wwin->icon_y;
|
||||
iw = wwin->icon->core->width;
|
||||
ih = wwin->icon->core->height;
|
||||
} else {
|
||||
if (!wPreferences.disable_miniwindows
|
||||
#ifdef NETWM_HINTS
|
||||
&& !wwin->flags.net_handle_icon
|
||||
#endif
|
||||
) {
|
||||
ix = wwin->icon_x;
|
||||
iy = wwin->icon_y;
|
||||
iw = wwin->icon->core->width;
|
||||
ih = wwin->icon->core->height;
|
||||
} else {
|
||||
#ifdef KWM_HINTS
|
||||
WArea area;
|
||||
WArea area;
|
||||
|
||||
if (wKWMGetIconGeometry(wwin, &area)) {
|
||||
ix = area.x1;
|
||||
iy = area.y1;
|
||||
iw = area.x2 - ix;
|
||||
ih = area.y2 - iy;
|
||||
} else
|
||||
if (wKWMGetIconGeometry(wwin, &area)) {
|
||||
ix = area.x1;
|
||||
iy = area.y1;
|
||||
iw = area.x2 - ix;
|
||||
ih = area.y2 - iy;
|
||||
} else
|
||||
#endif /* KWM_HINTS */
|
||||
{
|
||||
ix = 0;
|
||||
iy = 0;
|
||||
iw = wwin->screen_ptr->scr_width;
|
||||
ih = wwin->screen_ptr->scr_height;
|
||||
}
|
||||
}
|
||||
animateResize(wwin->screen_ptr, ix, iy, iw, ih,
|
||||
wwin->frame_x, wwin->frame_y,
|
||||
wwin->frame->core->width, wwin->frame->core->height,
|
||||
False);
|
||||
}
|
||||
#ifdef NETWM_HINTS
|
||||
if (wwin->flags.net_handle_icon) {
|
||||
ix = wwin->icon_x;
|
||||
iy = wwin->icon_y;
|
||||
iw = wwin->icon_w;
|
||||
ih = wwin->icon_h;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
ix = 0;
|
||||
iy = 0;
|
||||
iw = wwin->screen_ptr->scr_width;
|
||||
ih = wwin->screen_ptr->scr_height;
|
||||
}
|
||||
}
|
||||
animateResize(wwin->screen_ptr, ix, iy, iw, ih,
|
||||
wwin->frame_x, wwin->frame_y,
|
||||
wwin->frame->core->width, wwin->frame->core->height,
|
||||
False);
|
||||
}
|
||||
#endif /* ANIMATIONS */
|
||||
wwin->flags.skip_next_animation = 0;
|
||||
XGrabServer(dpy);
|
||||
if (!wwin->flags.shaded) {
|
||||
XMapWindow(dpy, wwin->client_win);
|
||||
wwin->flags.skip_next_animation = 0;
|
||||
XGrabServer(dpy);
|
||||
if (!wwin->flags.shaded) {
|
||||
XMapWindow(dpy, wwin->client_win);
|
||||
}
|
||||
XMapWindow(dpy, wwin->frame->core->window);
|
||||
wRaiseFrame(wwin->frame->core);
|
||||
if (!wwin->flags.shaded) {
|
||||
wClientSetState(wwin, NormalState, None);
|
||||
}
|
||||
mapTransientsFor(wwin);
|
||||
}
|
||||
XMapWindow(dpy, wwin->frame->core->window);
|
||||
wRaiseFrame(wwin->frame->core);
|
||||
if (!wwin->flags.shaded) {
|
||||
wClientSetState(wwin, NormalState, None);
|
||||
}
|
||||
mapTransientsFor(wwin);
|
||||
|
||||
if (!wPreferences.disable_miniwindows && wwin->icon != NULL) {
|
||||
if (!wPreferences.disable_miniwindows && wwin->icon != NULL
|
||||
#ifdef NETWM_HINTS
|
||||
&& !wwin->flags.net_handle_icon
|
||||
#endif
|
||||
) {
|
||||
RemoveFromStackList(wwin->icon->core);
|
||||
/* removeIconGrabs(wwin->icon);*/
|
||||
wIconDestroy(wwin->icon);
|
||||
wwin->icon = NULL;
|
||||
}
|
||||
XUngrabServer(dpy);
|
||||
|
||||
wSetFocusTo(wwin->screen_ptr, wwin);
|
||||
if (!netwm_hidden) {
|
||||
XUngrabServer(dpy);
|
||||
|
||||
wSetFocusTo(wwin->screen_ptr, wwin);
|
||||
|
||||
#ifdef ANIMATIONS
|
||||
if (!wwin->screen_ptr->flags.startup) {
|
||||
Window clientwin = wwin->client_win;
|
||||
if (!wwin->screen_ptr->flags.startup) {
|
||||
/* Catch up with events not processed while animation was running */
|
||||
Window clientwin = wwin->client_win;
|
||||
|
||||
XSync(dpy, 0);
|
||||
processEvents(XPending(dpy));
|
||||
ProcessPendingEvents();
|
||||
|
||||
if (!wWindowFor(clientwin))
|
||||
return;
|
||||
}
|
||||
/* the window can disappear while ProcessPendingEvents() runs */
|
||||
if (!wWindowFor(clientwin)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (wPreferences.auto_arrange_icons) {
|
||||
wArrangeIcons(wwin->screen_ptr, True);
|
||||
@@ -1182,7 +1274,8 @@ wDeiconifyWindow(WWindow *wwin)
|
||||
WMPostNotificationName(WMNChangedState, wwin, "iconify");
|
||||
|
||||
/* In case we were shaded and iconified, also unshade */
|
||||
wUnshadeWindow(wwin);
|
||||
if (!netwm_hidden)
|
||||
wUnshadeWindow(wwin);
|
||||
}
|
||||
|
||||
|
||||
@@ -1618,9 +1711,9 @@ wArrangeIcons(WScreen *scr, Bool arrangeAll)
|
||||
|
||||
while (aicon) {
|
||||
if (!aicon->docked) {
|
||||
/* XXX: can: icon == NULL ? */
|
||||
/* The intention here is to place the AppIcon on the head that contains most of the applications _main_ window. */
|
||||
/* printf("appicon: %x %x\n", aicon->icon->core->window, aicon->main_window); */
|
||||
/* CHECK: can icon be NULL here ? */
|
||||
/* The intention here is to place the AppIcon on the head that
|
||||
* contains most of the applications _main_ window. */
|
||||
head = wGetHeadForWindow(aicon->icon->owner);
|
||||
|
||||
if (aicon->x_pos != X || aicon->y_pos != Y) {
|
||||
@@ -1847,7 +1940,7 @@ wSelectWindow(WWindow *wwin, Bool flag)
|
||||
wwin->flags.selected = 1;
|
||||
XSetWindowBorder(dpy, wwin->frame->core->window, scr->white_pixel);
|
||||
|
||||
if (WFLAGP(wwin, no_border)) {
|
||||
if (!HAS_BORDER(wwin)) {
|
||||
XSetWindowBorderWidth(dpy, wwin->frame->core->window,
|
||||
FRAME_BORDER_WIDTH);
|
||||
}
|
||||
@@ -1860,7 +1953,7 @@ wSelectWindow(WWindow *wwin, Bool flag)
|
||||
XSetWindowBorder(dpy, wwin->frame->core->window,
|
||||
scr->frame_border_pixel);
|
||||
|
||||
if (WFLAGP(wwin, no_border)) {
|
||||
if (!HAS_BORDER(wwin)) {
|
||||
XSetWindowBorderWidth(dpy, wwin->frame->core->window, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,4 +65,8 @@ void wArrangeIcons(WScreen *scr, Bool arrangeAll);
|
||||
|
||||
void wMakeWindowVisible(WWindow *wwin);
|
||||
|
||||
void wFullscreenWindow(WWindow *wwin);
|
||||
void wUnfullscreenWindow(WWindow *wwin);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -407,7 +407,7 @@ setIconCallback(WMenu *menu, WMenuEntry *entry)
|
||||
result = wIconChooserDialog(scr, &file, icon->wm_instance, icon->wm_class);
|
||||
|
||||
if (result && !icon->destroyed) {
|
||||
if (file[0]==0) {
|
||||
if (file && *file==0) {
|
||||
wfree(file);
|
||||
file = NULL;
|
||||
}
|
||||
|
||||
+18
-11
@@ -50,6 +50,8 @@
|
||||
#include "dock.h"
|
||||
#include "wsound.h"
|
||||
|
||||
#include "xinerama.h"
|
||||
|
||||
|
||||
/******** Global variables ********/
|
||||
|
||||
@@ -123,16 +125,14 @@ findDockIconFor(WDock *dock, Window main_window)
|
||||
static void
|
||||
extractIcon(WWindow *wwin)
|
||||
{
|
||||
int argc;
|
||||
char **argv;
|
||||
|
||||
if (!XGetCommand(dpy, wwin->client_win, &argv, &argc) || argc < 1)
|
||||
return;
|
||||
char *progname;
|
||||
|
||||
wApplicationExtractDirPackIcon(wwin->screen_ptr,argv[0],
|
||||
wwin->wm_instance,
|
||||
wwin->wm_class);
|
||||
XFreeStringList(argv);
|
||||
progname = GetProgramNameForWindow(wwin->client_win);
|
||||
if (progname) {
|
||||
wApplicationExtractDirPackIcon(wwin->screen_ptr, progname,
|
||||
wwin->wm_instance, wwin->wm_class);
|
||||
wfree(progname);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ saveIconNameFor(char *iconPath, char *wm_instance, char *wm_class)
|
||||
val = WMGetFromPLDictionary(adict, iconk);
|
||||
} else {
|
||||
/* no dictionary for app, so create one */
|
||||
adict = WMCreatePLDictionary(NULL, NULL, NULL);
|
||||
adict = WMCreatePLDictionary(NULL, NULL);
|
||||
WMPutInPLDictionary(dict, key, adict);
|
||||
WMReleasePropList(adict);
|
||||
val = NULL;
|
||||
@@ -246,8 +246,10 @@ extractClientIcon(WAppIcon *icon)
|
||||
|
||||
|
||||
WApplication*
|
||||
wApplicationCreate(WScreen *scr, Window main_window)
|
||||
wApplicationCreate(WWindow *wwin)
|
||||
{
|
||||
WScreen *scr = wwin->screen_ptr;
|
||||
Window main_window = wwin->main_window;
|
||||
WApplication *wapp;
|
||||
WWindow *leader;
|
||||
|
||||
@@ -295,6 +297,11 @@ wApplicationCreate(WScreen *scr, Window main_window)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wapp->main_window_desc->fake_group = wwin->fake_group;
|
||||
#ifdef NETWM_HINTS
|
||||
wapp->main_window_desc->net_icon_image = RRetainImage(wwin->net_icon_image);
|
||||
#endif
|
||||
|
||||
extractIcon(wapp->main_window_desc);
|
||||
|
||||
leader = wWindowFor(main_window);
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ typedef struct WApplication {
|
||||
} WApplication;
|
||||
|
||||
|
||||
WApplication *wApplicationCreate(WScreen *scr, Window main_window);
|
||||
WApplication *wApplicationCreate(struct WWindow *wwin);
|
||||
void wApplicationDestroy(WApplication *wapp);
|
||||
|
||||
WApplication *wApplicationOf(Window window);
|
||||
|
||||
+27
-22
@@ -46,6 +46,9 @@
|
||||
#ifdef KWM_HINTS
|
||||
#include "kwm.h"
|
||||
#endif
|
||||
#ifdef NETWM_HINTS
|
||||
# include "wmspec.h"
|
||||
#endif
|
||||
|
||||
|
||||
/****** Global Variables ******/
|
||||
@@ -239,7 +242,7 @@ wClientConfigure(WWindow *wwin, XConfigureRequestEvent *xcre)
|
||||
/* If the window is shaded, wrong height will be set for the window */
|
||||
if (xcre->value_mask & CWX) {
|
||||
nx = xcre->x;
|
||||
if (!WFLAGP(wwin, no_border))
|
||||
if (HAS_BORDER(wwin))
|
||||
nx -= FRAME_BORDER_WIDTH;
|
||||
}
|
||||
else
|
||||
@@ -247,7 +250,7 @@ wClientConfigure(WWindow *wwin, XConfigureRequestEvent *xcre)
|
||||
|
||||
if (xcre->value_mask & CWY) {
|
||||
ny = xcre->y - ((ofs_y < 0) ? 0 : wwin->frame->top_width);
|
||||
if (!WFLAGP(wwin, no_border))
|
||||
if (HAS_BORDER(wwin))
|
||||
ny -= FRAME_BORDER_WIDTH;
|
||||
}
|
||||
else
|
||||
@@ -353,22 +356,17 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event)
|
||||
case XA_WM_COMMAND:
|
||||
if (wwin->main_window!=None) {
|
||||
WApplication *wapp = wApplicationOf(wwin->main_window);
|
||||
char **argv;
|
||||
int argc;
|
||||
char *command;
|
||||
|
||||
if (!wapp || !wapp->app_icon)
|
||||
if (!wapp || !wapp->app_icon || wapp->app_icon->docked)
|
||||
break;
|
||||
|
||||
if (XGetCommand(dpy, wwin->main_window, &argv, &argc)) {
|
||||
if (argc > 0 && argv != NULL) {
|
||||
if (wapp->app_icon->command)
|
||||
wfree(wapp->app_icon->command);
|
||||
wapp->app_icon->command = wtokenjoin(argv, argc);
|
||||
}
|
||||
if (argv) {
|
||||
XFreeStringList(argv);
|
||||
}
|
||||
}
|
||||
command = GetCommandForWindow(wwin->main_window);
|
||||
if (command) {
|
||||
if (wapp->app_icon->command)
|
||||
wfree(wapp->app_icon->command);
|
||||
wapp->app_icon->command = command;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -457,7 +455,7 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event)
|
||||
wApplicationDestroy(wApplicationOf(wwin->main_window));
|
||||
wwin->main_window = wwin->client_leader;
|
||||
wwin->group_id = None;
|
||||
wApplicationCreate(wwin->screen_ptr, wwin->main_window);
|
||||
wApplicationCreate(wwin);
|
||||
break;
|
||||
|
||||
/* 1,2,4 - change leader to new value of window_group */
|
||||
@@ -467,7 +465,7 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event)
|
||||
wApplicationDestroy(wApplicationOf(wwin->main_window));
|
||||
wwin->main_window = new_hints->window_group;
|
||||
wwin->group_id = wwin->main_window;
|
||||
wApplicationCreate(wwin->screen_ptr, wwin->main_window);
|
||||
wApplicationCreate(wwin);
|
||||
break;
|
||||
|
||||
/* 5 - destroy application */
|
||||
@@ -481,7 +479,7 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event)
|
||||
case 6:
|
||||
wwin->main_window = new_hints->window_group;
|
||||
wwin->group_id = wwin->main_window;
|
||||
wApplicationCreate(wwin->screen_ptr, wwin->main_window);
|
||||
wApplicationCreate(wwin);
|
||||
break;
|
||||
/* 7 - we have a fake window group id, so just ignore anything else */
|
||||
case 7:
|
||||
@@ -630,7 +628,7 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event)
|
||||
else
|
||||
foo->main_window = None;
|
||||
if (foo->main_window) {
|
||||
wapp = wApplicationCreate(scr, foo->main_window);
|
||||
wapp = wApplicationCreate(foo);
|
||||
}
|
||||
}
|
||||
foo = foo->prev;
|
||||
@@ -665,11 +663,18 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event)
|
||||
|
||||
XFree(attr);
|
||||
} else {
|
||||
#if defined(KWM_HINTS) || defined(NETWM_HINTS)
|
||||
Bool done = False;
|
||||
#endif
|
||||
#ifdef KWM_HINTS
|
||||
Bool done;
|
||||
|
||||
done = wKWMCheckClientHintChange(wwin, event);
|
||||
if (!done)
|
||||
done = wKWMCheckClientHintChange(wwin, event);
|
||||
#endif /* KWM_HINTS */
|
||||
#ifdef NETWM_HINTS
|
||||
if (!done) {
|
||||
done = wNETWMCheckClientHintChange(wwin, event);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+19
-9
@@ -198,7 +198,9 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
||||
if (hasModifier) {
|
||||
keymap = XGetModifierMapping(dpy);
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("Grabbing keyboard\n");
|
||||
#endif
|
||||
XGrabKeyboard(dpy, scr->root_win, False, GrabModeAsync, GrabModeAsync,
|
||||
CurrentTime);
|
||||
}
|
||||
@@ -223,11 +225,6 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
||||
wWindowFocus(newFocused, scr->focused_window);
|
||||
oldFocused = newFocused;
|
||||
|
||||
if (hasModifier)
|
||||
done = False;
|
||||
else
|
||||
done = True;
|
||||
|
||||
#if 0
|
||||
if (wPreferences.popup_switchmenu &&
|
||||
(!scr->switch_menu || !scr->switch_menu->flags.mapped)) {
|
||||
@@ -236,8 +233,9 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
||||
openedSwitchMenu = True;
|
||||
}
|
||||
#endif
|
||||
while (!done) {
|
||||
WMMaskEvent(dpy,KeyPressMask|KeyReleaseMask|ExposureMask, &ev);
|
||||
|
||||
while (hasModifier && !done) {
|
||||
WMMaskEvent(dpy, KeyPressMask|KeyReleaseMask|ExposureMask, &ev);
|
||||
|
||||
if (ev.type != KeyRelease && ev.type != KeyPress) {
|
||||
WMHandleEvent(&ev);
|
||||
@@ -247,7 +245,10 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
||||
modifiers = ev.xkey.state & ValidModMask;
|
||||
|
||||
if (ev.type == KeyPress) {
|
||||
if (wKeyBindings[WKBD_FOCUSNEXT].keycode == ev.xkey.keycode
|
||||
#ifdef DEBUG
|
||||
printf("Got key press\n");
|
||||
#endif
|
||||
if (wKeyBindings[WKBD_FOCUSNEXT].keycode == ev.xkey.keycode
|
||||
&& wKeyBindings[WKBD_FOCUSNEXT].modifier == modifiers) {
|
||||
|
||||
newFocused = nextToFocusAfter(newFocused);
|
||||
@@ -274,12 +275,18 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
||||
}
|
||||
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
printf("Got something else\n");
|
||||
#endif
|
||||
somethingElse = True;
|
||||
done = True;
|
||||
}
|
||||
} else if (ev.type == KeyRelease) {
|
||||
int i;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("Got key release\n");
|
||||
#endif
|
||||
for (i = 0; i < 8 * keymap->max_keypermod; i++) {
|
||||
if (keymap->modifiermap[i] == ev.xkey.keycode &&
|
||||
wKeyBindings[WKBD_FOCUSNEXT].modifier
|
||||
@@ -294,6 +301,9 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
||||
XFreeModifiermap(keymap);
|
||||
|
||||
if (hasModifier) {
|
||||
#ifdef DEBUG
|
||||
printf("Ungrabbing keyboard\n");
|
||||
#endif
|
||||
XUngrabKeyboard(dpy, CurrentTime);
|
||||
}
|
||||
wSetFocusTo(scr, newFocused);
|
||||
|
||||
+32
-7
@@ -155,6 +155,9 @@ static int setUTitleBack();
|
||||
static int setResizebarBack();
|
||||
static int setWorkspaceBack();
|
||||
static int setWorkspaceSpecificBack();
|
||||
#ifdef VIRTUAL_DESKTOP
|
||||
static int setVirtualEdgeThickness();
|
||||
#endif
|
||||
static int setMenuTitleColor();
|
||||
static int setMenuTextColor();
|
||||
static int setMenuDisabledColor();
|
||||
@@ -436,22 +439,34 @@ WDefaultEntry optionList[] = {
|
||||
},
|
||||
#ifdef VIRTUAL_DESKTOP
|
||||
{"VirtualEdgeThickness", "1", NULL,
|
||||
&wPreferences.vedge_thickness, getInt, NULL
|
||||
&wPreferences.vedge_thickness, getInt, setVirtualEdgeThickness
|
||||
},
|
||||
{"VirtualEdgeExtendSpace", "0", NULL,
|
||||
&wPreferences.vedge_bordersize, getInt, NULL
|
||||
},
|
||||
{"VirtualEdgeHorizonScrollSpeed", "1", NULL,
|
||||
{"VirtualEdgeHorizonScrollSpeed", "30", NULL,
|
||||
&wPreferences.vedge_hscrollspeed, getInt, NULL
|
||||
},
|
||||
{"VirtualEdgeVerticalScrollSpeed", "1", NULL,
|
||||
{"VirtualEdgeVerticalScrollSpeed", "30", NULL,
|
||||
&wPreferences.vedge_vscrollspeed, getInt, NULL
|
||||
},
|
||||
{"VirtualEdgeMaximumWidth", "3000", NULL,
|
||||
&wPreferences.vedge_maxwidth, getInt, NULL
|
||||
{"VirtualEdgeResistance", "30", NULL,
|
||||
&wPreferences.vedge_resistance, getInt, NULL
|
||||
},
|
||||
{"VirtualEdgeMaximumHeight", "3000", NULL,
|
||||
&wPreferences.vedge_maxheight, getInt, NULL
|
||||
{"VirtualEdgeAttraction", "30", NULL,
|
||||
&wPreferences.vedge_attraction, getInt, NULL
|
||||
},
|
||||
{"VirtualEdgeLeftKey", "None", (void*)WKBD_VDESK_LEFT,
|
||||
NULL, getKeybind, setKeyGrab
|
||||
},
|
||||
{"VirtualEdgeRightKey", "None", (void*)WKBD_VDESK_RIGHT,
|
||||
NULL, getKeybind, setKeyGrab
|
||||
},
|
||||
{"VirtualEdgeUpKey", "None", (void*)WKBD_VDESK_UP,
|
||||
NULL, getKeybind, setKeyGrab
|
||||
},
|
||||
{"VirtualEdgeDownKey", "None", (void*)WKBD_VDESK_DOWN,
|
||||
NULL, getKeybind, setKeyGrab
|
||||
},
|
||||
#endif
|
||||
{"StickyIcons", "NO", NULL,
|
||||
@@ -3352,6 +3367,16 @@ setWorkspaceBack(WScreen *scr, WDefaultEntry *entry, WMPropList *value,
|
||||
}
|
||||
|
||||
|
||||
#ifdef VIRTUAL_DESKTOP
|
||||
static int
|
||||
setVirtualEdgeThickness(WScreen *scr, WDefaultEntry *entry, XColor *color, long index)
|
||||
{
|
||||
wWorkspaceUpdateEdge(scr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static int
|
||||
setWidgetColor(WScreen *scr, WDefaultEntry *entry, WTexture **texture, void *foo)
|
||||
{
|
||||
|
||||
+26
-8
@@ -785,7 +785,7 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
|
||||
/* check if the file the user selected is not the one that
|
||||
* would be loaded by default with the current search path */
|
||||
*file = WMGetListSelectedItem(panel->iconList)->text;
|
||||
if ((*file)[0]==0) {
|
||||
if (**file==0) {
|
||||
wfree(*file);
|
||||
*file = NULL;
|
||||
} else {
|
||||
@@ -804,6 +804,8 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
|
||||
*file = NULL;
|
||||
}
|
||||
|
||||
result = panel->result;
|
||||
|
||||
WMReleaseFont(panel->normalfont);
|
||||
|
||||
WMUnmapWidget(panel->win);
|
||||
@@ -812,8 +814,6 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
|
||||
|
||||
wUnmanageWindow(wwin, False, False);
|
||||
|
||||
result= panel->result;
|
||||
|
||||
wfree(panel);
|
||||
|
||||
XDestroyWindow(dpy, parent);
|
||||
@@ -862,8 +862,8 @@ typedef struct {
|
||||
|
||||
|
||||
#define COPYRIGHT_TEXT \
|
||||
"Copyright © 1997-2004 Alfredo K. Kojima <kojima@windowmaker.org>\n"\
|
||||
"Copyright © 1998-2004 Dan Pascu <dan@windowmaker.org>"
|
||||
"Copyright \xc2\xa9 1997-2004 Alfredo K. Kojima <kojima@windowmaker.org>\n"\
|
||||
"Copyright \xc2\xa9 1998-2004 Dan Pascu <dan@windowmaker.org>"
|
||||
|
||||
|
||||
|
||||
@@ -1314,8 +1314,6 @@ wShowInfoPanel(WScreen *scr)
|
||||
WMMoveWidget(panel->copyrL, 15, 185);
|
||||
WMSetLabelTextAlignment(panel->copyrL, WALeft);
|
||||
WMSetLabelText(panel->copyrL, COPYRIGHT_TEXT);
|
||||
/* we want the (c) character in the font, so don't use a FontSet here */
|
||||
// fix this -Dan font = WMCreateFontWithFlags(scr->wmscreen, "SystemFont-11", WFNormalFont);
|
||||
font = WMSystemFontOfSize(scr->wmscreen, 11);
|
||||
if (font) {
|
||||
WMSetLabelFont(panel->copyrL, font);
|
||||
@@ -1368,7 +1366,7 @@ wShowInfoPanel(WScreen *scr)
|
||||
|
||||
strbuf = wstrappend(strbuf, _("\nAdditional support for: "));
|
||||
{
|
||||
char *list[8];
|
||||
char *list[9];
|
||||
char buf[80];
|
||||
int j = 0;
|
||||
|
||||
@@ -1384,6 +1382,9 @@ wShowInfoPanel(WScreen *scr)
|
||||
#ifdef OLWM_HINTS
|
||||
list[j++] = "OLWM";
|
||||
#endif
|
||||
#ifdef NETWM_HINTS
|
||||
list[j++] = "WMSPEC";
|
||||
#endif
|
||||
|
||||
buf[0] = 0;
|
||||
for (i = 0; i < j; i++) {
|
||||
@@ -1408,6 +1409,23 @@ wShowInfoPanel(WScreen *scr)
|
||||
strbuf = wstrappend(strbuf, _("; Antialiased text"));
|
||||
#endif
|
||||
|
||||
#ifdef VIRTUAL_DESKTOP
|
||||
strbuf = wstrappend(strbuf, _("; VirtualDesktop"));
|
||||
#endif
|
||||
|
||||
#ifdef XINERAMA
|
||||
strbuf = wstrappend(strbuf, _("\n"));
|
||||
#ifdef SOLARIS_XINERAMA
|
||||
strbuf = wstrappend(strbuf, _("Solaris "));
|
||||
#endif
|
||||
strbuf = wstrappend(strbuf, _("Xinerama: "));
|
||||
{
|
||||
char tmp[128];
|
||||
snprintf(tmp, sizeof(tmp)-1, "%d heads found.", scr->xine_info.count);
|
||||
strbuf = wstrappend(strbuf, tmp);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
panel->infoL = WMCreateLabel(panel->win);
|
||||
WMResizeWidget(panel->infoL, 350, 75);
|
||||
|
||||
+62
-75
@@ -956,9 +956,8 @@ launchDockedApplication(WAppIcon *btn, Bool withSelection)
|
||||
btn->drop_launch = 0;
|
||||
btn->paste_launch = withSelection;
|
||||
scr->last_dock = btn->dock;
|
||||
btn->pid = execCommand(btn,
|
||||
withSelection ? btn->paste_command : btn->command,
|
||||
NULL);
|
||||
btn->pid = execCommand(btn, (withSelection ? btn->paste_command :
|
||||
btn->command), NULL);
|
||||
if (btn->pid>0) {
|
||||
if (btn->buggy_app) {
|
||||
/* give feedback that the app was launched */
|
||||
@@ -972,8 +971,9 @@ launchDockedApplication(WAppIcon *btn, Bool withSelection)
|
||||
} else {
|
||||
wwarning(_("could not launch application %s\n"), btn->command);
|
||||
btn->launching = 0;
|
||||
if (!btn->relaunching)
|
||||
if (!btn->relaunching) {
|
||||
btn->running = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1386,13 +1386,13 @@ make_icon_state(WAppIcon *btn)
|
||||
position = WMCreatePLString(buffer);
|
||||
|
||||
node = WMCreatePLDictionary(dCommand, command,
|
||||
dName, name,
|
||||
dAutoLaunch, autolaunch,
|
||||
dLock, lock,
|
||||
dForced, forced,
|
||||
dBuggyApplication, buggy,
|
||||
dPosition, position,
|
||||
NULL);
|
||||
dName, name,
|
||||
dAutoLaunch, autolaunch,
|
||||
dLock, lock,
|
||||
dForced, forced,
|
||||
dBuggyApplication, buggy,
|
||||
dPosition, position,
|
||||
NULL);
|
||||
WMReleasePropList(command);
|
||||
WMReleasePropList(name);
|
||||
WMReleasePropList(position);
|
||||
@@ -1450,8 +1450,7 @@ dockSaveState(WDock *dock)
|
||||
}
|
||||
}
|
||||
|
||||
dock_state = WMCreatePLDictionary(dApplications, list,
|
||||
NULL);
|
||||
dock_state = WMCreatePLDictionary(dApplications, list, NULL);
|
||||
|
||||
if (dock->type == WM_DOCK) {
|
||||
snprintf(buffer, sizeof(buffer), "Applications%i", dock->screen_ptr->scr_height);
|
||||
@@ -1512,9 +1511,8 @@ wDockSaveState(WScreen *scr, WMPropList *old_state)
|
||||
if (strncasecmp(WMGetFromPLString(tmp), "applications", 12) == 0
|
||||
&& !WMGetFromPLDictionary(dock_state, tmp)) {
|
||||
|
||||
WMPutInPLDictionary(dock_state,
|
||||
tmp,
|
||||
WMGetFromPLDictionary(old_state, tmp));
|
||||
WMPutInPLDictionary(dock_state, tmp,
|
||||
WMGetFromPLDictionary(old_state, tmp));
|
||||
}
|
||||
}
|
||||
WMReleasePropList(keys);
|
||||
@@ -1774,9 +1772,9 @@ wDockRestoreState(WScreen *scr, WMPropList *dock_state, int type)
|
||||
value = WMGetFromPLDictionary(dock_state, dPosition);
|
||||
|
||||
if (value) {
|
||||
if (!WMIsPLString(value))
|
||||
if (!WMIsPLString(value)) {
|
||||
COMPLAIN("Position");
|
||||
else {
|
||||
} else {
|
||||
WMRect rect;
|
||||
int flags;
|
||||
|
||||
@@ -1795,12 +1793,13 @@ wDockRestoreState(WScreen *scr, WMPropList *dock_state, int type)
|
||||
wScreenKeepInside(scr, &x, &dock->y_pos, ICON_SIZE, ICON_SIZE);
|
||||
}
|
||||
|
||||
/* This is no more needed. ??? */
|
||||
/* Is this needed any more? */
|
||||
if (type == WM_CLIP) {
|
||||
if (dock->x_pos < 0)
|
||||
if (dock->x_pos < 0) {
|
||||
dock->x_pos = 0;
|
||||
else if (dock->x_pos > scr->scr_width-ICON_SIZE)
|
||||
} else if (dock->x_pos > scr->scr_width-ICON_SIZE) {
|
||||
dock->x_pos = scr->scr_width-ICON_SIZE;
|
||||
}
|
||||
} else {
|
||||
if (dock->x_pos >= 0) {
|
||||
dock->x_pos = DOCK_EXTRA_SPACE;
|
||||
@@ -1820,11 +1819,12 @@ wDockRestoreState(WScreen *scr, WMPropList *dock_state, int type)
|
||||
value = WMGetFromPLDictionary(dock_state, dLowered);
|
||||
|
||||
if (value) {
|
||||
if (!WMIsPLString(value))
|
||||
if (!WMIsPLString(value)) {
|
||||
COMPLAIN("Lowered");
|
||||
else {
|
||||
if (strcasecmp(WMGetFromPLString(value), "YES")==0)
|
||||
} else {
|
||||
if (strcasecmp(WMGetFromPLString(value), "YES")==0) {
|
||||
dock->lowered = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1836,11 +1836,12 @@ wDockRestoreState(WScreen *scr, WMPropList *dock_state, int type)
|
||||
value = WMGetFromPLDictionary(dock_state, dCollapsed);
|
||||
|
||||
if (value) {
|
||||
if (!WMIsPLString(value))
|
||||
if (!WMIsPLString(value)) {
|
||||
COMPLAIN("Collapsed");
|
||||
else {
|
||||
if (strcasecmp(WMGetFromPLString(value), "YES")==0)
|
||||
} else {
|
||||
if (strcasecmp(WMGetFromPLString(value), "YES")==0) {
|
||||
dock->collapsed = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1850,9 +1851,9 @@ wDockRestoreState(WScreen *scr, WMPropList *dock_state, int type)
|
||||
value = WMGetFromPLDictionary(dock_state, dAutoCollapse);
|
||||
|
||||
if (value) {
|
||||
if (!WMIsPLString(value))
|
||||
if (!WMIsPLString(value)) {
|
||||
COMPLAIN("AutoCollapse");
|
||||
else {
|
||||
} else {
|
||||
if (strcasecmp(WMGetFromPLString(value), "YES")==0) {
|
||||
dock->auto_collapse = 1;
|
||||
dock->collapsed = 1;
|
||||
@@ -1866,9 +1867,9 @@ wDockRestoreState(WScreen *scr, WMPropList *dock_state, int type)
|
||||
value = WMGetFromPLDictionary(dock_state, dAutoRaiseLower);
|
||||
|
||||
if (value) {
|
||||
if (!WMIsPLString(value))
|
||||
if (!WMIsPLString(value)) {
|
||||
COMPLAIN("AutoRaiseLower");
|
||||
else {
|
||||
} else {
|
||||
if (strcasecmp(WMGetFromPLString(value), "YES")==0) {
|
||||
dock->auto_raise_lower = 1;
|
||||
}
|
||||
@@ -1882,11 +1883,12 @@ wDockRestoreState(WScreen *scr, WMPropList *dock_state, int type)
|
||||
value = WMGetFromPLDictionary(dock_state, dAutoAttractIcons);
|
||||
|
||||
if (value) {
|
||||
if (!WMIsPLString(value))
|
||||
if (!WMIsPLString(value)) {
|
||||
COMPLAIN("AutoAttractIcons");
|
||||
else {
|
||||
if (strcasecmp(WMGetFromPLString(value), "YES")==0)
|
||||
} else {
|
||||
if (strcasecmp(WMGetFromPLString(value), "YES")==0) {
|
||||
dock->attract_icons = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2136,21 +2138,19 @@ Bool
|
||||
wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y)
|
||||
{
|
||||
WWindow *wwin;
|
||||
char **argv;
|
||||
int argc;
|
||||
int index;
|
||||
|
||||
wwin = icon->icon->owner;
|
||||
if (icon->command==NULL) {
|
||||
icon->editing = 0;
|
||||
if (XGetCommand(dpy, wwin->client_win, &argv, &argc) && argc>0) {
|
||||
char *command;
|
||||
|
||||
icon->command = wtokenjoin(argv, argc);
|
||||
XFreeStringList(argv);
|
||||
icon->editing = 0;
|
||||
|
||||
command = GetCommandForWindow(wwin->client_win);
|
||||
if (command) {
|
||||
icon->command = command;
|
||||
} else {
|
||||
char *command=NULL;
|
||||
|
||||
/* icon->forced_dock = 1;*/
|
||||
/* icon->forced_dock = 1;*/
|
||||
if (dock->type!=WM_CLIP || !icon->attracted) {
|
||||
icon->editing = 1;
|
||||
if (wInputDialog(dock->screen_ptr, _("Dock Icon"),
|
||||
@@ -2181,7 +2181,7 @@ wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
icon->editing = 0;
|
||||
}
|
||||
@@ -2266,8 +2266,7 @@ Bool
|
||||
moveIconBetweenDocks(WDock *src, WDock *dest, WAppIcon *icon, int x, int y)
|
||||
{
|
||||
WWindow *wwin;
|
||||
char **argv;
|
||||
int argc;
|
||||
char *command;
|
||||
int index;
|
||||
|
||||
if (src == dest)
|
||||
@@ -2285,15 +2284,12 @@ moveIconBetweenDocks(WDock *src, WDock *dest, WAppIcon *icon, int x, int y)
|
||||
* moved icons it applies. -Dan
|
||||
*/
|
||||
if ((dest->type==WM_DOCK /*|| dest->keep_attracted*/) && icon->command==NULL) {
|
||||
if (XGetCommand(dpy, wwin->client_win, &argv, &argc) && argc>0) {
|
||||
|
||||
icon->command = wtokenjoin(argv, argc);
|
||||
XFreeStringList(argv);
|
||||
command = GetCommandForWindow(wwin->client_win);
|
||||
if (command) {
|
||||
icon->command = command;
|
||||
} else {
|
||||
char *command=NULL;
|
||||
|
||||
icon->editing = 1;
|
||||
/* icon->forced_dock = 1;*/
|
||||
/* icon->forced_dock = 1;*/
|
||||
if (wInputDialog(src->screen_ptr, _("Dock Icon"),
|
||||
_("Type the command used to launch the application"),
|
||||
&command)) {
|
||||
@@ -3177,22 +3173,15 @@ wDockTrackWindowLaunch(WDock *dock, Window window)
|
||||
Bool found = False;
|
||||
char *command = NULL;
|
||||
|
||||
{
|
||||
int argc;
|
||||
char **argv;
|
||||
|
||||
if (XGetCommand(dpy, window, &argv, &argc)) {
|
||||
if (argc > 0 && argv != NULL)
|
||||
command = wtokenjoin(argv, argc);
|
||||
if (argv) {
|
||||
XFreeStringList(argv);
|
||||
}
|
||||
}
|
||||
}
|
||||
command = GetCommandForWindow(window);
|
||||
|
||||
if (!PropGetWMClass(window, &wm_class, &wm_instance) ||
|
||||
(!wm_class && !wm_instance))
|
||||
return;
|
||||
(!wm_class && !wm_instance)) {
|
||||
|
||||
if (command)
|
||||
wfree(command);
|
||||
return;
|
||||
}
|
||||
|
||||
retry:
|
||||
for (i=0; i<dock->max_icons; i++) {
|
||||
@@ -3232,9 +3221,9 @@ retry:
|
||||
icon->forced_dock = 1;
|
||||
icon->running = 0;
|
||||
}
|
||||
if (!icon->forced_dock)
|
||||
icon->main_window = window;
|
||||
|
||||
if (!icon->forced_dock) {
|
||||
icon->main_window = window;
|
||||
}
|
||||
}
|
||||
found = True;
|
||||
if (!wPreferences.no_animations && !icon->launching &&
|
||||
@@ -3598,8 +3587,7 @@ iconDblClick(WObjDescriptor *desc, XEvent *event)
|
||||
wWorkspaceChange(dock->screen_ptr, wapp->last_workspace);
|
||||
}
|
||||
|
||||
wUnhideApplication(wapp, event->xbutton.button==Button2,
|
||||
unhideHere);
|
||||
wUnhideApplication(wapp, event->xbutton.button==Button2, unhideHere);
|
||||
|
||||
if (event->xbutton.state & MOD_MASK) {
|
||||
wHideOtherApplications(btn->icon->owner);
|
||||
@@ -3620,9 +3608,8 @@ iconDblClick(WObjDescriptor *desc, XEvent *event)
|
||||
(!btn->running || (event->xbutton.state & ControlMask))) {
|
||||
launchDockedApplication(btn, False);
|
||||
}
|
||||
} else if (btn->xindex == 0 && btn->yindex == 0
|
||||
&& btn->dock->type == WM_DOCK) {
|
||||
|
||||
} else if (btn->xindex==0 && btn->yindex==0 &&
|
||||
btn->dock->type==WM_DOCK) {
|
||||
wShowGNUstepPanel(dock->screen_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
+84
-40
@@ -66,9 +66,13 @@
|
||||
#ifdef KWM_HINTS
|
||||
# include "kwm.h"
|
||||
#endif
|
||||
#ifdef NETWM_HINTS
|
||||
# include "wmspec.h"
|
||||
#endif
|
||||
|
||||
/******** Global Variables **********/
|
||||
extern XContext wWinContext;
|
||||
extern XContext wVEdgeContext;
|
||||
|
||||
extern Cursor wCursor[WCUR_LAST];
|
||||
|
||||
@@ -323,7 +327,7 @@ void
|
||||
EventLoop()
|
||||
{
|
||||
XEvent event;
|
||||
|
||||
|
||||
for(;;) {
|
||||
WMNextEvent(dpy, &event);
|
||||
WMHandleEvent(&event);
|
||||
@@ -331,6 +335,39 @@ EventLoop()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
* ProcessPendingEvents --
|
||||
* Processes the events that are currently pending (at the time
|
||||
* this function is called) in the display's queue.
|
||||
*
|
||||
* Returns:
|
||||
* After the pending events that were present at the function call
|
||||
* are processed.
|
||||
*
|
||||
* Side effects:
|
||||
* Many -- whatever handling events may involve.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
void
|
||||
ProcessPendingEvents()
|
||||
{
|
||||
XEvent event;
|
||||
int count;
|
||||
|
||||
XSync(dpy, False);
|
||||
|
||||
/* Take a snapshot of the event count in the queue */
|
||||
count = XPending(dpy);
|
||||
|
||||
while (count>0 && XPending(dpy)) {
|
||||
WMNextEvent(dpy, &event);
|
||||
WMHandleEvent(&event);
|
||||
count--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Bool
|
||||
IsDoubleClick(WScreen *scr, XEvent *event)
|
||||
@@ -478,7 +515,7 @@ handleMapRequest(XEvent *ev)
|
||||
Window window = ev->xmaprequest.window;
|
||||
|
||||
#ifdef DEBUG
|
||||
L("got map request for %x\n", (unsigned)window);
|
||||
printf("got map request for %x\n", (unsigned)window);
|
||||
#endif
|
||||
if ((wwin = wWindowFor(window))) {
|
||||
if (wwin->flags.shaded) {
|
||||
@@ -553,7 +590,7 @@ handleDestroyNotify(XEvent *event)
|
||||
int index;
|
||||
|
||||
#ifdef DEBUG
|
||||
L("got destroy notify");
|
||||
printf("got destroy notify\n");
|
||||
#endif
|
||||
wwin = wWindowFor(window);
|
||||
if (wwin) {
|
||||
@@ -607,7 +644,7 @@ handleExpose(XEvent *event)
|
||||
XEvent ev;
|
||||
|
||||
#ifdef DEBUG
|
||||
L("got expose");
|
||||
printf("got expose\n");
|
||||
#endif
|
||||
while (XCheckTypedWindowEvent(dpy, event->xexpose.window, Expose, &ev));
|
||||
|
||||
@@ -662,7 +699,7 @@ handleButtonPress(XEvent *event)
|
||||
WScreen *scr;
|
||||
|
||||
#ifdef DEBUG
|
||||
L("got button press");
|
||||
printf("got button press\n");
|
||||
#endif
|
||||
scr = wScreenForRootWindow(event->xbutton.root);
|
||||
|
||||
@@ -749,7 +786,7 @@ handleMapNotify(XEvent *event)
|
||||
{
|
||||
WWindow *wwin;
|
||||
#ifdef DEBUG
|
||||
L("got map");
|
||||
printf("got map\n");
|
||||
#endif
|
||||
wwin = wWindowFor(event->xmap.event);
|
||||
if (wwin && wwin->client_win == event->xmap.event) {
|
||||
@@ -772,7 +809,7 @@ handleUnmapNotify(XEvent *event)
|
||||
XEvent ev;
|
||||
Bool withdraw = False;
|
||||
#ifdef DEBUG
|
||||
L("got unmap");
|
||||
printf("got unmap\n");
|
||||
#endif
|
||||
/* only process windows with StructureNotify selected
|
||||
* (ignore SubstructureNotify) */
|
||||
@@ -824,7 +861,7 @@ handleConfigureRequest(XEvent *event)
|
||||
{
|
||||
WWindow *wwin;
|
||||
#ifdef DEBUG
|
||||
L("got configure request");
|
||||
printf("got configure request\n");
|
||||
#endif
|
||||
if (!(wwin=wWindowFor(event->xconfigurerequest.window))) {
|
||||
/*
|
||||
@@ -847,7 +884,7 @@ handlePropertyNotify(XEvent *event)
|
||||
unsigned int ju;
|
||||
WScreen *scr;
|
||||
#ifdef DEBUG
|
||||
L("got property notify");
|
||||
printf("got property notify\n");
|
||||
#endif
|
||||
if ((wwin=wWindowFor(event->xproperty.window))) {
|
||||
if (!XGetGeometry(dpy, wwin->client_win, &jr, &ji, &ji,
|
||||
@@ -876,7 +913,7 @@ handleClientMessage(XEvent *event)
|
||||
WWindow *wwin;
|
||||
WObjDescriptor *desc;
|
||||
#ifdef DEBUG
|
||||
L("got client message");
|
||||
printf("got client message\n");
|
||||
#endif
|
||||
/* handle transition from Normal to Iconic state */
|
||||
if (event->xclient.message_type == _XA_WM_CHANGE_STATE
|
||||
@@ -962,6 +999,10 @@ handleClientMessage(XEvent *event)
|
||||
wFrameWindowChangeState(wwin->frame, WS_FOCUSED);
|
||||
break;
|
||||
}
|
||||
#ifdef NETWM_HINTS
|
||||
} else if (wNETWMProcessClientMessage(&event->xclient)) {
|
||||
/* do nothing */
|
||||
#endif
|
||||
#ifdef GNOME_STUFF
|
||||
} else if (wGNOMEProcessClientMessage(&event->xclient)) {
|
||||
/* do nothing */
|
||||
@@ -1035,34 +1076,19 @@ handleEnterNotify(XEvent *event)
|
||||
{
|
||||
WWindow *wwin;
|
||||
WObjDescriptor *desc = NULL;
|
||||
#ifdef VIRTUAL_DESKTOP
|
||||
void (*vdHandler)(XEvent * event);
|
||||
#endif
|
||||
XEvent ev;
|
||||
WScreen *scr = wScreenForRootWindow(event->xcrossing.root);
|
||||
#ifdef DEBUG
|
||||
L("got enter notify");
|
||||
printf("got enter notify\n");
|
||||
#endif
|
||||
|
||||
#ifdef VIRTUAL_DESKTOP
|
||||
/* TODO: acceleration code */
|
||||
if (wPreferences.vedge_thickness) {
|
||||
int x,y;
|
||||
if (event->xcrossing.window == scr->virtual_edge_r) {
|
||||
XWarpPointer(dpy, None, scr->root_win, 0,0,0,0, scr->scr_width - wPreferences.vedge_thickness - 1, event->xcrossing.y_root);
|
||||
wWorkspaceGetViewPosition(scr, scr->current_workspace, &x, &y);
|
||||
wWorkspaceSetViewPort(scr, scr->current_workspace, x + VIRTUALEDGE_SCROLL_HSTEP, y);
|
||||
} else if (event->xcrossing.window == scr->virtual_edge_l) {
|
||||
XWarpPointer(dpy, None, scr->root_win, 0,0,0,0, wPreferences.vedge_thickness + 1, event->xcrossing.y_root);
|
||||
wWorkspaceGetViewPosition(scr, scr->current_workspace, &x, &y);
|
||||
wWorkspaceSetViewPort(scr, scr->current_workspace, x - VIRTUALEDGE_SCROLL_HSTEP, y);
|
||||
} else if (event->xcrossing.window == scr->virtual_edge_u) {
|
||||
XWarpPointer(dpy, None, scr->root_win, 0,0,0,0, event->xcrossing.x_root, wPreferences.vedge_thickness + 1);
|
||||
wWorkspaceGetViewPosition(scr, scr->current_workspace, &x, &y);
|
||||
wWorkspaceSetViewPort(scr, scr->current_workspace, x, y - VIRTUALEDGE_SCROLL_VSTEP);
|
||||
} else if (event->xcrossing.window == scr->virtual_edge_d) {
|
||||
printf("enter bottom\n");
|
||||
XWarpPointer(dpy, None, scr->root_win, 0,0,0,0, event->xcrossing.x_root, scr->scr_height - wPreferences.vedge_thickness - 1);
|
||||
wWorkspaceGetViewPosition(scr, scr->current_workspace, &x, &y);
|
||||
wWorkspaceSetViewPort(scr, scr->current_workspace, x, y + VIRTUALEDGE_SCROLL_VSTEP);
|
||||
}
|
||||
if (XFindContext(dpy, event->xcrossing.window, wVEdgeContext,
|
||||
(XPointer *)&vdHandler)!=XCNOENT) {
|
||||
(*vdHandler)( event);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1178,7 +1204,7 @@ handleShapeNotify(XEvent *event)
|
||||
WWindow *wwin;
|
||||
XEvent ev;
|
||||
#ifdef DEBUG
|
||||
L("got shape notify");
|
||||
printf("got shape notify\n");
|
||||
#endif
|
||||
while (XCheckTypedWindowEvent(dpy, shev->window, event->type, &ev)) {
|
||||
XShapeEvent *sev = (XShapeEvent*)&ev;
|
||||
@@ -1446,7 +1472,7 @@ handleKeyPress(XEvent *event)
|
||||
}
|
||||
break;
|
||||
case WKBD_MAXIMIZE:
|
||||
if (ISMAPPED(wwin) && ISFOCUSED(wwin) && !WFLAGP(wwin, no_resizable)) {
|
||||
if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) {
|
||||
int newdir = (MAX_VERTICAL|MAX_HORIZONTAL);
|
||||
|
||||
CloseWindowMenu(scr);
|
||||
@@ -1459,7 +1485,7 @@ handleKeyPress(XEvent *event)
|
||||
}
|
||||
break;
|
||||
case WKBD_VMAXIMIZE:
|
||||
if (ISMAPPED(wwin) && ISFOCUSED(wwin) && !WFLAGP(wwin, no_resizable)) {
|
||||
if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) {
|
||||
int newdir = (MAX_VERTICAL ^ wwin->flags.maximized);
|
||||
|
||||
CloseWindowMenu(scr);
|
||||
@@ -1472,7 +1498,7 @@ handleKeyPress(XEvent *event)
|
||||
}
|
||||
break;
|
||||
case WKBD_HMAXIMIZE:
|
||||
if (ISMAPPED(wwin) && ISFOCUSED(wwin) && !WFLAGP(wwin, no_resizable)) {
|
||||
if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) {
|
||||
int newdir = (MAX_HORIZONTAL ^ wwin->flags.maximized);
|
||||
|
||||
CloseWindowMenu(scr);
|
||||
@@ -1515,7 +1541,8 @@ handleKeyPress(XEvent *event)
|
||||
}
|
||||
break;
|
||||
case WKBD_MOVERESIZE:
|
||||
if (ISMAPPED(wwin) && ISFOCUSED(wwin)) {
|
||||
if (ISMAPPED(wwin) && ISFOCUSED(wwin) &&
|
||||
(IS_RESIZABLE(wwin) || IS_MOVABLE(wwin))) {
|
||||
CloseWindowMenu(scr);
|
||||
|
||||
wKeyboardMoveResizeWindow(wwin);
|
||||
@@ -1718,6 +1745,23 @@ handleKeyPress(XEvent *event)
|
||||
}
|
||||
break;
|
||||
#endif /* KEEP_XKB_LOCK_STATUS */
|
||||
#ifdef VIRTUAL_DESKTOP
|
||||
case WKBD_VDESK_LEFT:
|
||||
wWorkspaceKeyboardMoveDesktop(scr, VEC_LEFT);
|
||||
break;
|
||||
|
||||
case WKBD_VDESK_RIGHT:
|
||||
wWorkspaceKeyboardMoveDesktop(scr, VEC_RIGHT);
|
||||
break;
|
||||
|
||||
case WKBD_VDESK_UP:
|
||||
wWorkspaceKeyboardMoveDesktop(scr, VEC_UP);
|
||||
break;
|
||||
|
||||
case WKBD_VDESK_DOWN:
|
||||
wWorkspaceKeyboardMoveDesktop(scr, VEC_DOWN);
|
||||
break;
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1739,7 +1783,7 @@ handleMotionNotify(XEvent *event)
|
||||
p.y >= (rect.pos.y + rect.size.height - 2)) {
|
||||
WMenu *menu;
|
||||
#ifdef DEBUG
|
||||
L("pointer at screen edge");
|
||||
printf("pointer at screen edge\n");
|
||||
#endif
|
||||
menu = wMenuUnderPointer(scr);
|
||||
if (menu!=NULL)
|
||||
@@ -1773,13 +1817,13 @@ handleMotionNotify(XEvent *event)
|
||||
&& event->xmotion.x_root >= wwin->frame_x
|
||||
&& event->xmotion.x_root <= wwin->frame_x + wwin->frame->core->width) {
|
||||
|
||||
if (!WFLAGP(wwin, no_titlebar)
|
||||
if (HAS_BORDER(wwin)
|
||||
&& wwin->frame_y <= - wwin->frame->top_width) {
|
||||
|
||||
wWindowMove(wwin, wwin->frame_x, 0);
|
||||
wwin->flags.dragged_while_fmaximized = 0;
|
||||
|
||||
} else if (!WFLAGP(wwin, no_resizebar)
|
||||
} else if (HAS_RESIZEBAR(wwin)
|
||||
&& wwin->frame_y + wwin->frame->core->height >=
|
||||
scr->scr_height + wwin->frame->bottom_width) {
|
||||
|
||||
|
||||
+9
-6
@@ -1488,11 +1488,13 @@ titlebarMouseDown(WObjDescriptor *desc, XEvent *event)
|
||||
WCoreWindow *titlebar = desc->self;
|
||||
|
||||
if (IsDoubleClick(fwin->core->screen_ptr, event)) {
|
||||
if (fwin->on_dblclick_titlebar)
|
||||
(*fwin->on_dblclick_titlebar)(titlebar, fwin->child, event);
|
||||
if (fwin->on_dblclick_titlebar) {
|
||||
(*fwin->on_dblclick_titlebar)(titlebar, fwin->child, event);
|
||||
}
|
||||
} else {
|
||||
if (fwin->on_mousedown_titlebar)
|
||||
(*fwin->on_mousedown_titlebar)(titlebar, fwin->child, event);
|
||||
if (fwin->on_mousedown_titlebar) {
|
||||
(*fwin->on_mousedown_titlebar)(titlebar, fwin->child, event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1534,8 +1536,9 @@ buttonMouseDown(WObjDescriptor *desc, XEvent *event)
|
||||
}
|
||||
#ifdef XKB_BUTTON_HINT
|
||||
if (button == fwin->language_button) {
|
||||
if (!wPreferences.modelock) return;
|
||||
image = fwin->languagebutton_image;
|
||||
if (!wPreferences.modelock)
|
||||
return;
|
||||
image = fwin->languagebutton_image;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+12
@@ -152,6 +152,18 @@ void ExecExitScript();
|
||||
Bool wFetchName(Display *dpy, Window win, char **winname);
|
||||
Bool wGetIconName(Display *dpy, Window win, char **iconname);
|
||||
|
||||
/* Free returned string it when done. (applies to the next 2 functions) */
|
||||
char* GetCommandForWindow(Window win);
|
||||
char* GetProgramNameForWindow(Window win);
|
||||
|
||||
Bool GetCommandForPid(int pid, char ***argv, int *argc);
|
||||
|
||||
#ifdef NETWM_HINTS
|
||||
#include "wmspec.h"
|
||||
#define GetPidForWindow(win) wNETWMGetPidForWindow(win)
|
||||
#else
|
||||
int GetPidForWindow(Window win);
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+10
-1
@@ -165,6 +165,11 @@ wIconCreate(WWindow *wwin)
|
||||
icon->show_title = 0;
|
||||
#else
|
||||
icon->show_title = 1;
|
||||
#endif
|
||||
#ifdef NETWM_HINTS
|
||||
if (!icon->image && !WFLAGP(wwin, always_user_icon))
|
||||
icon->image = RRetainImage(wwin->net_icon_image);
|
||||
if (!icon->image)
|
||||
#endif
|
||||
icon->image = wDefaultGetImage(scr, wwin->wm_instance, wwin->wm_class);
|
||||
|
||||
@@ -631,7 +636,11 @@ wIconUpdate(WIcon *icon)
|
||||
icon->pixmap = None;
|
||||
|
||||
|
||||
if (wwin && WFLAGP(wwin, always_user_icon))
|
||||
if (wwin && (WFLAGP(wwin, always_user_icon)
|
||||
#ifdef NETWM_HINTS
|
||||
|| wwin->net_icon_image
|
||||
#endif
|
||||
))
|
||||
goto user_icon;
|
||||
|
||||
/* use client specified icon window */
|
||||
|
||||
+14
-4
@@ -79,11 +79,21 @@
|
||||
#define WKBD_SWITCH_SCREEN 45
|
||||
|
||||
#ifdef KEEP_XKB_LOCK_STATUS
|
||||
# define WKBD_TOGGLE 46
|
||||
# define WKBD_LAST 47
|
||||
# define WKBD_TOGGLE 46
|
||||
# define WKBD_TMP 47
|
||||
#else
|
||||
# define WKBD_LAST 46
|
||||
#endif /* KEEP_XKB_LOCK_STATUS */
|
||||
# define WKBD_TMP 46
|
||||
#endif
|
||||
|
||||
#ifdef VIRTUAL_DESKTOP
|
||||
# define WKBD_VDESK_LEFT WKBD_TMP
|
||||
# define WKBD_VDESK_RIGHT (WKBD_TMP+1)
|
||||
# define WKBD_VDESK_UP (WKBD_TMP+2)
|
||||
# define WKBD_VDESK_DOWN (WKBD_TMP+3)
|
||||
# define WKBD_LAST (WKBD_TMP+4)
|
||||
#else
|
||||
# define WKBD_LAST WKBD_TMP
|
||||
#endif /* VIRTUAL_DESKTOP */
|
||||
|
||||
|
||||
typedef struct WShortKey {
|
||||
|
||||
+22
-14
@@ -85,6 +85,7 @@ WDDomain *WDRootMenu = NULL;
|
||||
XContext wWinContext;
|
||||
XContext wAppWinContext;
|
||||
XContext wStackContext;
|
||||
XContext wVEdgeContext;
|
||||
|
||||
/* Atoms */
|
||||
Atom _XA_WM_STATE;
|
||||
@@ -123,9 +124,9 @@ Atom _XA_DND_SELECTION;
|
||||
Cursor wCursor[WCUR_LAST];
|
||||
|
||||
/* last event timestamp for XSetInputFocus */
|
||||
Time LastTimestamp;
|
||||
Time LastTimestamp = CurrentTime;
|
||||
/* timestamp on the last time we did XSetInputFocus() */
|
||||
Time LastFocusChange;
|
||||
Time LastFocusChange = CurrentTime;
|
||||
|
||||
#ifdef SHAPE
|
||||
Bool wShapeSupported;
|
||||
@@ -494,8 +495,10 @@ check_defaults()
|
||||
static void
|
||||
execInitScript()
|
||||
{
|
||||
char *file;
|
||||
char *paths = wstrconcat(wusergnusteppath(), ":"DEF_CONFIG_PATHS);
|
||||
char *file, *paths;
|
||||
|
||||
paths = wstrconcat(wusergnusteppath(), "/Library/WindowMaker");
|
||||
paths = wstrappend(paths, ":"DEF_CONFIG_PATHS);
|
||||
|
||||
file = wfindfile(paths, DEF_INIT_SCRIPT);
|
||||
wfree(paths);
|
||||
@@ -519,8 +522,10 @@ execInitScript()
|
||||
void
|
||||
ExecExitScript()
|
||||
{
|
||||
char *file;
|
||||
char *paths = wstrconcat(wusergnusteppath(), ":"DEF_CONFIG_PATHS);
|
||||
char *file, *paths;
|
||||
|
||||
paths = wstrconcat(wusergnusteppath(), "/Library/WindowMaker");
|
||||
paths = wstrappend(paths, ":"DEF_CONFIG_PATHS);
|
||||
|
||||
file = wfindfile(paths, DEF_EXIT_SCRIPT);
|
||||
wfree(paths);
|
||||
@@ -717,22 +722,25 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
|
||||
if (!Locale) {
|
||||
Locale = getenv("LC_ALL");
|
||||
}
|
||||
if (!Locale) {
|
||||
Locale = getenv("LANG");
|
||||
if (Locale) {
|
||||
/* return of wstrconcat should not be free-ed! read putenv man page */
|
||||
putenv(wstrconcat("LANG=", Locale));
|
||||
} else {
|
||||
Locale = getenv("LC_ALL");
|
||||
if (!Locale) {
|
||||
Locale = getenv("LANG");
|
||||
}
|
||||
}
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
if (!Locale || strcmp(Locale, "C")==0 || strcmp(Locale, "POSIX")==0)
|
||||
Locale = NULL;
|
||||
Locale = NULL;
|
||||
#ifdef I18N
|
||||
if (getenv("NLSPATH"))
|
||||
bindtextdomain("WindowMaker", getenv("NLSPATH"));
|
||||
bindtextdomain("WindowMaker", getenv("NLSPATH"));
|
||||
else
|
||||
bindtextdomain("WindowMaker", LOCALEDIR);
|
||||
bindtextdomain("WindowMaker", LOCALEDIR);
|
||||
textdomain("WindowMaker");
|
||||
|
||||
if (!XSupportsLocale()) {
|
||||
|
||||
+2
-3
@@ -43,6 +43,7 @@
|
||||
#include "stacking.h"
|
||||
#include "text.h"
|
||||
#include "xinerama.h"
|
||||
#include "workspace.h"
|
||||
|
||||
|
||||
/****** Global Variables ******/
|
||||
@@ -2259,9 +2260,7 @@ byebye:
|
||||
|
||||
((WMenu*)desc->parent)->flags.inside_handler = 0;
|
||||
#ifdef VIRTUAL_DESKTOP
|
||||
if (wPreferences.vedge_thickness) {
|
||||
wWorkspaceRaiseEdge(scr);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2510,7 +2509,7 @@ wMenuSaveState(WScreen *scr)
|
||||
WMPropList *menus, *key;
|
||||
int save_menus = 0;
|
||||
|
||||
menus = WMCreatePLDictionary(NULL, NULL, NULL);
|
||||
menus = WMCreatePLDictionary(NULL, NULL);
|
||||
|
||||
#ifndef LITE
|
||||
if (scr->switch_menu && scr->switch_menu->flags.buttoned) {
|
||||
|
||||
+186
-69
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
/*
|
||||
* Window Maker window manager
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1997-2003 Alfredo K. Kojima
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -15,7 +15,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
*/
|
||||
#include "wconfig.h"
|
||||
@@ -52,8 +52,6 @@
|
||||
|
||||
/**** global variables *****/
|
||||
|
||||
extern char *DisplayName;
|
||||
|
||||
extern WPreferences wPreferences;
|
||||
|
||||
extern Time LastTimestamp;
|
||||
@@ -91,7 +89,7 @@ static char*
|
||||
username()
|
||||
{
|
||||
char *tmp;
|
||||
|
||||
|
||||
tmp = getlogin();
|
||||
if (!tmp) {
|
||||
struct passwd *user;
|
||||
@@ -109,7 +107,7 @@ username()
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
MakeCPPArgs(char *path)
|
||||
{
|
||||
@@ -117,7 +115,7 @@ MakeCPPArgs(char *path)
|
||||
char buffer[MAXLINE], *buf, *line;
|
||||
Visual *visual;
|
||||
char *tmp;
|
||||
|
||||
|
||||
line = wmalloc(MAXLINE);
|
||||
*line = 0;
|
||||
i=1;
|
||||
@@ -125,13 +123,13 @@ MakeCPPArgs(char *path)
|
||||
if (buf[0]=='(') {
|
||||
wwarning(_("your machine is misconfigured. HOSTNAME is set to %s"),
|
||||
buf);
|
||||
} else
|
||||
} else
|
||||
putdef(line, " -DHOST=", buf);
|
||||
} else if ((buf=getenv("HOST"))!=NULL) {
|
||||
if (buf[0]=='(') {
|
||||
wwarning(_("your machine is misconfigured. HOST is set to %s"),
|
||||
buf);
|
||||
} else
|
||||
} else
|
||||
putdef(line, " -DHOST=", buf);
|
||||
}
|
||||
buf = username();
|
||||
@@ -141,14 +139,14 @@ MakeCPPArgs(char *path)
|
||||
buf = XDisplayName(DisplayString(dpy));
|
||||
putdef(line, " -DDISPLAY=", buf);
|
||||
putdef(line, " -DWM_VERSION=", VERSION);
|
||||
|
||||
|
||||
visual = DefaultVisual(dpy, DefaultScreen(dpy));
|
||||
putidef(line, " -DVISUAL=", visual->class);
|
||||
|
||||
|
||||
putidef(line, " -DDEPTH=", DefaultDepth(dpy, DefaultScreen(dpy)));
|
||||
|
||||
putidef(line, " -DSCR_WIDTH=", WidthOfScreen(DefaultScreenOfDisplay(dpy)));
|
||||
putidef(line, " -DSCR_HEIGHT=",
|
||||
putidef(line, " -DSCR_HEIGHT=",
|
||||
HeightOfScreen(DefaultScreenOfDisplay(dpy)));
|
||||
|
||||
/* put the dir where the menu is being read from to the
|
||||
@@ -181,7 +179,7 @@ MakeCPPArgs(char *path)
|
||||
char * wgethomedir();
|
||||
/* home is statically allocated. Don't free it! */
|
||||
char *home = wgethomedir();
|
||||
|
||||
|
||||
strcpy(fullpath, home);
|
||||
strcat(fullpath, &(buf[1]));
|
||||
}
|
||||
@@ -189,7 +187,7 @@ MakeCPPArgs(char *path)
|
||||
putdef(line, " -I", fullpath);
|
||||
|
||||
} while ((buf = strtok(NULL, ":"))!=NULL);
|
||||
|
||||
|
||||
#undef arg
|
||||
#ifdef DEBUG
|
||||
puts("CPP ARGS");
|
||||
@@ -211,14 +209,14 @@ isBelow(WWindow *win1, WWindow *win2)
|
||||
{
|
||||
int i;
|
||||
WCoreWindow *tmp;
|
||||
|
||||
|
||||
tmp = win1->frame->core->stacking->under;
|
||||
while (tmp) {
|
||||
if (tmp == win2->frame->core)
|
||||
return True;
|
||||
tmp = tmp->stacking->under;
|
||||
}
|
||||
|
||||
|
||||
for (i=win1->frame->core->stacking->window_level-1; i>=0; i--) {
|
||||
tmp = win1->screen_ptr->stacking_list[i];
|
||||
while (tmp) {
|
||||
@@ -272,7 +270,7 @@ char **winname;
|
||||
} else {
|
||||
/* the hint is probably not set */
|
||||
*winname = NULL;
|
||||
|
||||
|
||||
return False;
|
||||
}
|
||||
}
|
||||
@@ -291,7 +289,7 @@ char **iconname;
|
||||
XTextProperty text_prop;
|
||||
char **list;
|
||||
int num;
|
||||
|
||||
|
||||
if (XGetWMIconName(dpy, win, &text_prop) != 0 && text_prop.value
|
||||
&& text_prop.nitems > 0) {
|
||||
if (text_prop.encoding == XA_STRING)
|
||||
@@ -313,20 +311,20 @@ char **iconname;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
static void
|
||||
eatExpose()
|
||||
{
|
||||
XEvent event, foo;
|
||||
|
||||
|
||||
/* compress all expose events into a single one */
|
||||
|
||||
|
||||
if (XCheckMaskEvent(dpy, ExposureMask, &event)) {
|
||||
/* ignore other exposure events for this window */
|
||||
while (XCheckWindowEvent(dpy, event.xexpose.window, ExposureMask,
|
||||
&foo));
|
||||
/* eat exposes for other windows */
|
||||
eatExpose();
|
||||
|
||||
|
||||
event.xexpose.count = 0;
|
||||
XPutBackEvent(dpy, &event);
|
||||
}
|
||||
@@ -351,8 +349,8 @@ SlideWindow(Window win, int from_x, int from_y, int to_x, int to_y)
|
||||
{ICON_SLIDE_DELAY_M, ICON_SLIDE_STEPS_M, ICON_SLIDE_SLOWDOWN_M},
|
||||
{ICON_SLIDE_DELAY_S, ICON_SLIDE_STEPS_S, ICON_SLIDE_SLOWDOWN_S},
|
||||
{ICON_SLIDE_DELAY_US, ICON_SLIDE_STEPS_US, ICON_SLIDE_SLOWDOWN_US}};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
dx = (float)(to_x-from_x);
|
||||
dy = (float)(to_y-from_y);
|
||||
@@ -477,7 +475,7 @@ ShrinkString(WMFont *font, char *string, int width)
|
||||
} else if (w<width) {
|
||||
p1 = t;
|
||||
t = p1+(p2-p1)/2;
|
||||
} else
|
||||
} else
|
||||
p2=p1=t;
|
||||
}
|
||||
strcat(text, &string[p-p1]);
|
||||
@@ -516,7 +514,7 @@ static char*
|
||||
getTextSelection(WScreen *screen, Atom selection)
|
||||
{
|
||||
int buffer = -1;
|
||||
|
||||
|
||||
switch (selection) {
|
||||
case XA_CUT_BUFFER0:
|
||||
buffer = 0;
|
||||
@@ -559,21 +557,21 @@ getTextSelection(WScreen *screen, Atom selection)
|
||||
int timeout = 0;
|
||||
XEvent ev;
|
||||
static Atom clipboard = 0;
|
||||
|
||||
if (!clipboard)
|
||||
|
||||
if (!clipboard)
|
||||
clipboard = XInternAtom(dpy, "CLIPBOARD", False);
|
||||
|
||||
|
||||
XDeleteProperty(dpy, screen->info_window, clipboard);
|
||||
|
||||
|
||||
XConvertSelection(dpy, selection, XA_STRING,
|
||||
clipboard, screen->info_window,
|
||||
CurrentTime);
|
||||
|
||||
|
||||
timer = WMAddTimerHandler(1000, timeoutHandler, &timeout);
|
||||
|
||||
|
||||
while (!XCheckTypedWindowEvent(dpy, screen->info_window,
|
||||
SelectionNotify, &ev) && !timeout);
|
||||
|
||||
|
||||
if (!timeout) {
|
||||
WMDeleteTimerHandler(timer);
|
||||
} else {
|
||||
@@ -607,7 +605,7 @@ static char*
|
||||
getselection(WScreen *scr)
|
||||
{
|
||||
char *tmp;
|
||||
|
||||
|
||||
tmp = getTextSelection(scr, XA_PRIMARY);
|
||||
if (!tmp)
|
||||
tmp = getTextSelection(scr, XA_CUT_BUFFER0);
|
||||
@@ -623,10 +621,10 @@ getuserinput(WScreen *scr, char *line, int *ptr)
|
||||
char *prompt;
|
||||
int j, state;
|
||||
int begin = 0;
|
||||
#define BUFSIZE 512
|
||||
#define BUFSIZE 512
|
||||
char tbuffer[BUFSIZE], pbuffer[BUFSIZE];
|
||||
|
||||
|
||||
|
||||
title = _("Program Arguments");
|
||||
prompt = _("Enter command arguments:");
|
||||
ret = NULL;
|
||||
@@ -716,17 +714,17 @@ get_dnd_selection(WScreen *scr)
|
||||
char **list;
|
||||
char *flat_string;
|
||||
int count;
|
||||
|
||||
|
||||
result=XGetTextProperty(dpy, scr->root_win, &text_ret, _XA_DND_SELECTION);
|
||||
|
||||
|
||||
if (result==0 || text_ret.value==NULL || text_ret.encoding==None
|
||||
|| text_ret.format==0 || text_ret.nitems == 0) {
|
||||
wwarning(_("unable to get dropped data from DND drop"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
XTextPropertyToStringList(&text_ret, &list, &count);
|
||||
|
||||
|
||||
if (!list || count<1) {
|
||||
XFree(text_ret.value);
|
||||
wwarning(_("error getting dropped data from DND drop"));
|
||||
@@ -737,7 +735,7 @@ get_dnd_selection(WScreen *scr)
|
||||
if (!flat_string) {
|
||||
wwarning(_("out of memory while getting data from DND drop"));
|
||||
}
|
||||
|
||||
|
||||
XFreeStringList(list);
|
||||
XFree(text_ret.value);
|
||||
return flat_string;
|
||||
@@ -749,7 +747,7 @@ get_dnd_selection(WScreen *scr)
|
||||
#define S_ESCAPE 1
|
||||
#define S_OPTION 2
|
||||
|
||||
/*
|
||||
/*
|
||||
* state input new-state output
|
||||
* NORMAL % OPTION <nil>
|
||||
* NORMAL \ ESCAPE <nil>
|
||||
@@ -808,15 +806,15 @@ ExpandOptions(WScreen *scr, char *cmdline)
|
||||
case 'n':
|
||||
out[optr++]=10;
|
||||
break;
|
||||
|
||||
|
||||
case 'r':
|
||||
out[optr++]=13;
|
||||
break;
|
||||
|
||||
|
||||
case 't':
|
||||
out[optr++]=9;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
out[optr++]=cmdline[ptr];
|
||||
}
|
||||
@@ -828,7 +826,7 @@ ExpandOptions(WScreen *scr, char *cmdline)
|
||||
case 'w':
|
||||
if (scr->focused_window
|
||||
&& scr->focused_window->flags.focused) {
|
||||
snprintf(tmpbuf, sizeof(tmpbuf), "0x%x",
|
||||
snprintf(tmpbuf, sizeof(tmpbuf), "0x%x",
|
||||
(unsigned int)scr->focused_window->client_win);
|
||||
slen = strlen(tmpbuf);
|
||||
olen += slen;
|
||||
@@ -844,9 +842,9 @@ ExpandOptions(WScreen *scr, char *cmdline)
|
||||
out[optr++]=' ';
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'W':
|
||||
snprintf(tmpbuf, sizeof(tmpbuf), "0x%x",
|
||||
snprintf(tmpbuf, sizeof(tmpbuf), "0x%x",
|
||||
(unsigned int)scr->current_workspace + 1);
|
||||
slen = strlen(tmpbuf);
|
||||
olen += slen;
|
||||
@@ -859,10 +857,10 @@ ExpandOptions(WScreen *scr, char *cmdline)
|
||||
strcat(out,tmpbuf);
|
||||
optr+=slen;
|
||||
break;
|
||||
|
||||
|
||||
case 'a':
|
||||
ptr++;
|
||||
user_input = getuserinput(scr, cmdline, &ptr);
|
||||
user_input = getuserinput(scr, cmdline, &ptr);
|
||||
if (user_input) {
|
||||
slen = strlen(user_input);
|
||||
olen += slen;
|
||||
@@ -907,7 +905,7 @@ ExpandOptions(WScreen *scr, char *cmdline)
|
||||
optr+=slen;
|
||||
break;
|
||||
#endif /* OFFIX_DND */
|
||||
|
||||
|
||||
case 's':
|
||||
if (!selection) {
|
||||
selection = getselection(scr);
|
||||
@@ -940,7 +938,7 @@ ExpandOptions(WScreen *scr, char *cmdline)
|
||||
if (selection)
|
||||
XFree(selection);
|
||||
return out;
|
||||
|
||||
|
||||
error:
|
||||
wfree(out);
|
||||
if (selection)
|
||||
@@ -1007,21 +1005,21 @@ GetShortcutString(char *text)
|
||||
/* KeySym ksym;*/
|
||||
int control = 0;
|
||||
char *tmp;
|
||||
|
||||
|
||||
tmp = text = wstrdup(text);
|
||||
|
||||
/* get modifiers */
|
||||
while ((k = strchr(text, '+'))!=NULL) {
|
||||
int mod;
|
||||
|
||||
|
||||
*k = 0;
|
||||
mod = wXModifierFromKey(text);
|
||||
if (mod<0) {
|
||||
return wstrdup("bug");
|
||||
}
|
||||
|
||||
|
||||
modmask |= mod;
|
||||
|
||||
|
||||
if (strcasecmp(text, "Meta")==0) {
|
||||
buffer = wstrappend(buffer, "M+");
|
||||
} else if (strcasecmp(text, "Alt")==0) {
|
||||
@@ -1029,15 +1027,15 @@ GetShortcutString(char *text)
|
||||
} else if (strcasecmp(text, "Shift")==0) {
|
||||
buffer = wstrappend(buffer, "Sh+");
|
||||
} else if (strcasecmp(text, "Mod1")==0) {
|
||||
buffer = wstrappend(buffer, "M1+");
|
||||
buffer = wstrappend(buffer, "M1+");
|
||||
} else if (strcasecmp(text, "Mod2")==0) {
|
||||
buffer = wstrappend(buffer, "M2+");
|
||||
buffer = wstrappend(buffer, "M2+");
|
||||
} else if (strcasecmp(text, "Mod3")==0) {
|
||||
buffer = wstrappend(buffer, "M3+");
|
||||
} else if (strcasecmp(text, "Mod4")==0) {
|
||||
buffer = wstrappend(buffer, "M4+");
|
||||
buffer = wstrappend(buffer, "M4+");
|
||||
} else if (strcasecmp(text, "Mod5")==0) {
|
||||
buffer = wstrappend(buffer, "M5+");
|
||||
buffer = wstrappend(buffer, "M5+");
|
||||
} else if (strcasecmp(text, "Control")==0) {
|
||||
control = 1;
|
||||
} else {
|
||||
@@ -1050,7 +1048,7 @@ GetShortcutString(char *text)
|
||||
buffer = wstrappend(buffer, "^");
|
||||
}
|
||||
buffer = wstrappend(buffer, text);
|
||||
|
||||
|
||||
/* get key */
|
||||
/* ksym = XStringToKeysym(text);
|
||||
tmp = keysymToString(ksym, modmask);
|
||||
@@ -1185,7 +1183,7 @@ SendHelperMessage(WScreen *scr, char type, int workspace, char *msg)
|
||||
if (!scr->flags.backimage_helper_launched) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
len = (msg ? strlen(msg) : 0) + (workspace >=0 ? 4 : 0) + 1 ;
|
||||
buffer = wmalloc(len+5);
|
||||
snprintf(buf, len, "%4i", len);
|
||||
@@ -1244,22 +1242,141 @@ UpdateDomainFile(WDDomain *domain)
|
||||
}
|
||||
|
||||
|
||||
|
||||
char*
|
||||
StrConcatDot(char *a, char *b)
|
||||
{
|
||||
int len;
|
||||
char *str;
|
||||
|
||||
|
||||
if (!a)
|
||||
a = "";
|
||||
if (!b)
|
||||
b = "";
|
||||
|
||||
|
||||
len = strlen(a)+strlen(b)+4;
|
||||
str = wmalloc(len);
|
||||
|
||||
|
||||
snprintf(str, len, "%s.%s", a, b);
|
||||
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
#ifndef NETWM_HINTS
|
||||
|
||||
static Atom net_wm_pid = None;
|
||||
|
||||
int
|
||||
GetPidForWindow(Window win)
|
||||
{
|
||||
Atom type_ret;
|
||||
int fmt_ret;
|
||||
unsigned long nitems_ret;
|
||||
unsigned long bytes_after_ret;
|
||||
long *data = 0;
|
||||
int pid;
|
||||
|
||||
if (net_wm_pid == None) {
|
||||
net_wm_pid = XInternAtom(dpy, "_NET_WM_PID", False);
|
||||
}
|
||||
|
||||
if (XGetWindowProperty(dpy, win, net_wm_pid, 0, 1, False,
|
||||
XA_CARDINAL, &type_ret, &fmt_ret, &nitems_ret,
|
||||
&bytes_after_ret,
|
||||
(unsigned char**)&data)==Success && data) {
|
||||
|
||||
pid = *data;
|
||||
XFree(data);
|
||||
} else {
|
||||
pid = 0;
|
||||
}
|
||||
|
||||
return pid;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Bool
|
||||
GetCommandForPid(int pid, char ***argv, int *argc)
|
||||
{
|
||||
char buf[1024];
|
||||
FILE *fPtr;
|
||||
int count, i, j;
|
||||
|
||||
sprintf(buf, "/proc/%d/cmdline", pid);
|
||||
fPtr = fopen(buf, "r");
|
||||
if (fPtr) {
|
||||
count = read(fileno(fPtr), buf, 1024);
|
||||
if (count > 0) {
|
||||
buf[count] = 0;
|
||||
for (i=0, *argc=0; i<count; i++) {
|
||||
if (buf[i] == 0) {
|
||||
(*argc)++;
|
||||
}
|
||||
}
|
||||
if ((*argc) == 0) {
|
||||
*argv = NULL;
|
||||
return False;
|
||||
}
|
||||
*argv = (char**) wmalloc(sizeof(char*) * (*argc));
|
||||
(*argv)[0] = buf;
|
||||
for (i=0, j=1; i<count; i++) {
|
||||
if (buf[i] != 0)
|
||||
continue;
|
||||
if (i < count-1) {
|
||||
(*argv)[j++] = &buf[i+1];
|
||||
}
|
||||
}
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
fclose(fPtr);
|
||||
}
|
||||
|
||||
return False;
|
||||
}
|
||||
|
||||
|
||||
static char*
|
||||
getCommandForWindow(Window win, int elements)
|
||||
{
|
||||
char **argv, *command = NULL;
|
||||
int argc;
|
||||
|
||||
if (XGetCommand(dpy, win, &argv, &argc)) {
|
||||
if (argc > 0 && argv != NULL) {
|
||||
if (elements==0)
|
||||
elements = argc;
|
||||
command = wtokenjoin(argv, WMIN(argc, elements));
|
||||
if (command[0] == 0) {
|
||||
wfree(command);
|
||||
command = NULL;
|
||||
}
|
||||
}
|
||||
if (argv) {
|
||||
XFreeStringList(argv);
|
||||
}
|
||||
}
|
||||
|
||||
return command;
|
||||
}
|
||||
|
||||
|
||||
/* Free result when done */
|
||||
char*
|
||||
GetCommandForWindow(Window win)
|
||||
{
|
||||
return getCommandForWindow(win, 0);
|
||||
}
|
||||
|
||||
|
||||
/* Free result when done */
|
||||
char*
|
||||
GetProgramNameForWindow(Window win)
|
||||
{
|
||||
return getCommandForWindow(win, 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+80
-32
@@ -66,7 +66,7 @@
|
||||
/* True if window currently has a border. This also includes borderless
|
||||
* windows which are currently selected
|
||||
*/
|
||||
#define HAS_BORDER(w) ((w)->flags.selected || !WFLAGP((w), no_border))
|
||||
#define HAS_BORDER_WITH_SELECT(w) ((w)->flags.selected || HAS_BORDER(w))
|
||||
|
||||
|
||||
/****** Global Variables ******/
|
||||
@@ -236,8 +236,7 @@ mapPositionDisplay(WWindow *wwin, int x, int y, int w, int h)
|
||||
return;
|
||||
} else if (wPreferences.move_display == WDIS_CENTER) {
|
||||
rect = wGetRectForHead(scr, wGetHeadForWindow(wwin));
|
||||
moveGeometryDisplayCentered(scr,
|
||||
rect.pos.x + rect.size.width/2,
|
||||
moveGeometryDisplayCentered(scr, rect.pos.x + rect.size.width/2,
|
||||
rect.pos.y + rect.size.height/2);
|
||||
} else if (wPreferences.move_display == WDIS_TOPLEFT) {
|
||||
rect = wGetRectForHead(scr, wGetHeadForWindow(wwin));
|
||||
@@ -265,7 +264,7 @@ showGeometry(WWindow *wwin, int x1, int y1, int x2, int y2, int direction)
|
||||
* x2-1 everywhere below in the code). But why only for x? */
|
||||
x1--; x2--;
|
||||
|
||||
if (HAS_BORDER(wwin)) {
|
||||
if (HAS_BORDER_WITH_SELECT(wwin)) {
|
||||
x1 += FRAME_BORDER_WIDTH;
|
||||
x2 += FRAME_BORDER_WIDTH;
|
||||
y1 += FRAME_BORDER_WIDTH;
|
||||
@@ -407,8 +406,7 @@ cycleGeometryDisplay(WWindow *wwin, int x, int y, int w, int h, int dir)
|
||||
} else {
|
||||
if (wPreferences.size_display == WDIS_CENTER) {
|
||||
rect = wGetRectForHead(scr, wGetHeadForWindow(wwin));
|
||||
moveGeometryDisplayCentered(scr,
|
||||
rect.pos.x + rect.size.width/2,
|
||||
moveGeometryDisplayCentered(scr, rect.pos.x + rect.size.width/2,
|
||||
rect.pos.y + rect.size.height/2);
|
||||
} else if (wPreferences.size_display == WDIS_TOPLEFT) {
|
||||
rect = wGetRectForHead(scr, wGetHeadForWindow(wwin));
|
||||
@@ -434,8 +432,7 @@ mapGeometryDisplay(WWindow *wwin, int x, int y, int w, int h)
|
||||
|
||||
if (wPreferences.size_display == WDIS_CENTER) {
|
||||
rect = wGetRectForHead(scr, wGetHeadForWindow(wwin));
|
||||
moveGeometryDisplayCentered(scr,
|
||||
rect.pos.x + rect.size.width/2,
|
||||
moveGeometryDisplayCentered(scr, rect.pos.x + rect.size.width/2,
|
||||
rect.pos.y + rect.size.height/2);
|
||||
} else if (wPreferences.size_display == WDIS_TOPLEFT) {
|
||||
rect = wGetRectForHead(scr, wGetHeadForWindow(wwin));
|
||||
@@ -497,15 +494,15 @@ drawTransparentFrame(WWindow *wwin, int x, int y, int width, int height)
|
||||
int h = 0;
|
||||
int bottom = 0;
|
||||
|
||||
if (HAS_BORDER(wwin)) {
|
||||
if (HAS_BORDER_WITH_SELECT(wwin)) {
|
||||
x += FRAME_BORDER_WIDTH;
|
||||
y += FRAME_BORDER_WIDTH;
|
||||
}
|
||||
|
||||
if (!WFLAGP(wwin, no_titlebar) && !wwin->flags.shaded) {
|
||||
if (HAS_TITLEBAR(wwin) && !wwin->flags.shaded) {
|
||||
h = WMFontHeight(wwin->screen_ptr->title_font) + (wPreferences.window_title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
|
||||
}
|
||||
if (!WFLAGP(wwin, no_resizebar) && !wwin->flags.shaded) {
|
||||
if (HAS_RESIZEBAR(wwin) && !wwin->flags.shaded) {
|
||||
/* Can't use wwin-frame->bottom_width because, in some cases
|
||||
(e.g. interactive placement), frame does not point to anything. */
|
||||
bottom = RESIZEBAR_HEIGHT;
|
||||
@@ -640,9 +637,9 @@ typedef struct {
|
||||
#define WTOP(w) (w)->frame_y
|
||||
#define WLEFT(w) (w)->frame_x
|
||||
#define WRIGHT(w) ((w)->frame_x + (int)(w)->frame->core->width - 1 + \
|
||||
(HAS_BORDER(w) ? 2*FRAME_BORDER_WIDTH : 0))
|
||||
(HAS_BORDER_WITH_SELECT(w) ? 2*FRAME_BORDER_WIDTH : 0))
|
||||
#define WBOTTOM(w) ((w)->frame_y + (int)(w)->frame->core->height - 1 + \
|
||||
(HAS_BORDER(w) ? 2*FRAME_BORDER_WIDTH : 0))
|
||||
(HAS_BORDER_WITH_SELECT(w) ? 2*FRAME_BORDER_WIDTH : 0))
|
||||
|
||||
static int
|
||||
compareWTop(const void *a, const void *b)
|
||||
@@ -900,9 +897,9 @@ initMoveData(WWindow *wwin, MoveData *data)
|
||||
data->calcY = wwin->frame_y;
|
||||
|
||||
data->winWidth = wwin->frame->core->width +
|
||||
(HAS_BORDER(wwin) ? 2*FRAME_BORDER_WIDTH : 0);
|
||||
(HAS_BORDER_WITH_SELECT(wwin) ? 2*FRAME_BORDER_WIDTH : 0);
|
||||
data->winHeight = wwin->frame->core->height +
|
||||
(HAS_BORDER(wwin) ? 2*FRAME_BORDER_WIDTH : 0);
|
||||
(HAS_BORDER_WITH_SELECT(wwin) ? 2*FRAME_BORDER_WIDTH : 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1293,6 +1290,9 @@ updateWindowPosition(WWindow *wwin, MoveData *data, Bool doResistance,
|
||||
|
||||
#define _KS KEY_CONTROL_WINDOW_WEIGHT
|
||||
|
||||
#define MOVABLE_BIT 0x01
|
||||
#define RESIZABLE_BIT 0x02
|
||||
|
||||
int
|
||||
wKeyboardMoveResizeWindow(WWindow *wwin)
|
||||
{
|
||||
@@ -1309,15 +1309,24 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
|
||||
int done,off_x,off_y,ww,wh;
|
||||
int kspeed = _KS;
|
||||
Time lastTime = 0;
|
||||
KeyCode shiftl, shiftr, ctrll, ctrlmode;
|
||||
KeySym keysym=NoSymbol;
|
||||
int moment=0;
|
||||
KeyCode shiftl,shiftr,ctrll,ctrlmode;
|
||||
int modes = ((IS_MOVABLE(wwin) ? MOVABLE_BIT : 0) |
|
||||
(IS_RESIZABLE(wwin) ? RESIZABLE_BIT : 0));
|
||||
int head = ((wPreferences.auto_arrange_icons && wXineramaHeads(scr)>1)
|
||||
? wGetHeadForWindow(wwin)
|
||||
: scr->xine_info.primary_head);
|
||||
|
||||
shiftl = XKeysymToKeycode(dpy, XK_Shift_L);
|
||||
shiftr = XKeysymToKeycode(dpy, XK_Shift_R);
|
||||
ctrll = XKeysymToKeycode(dpy, XK_Control_L);
|
||||
ctrlmode=done=off_x=off_y=0;
|
||||
|
||||
if (modes == RESIZABLE_BIT) {
|
||||
ctrlmode = 1;
|
||||
}
|
||||
|
||||
XSync(dpy, False);
|
||||
wusleep(10000);
|
||||
XGrabKeyboard(dpy, root, False, GrabModeAsync, GrabModeAsync, CurrentTime);
|
||||
@@ -1383,14 +1392,15 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
|
||||
}
|
||||
if (kspeed < _KS) kspeed = _KS;
|
||||
lastTime = event.xkey.time;
|
||||
|
||||
if (event.xkey.state & ControlMask && !wwin->flags.shaded) {
|
||||
ctrlmode=1;
|
||||
wUnselectWindows(scr);
|
||||
}
|
||||
else {
|
||||
ctrlmode=0;
|
||||
}
|
||||
if (modes == (MOVABLE_BIT|RESIZABLE_BIT)) {
|
||||
if ((event.xkey.state & ControlMask) && !wwin->flags.shaded) {
|
||||
ctrlmode=1;
|
||||
wUnselectWindows(scr);
|
||||
}
|
||||
else {
|
||||
ctrlmode=0;
|
||||
}
|
||||
}
|
||||
if (event.xkey.keycode == shiftl || event.xkey.keycode == shiftr) {
|
||||
if (ctrlmode)
|
||||
cycleGeometryDisplay(wwin, src_x+off_x, src_y+off_y, ww, wh, 0);
|
||||
@@ -1544,7 +1554,7 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
|
||||
showGeometry(wwin, src_x+off_x, src_y+off_y, src_x+off_x+ww, src_y+off_y+wh,0);
|
||||
} else if(!scr->selected_windows)
|
||||
showPosition(wwin, src_x+off_x, src_y+off_y);
|
||||
/**/
|
||||
|
||||
|
||||
if (done) {
|
||||
scr->keymove_tick=0;
|
||||
@@ -1599,6 +1609,17 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
|
||||
wWindowChangeWorkspace(wwin, scr->current_workspace);
|
||||
wSetFocusTo(scr, wwin);
|
||||
}
|
||||
|
||||
if (wPreferences.auto_arrange_icons && wXineramaHeads(scr)>1 &&
|
||||
head != wGetHeadForWindow(wwin)) {
|
||||
wArrangeIcons(scr, True);
|
||||
}
|
||||
|
||||
|
||||
#if defined(NETWM_HINTS) && defined(VIRTUAL_DESKTOP)
|
||||
wWorkspaceResizeViewPort(scr, scr->current_workspace);
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -1638,12 +1659,15 @@ wMouseMoveWindow(WWindow *wwin, XEvent *ev)
|
||||
/* This needs not to change while moving, else bad things can happen */
|
||||
int opaqueMove = wPreferences.opaque_move;
|
||||
MoveData moveData;
|
||||
int head = ((wPreferences.auto_arrange_icons && wXineramaHeads(scr) > 1)
|
||||
? wGetHeadForWindow(wwin)
|
||||
: scr->xine_info.primary_head);
|
||||
#ifdef GHOST_WINDOW_MOVE
|
||||
RImage *rimg;
|
||||
|
||||
rimg = InitGhostWindowMove(scr);
|
||||
RImage *rimg = InitGhostWindowMove(scr);
|
||||
#endif
|
||||
|
||||
if (!IS_MOVABLE(wwin))
|
||||
return False;
|
||||
|
||||
if (wPreferences.opaque_move && !wPreferences.use_saveunders) {
|
||||
XSetWindowAttributes attr;
|
||||
@@ -1873,7 +1897,6 @@ wMouseMoveWindow(WWindow *wwin, XEvent *ev)
|
||||
if (wPreferences.opaque_move && !wPreferences.use_saveunders) {
|
||||
XSetWindowAttributes attr;
|
||||
|
||||
|
||||
attr.save_under = False;
|
||||
XChangeWindowAttributes(dpy, wwin->frame->core->window,
|
||||
CWSaveUnder, &attr);
|
||||
@@ -1882,6 +1905,16 @@ wMouseMoveWindow(WWindow *wwin, XEvent *ev)
|
||||
|
||||
freeMoveData(&moveData);
|
||||
|
||||
if (started && wPreferences.auto_arrange_icons && wXineramaHeads(scr)>1 &&
|
||||
head != wGetHeadForWindow(wwin)) {
|
||||
wArrangeIcons(scr, True);
|
||||
}
|
||||
|
||||
#if defined(NETWM_HINTS) && defined(VIRTUAL_DESKTOP)
|
||||
if (started)
|
||||
wWorkspaceResizeViewPort(scr, scr->current_workspace);
|
||||
#endif
|
||||
|
||||
return started;
|
||||
}
|
||||
|
||||
@@ -1964,6 +1997,12 @@ wMouseResizeWindow(WWindow *wwin, XEvent *ev)
|
||||
int orig_fy = fy;
|
||||
int orig_fw = fw;
|
||||
int orig_fh = fh;
|
||||
int head = ((wPreferences.auto_arrange_icons && wXineramaHeads(scr)>1)
|
||||
? wGetHeadForWindow(wwin)
|
||||
: scr->xine_info.primary_head);
|
||||
|
||||
if (!IS_RESIZABLE(wwin))
|
||||
return;
|
||||
|
||||
if (wwin->flags.shaded) {
|
||||
wwarning("internal error: tryein");
|
||||
@@ -1984,7 +2023,7 @@ wMouseResizeWindow(WWindow *wwin, XEvent *ev)
|
||||
ry2 = fy + fh - 1;
|
||||
shiftl = XKeysymToKeycode(dpy, XK_Shift_L);
|
||||
shiftr = XKeysymToKeycode(dpy, XK_Shift_R);
|
||||
if (!WFLAGP(wwin, no_titlebar))
|
||||
if (HAS_TITLEBAR(wwin))
|
||||
h = WMFontHeight(wwin->screen_ptr->title_font) + (wPreferences.window_title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
|
||||
else
|
||||
h = 0;
|
||||
@@ -2165,6 +2204,15 @@ wMouseResizeWindow(WWindow *wwin, XEvent *ev)
|
||||
WMHandleEvent(&event);
|
||||
}
|
||||
}
|
||||
|
||||
if (wPreferences.auto_arrange_icons && wXineramaHeads(scr) > 1 &&
|
||||
head != wGetHeadForWindow(wwin)) {
|
||||
wArrangeIcons(scr, True);
|
||||
}
|
||||
|
||||
#if defined(NETWM_HINTS) && defined(VIRTUAL_DESKTOP)
|
||||
wWorkspaceResizeViewPort(scr, scr->current_workspace);
|
||||
#endif
|
||||
}
|
||||
|
||||
#undef LEFT
|
||||
@@ -2316,11 +2364,11 @@ InteractivePlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
|
||||
*y_ret = 0;
|
||||
return;
|
||||
}
|
||||
if (!WFLAGP(wwin, no_titlebar)) {
|
||||
if (HAS_TITLEBAR(wwin)) {
|
||||
h = WMFontHeight(scr->title_font) + (wPreferences.window_title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
|
||||
height += h;
|
||||
}
|
||||
if (!WFLAGP(wwin, no_resizebar)) {
|
||||
if (HAS_RESIZEBAR(wwin)) {
|
||||
height += RESIZEBAR_HEIGHT;
|
||||
}
|
||||
XGrabKeyboard(dpy, root, False, GrabModeAsync, GrabModeAsync, CurrentTime);
|
||||
|
||||
+43
-34
@@ -349,33 +349,32 @@ smartPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
|
||||
unsigned int width, unsigned int height,
|
||||
WArea usableArea)
|
||||
{
|
||||
WScreen *scr = wwin->screen_ptr;
|
||||
//WScreen *scr = wwin->screen_ptr;
|
||||
int test_x = 0, test_y = Y_ORIGIN(scr);
|
||||
int from_x, to_x, from_y, to_y;
|
||||
int sx;
|
||||
int min_isect, min_isect_x, min_isect_y;
|
||||
int sum_isect;
|
||||
int extra_height;
|
||||
|
||||
if (wwin->frame)
|
||||
extra_height = wwin->frame->top_width + wwin->frame->bottom_width;
|
||||
else
|
||||
extra_height = 24; /* random value */
|
||||
|
||||
if (wwin->frame) {
|
||||
height += wwin->frame->top_width + wwin->frame->bottom_width;
|
||||
} else {
|
||||
if (HAS_TITLEBAR(wwin)) height += 18;
|
||||
if (HAS_RESIZEBAR(wwin)) height += 8;
|
||||
}
|
||||
if (HAS_BORDER(wwin)) {
|
||||
height += 2;
|
||||
width += 2;
|
||||
}
|
||||
sx = X_ORIGIN(scr);
|
||||
|
||||
min_isect = INT_MAX;
|
||||
min_isect_x = sx;
|
||||
min_isect_y = test_y;
|
||||
|
||||
height += extra_height;
|
||||
|
||||
while (((test_y + height) < usableArea.y2)) {
|
||||
|
||||
test_x = sx;
|
||||
|
||||
while ((test_x + width) < usableArea.x2) {
|
||||
|
||||
sum_isect = calcSumOfCoveredAreas(wwin, test_x, test_y,
|
||||
width, height);
|
||||
|
||||
@@ -430,21 +429,23 @@ autoPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
|
||||
int loc_ok = False, tw,tx,ty,th;
|
||||
int swidth, sx;
|
||||
WWindow *test_window;
|
||||
int extra_height;
|
||||
|
||||
|
||||
if (wwin->frame)
|
||||
extra_height = wwin->frame->top_width + wwin->frame->bottom_width + 2;
|
||||
else
|
||||
extra_height = 24; /* random value */
|
||||
if (wwin->frame) {
|
||||
height += wwin->frame->top_width + wwin->frame->bottom_width;
|
||||
} else {
|
||||
if (HAS_TITLEBAR(wwin)) height += 18;
|
||||
if (HAS_RESIZEBAR(wwin)) height += 8;
|
||||
}
|
||||
if (HAS_BORDER(wwin)) {
|
||||
height += 2;
|
||||
width += 2;
|
||||
}
|
||||
|
||||
swidth = usableArea.x2-usableArea.x1;
|
||||
sx = X_ORIGIN(scr);
|
||||
|
||||
/* this was based on fvwm2's smart placement */
|
||||
|
||||
height += extra_height;
|
||||
|
||||
while (((test_y + height) < (usableArea.y2 - usableArea.y1)) && !loc_ok) {
|
||||
test_x = sx;
|
||||
|
||||
@@ -539,17 +540,19 @@ cascadeWindow(WScreen *scr, WWindow *wwin, int *x_ret, int *y_ret,
|
||||
unsigned int width, unsigned int height, int h,
|
||||
WArea usableArea)
|
||||
{
|
||||
unsigned int extra_height;
|
||||
|
||||
|
||||
if (wwin->frame)
|
||||
extra_height = wwin->frame->top_width + wwin->frame->bottom_width;
|
||||
else
|
||||
extra_height = 24; /* random value */
|
||||
if (wwin->frame) {
|
||||
height += wwin->frame->top_width + wwin->frame->bottom_width;
|
||||
} else {
|
||||
if (HAS_TITLEBAR(wwin)) height += 18;
|
||||
if (HAS_RESIZEBAR(wwin)) height += 8;
|
||||
}
|
||||
if (HAS_BORDER(wwin)) {
|
||||
height += 2;
|
||||
width += 2;
|
||||
}
|
||||
|
||||
*x_ret = h * scr->cascade_index + X_ORIGIN(scr);
|
||||
*y_ret = h * scr->cascade_index + Y_ORIGIN(scr);
|
||||
height += extra_height;
|
||||
|
||||
if (width + *x_ret > usableArea.x2 || height + *y_ret > usableArea.y2) {
|
||||
scr->cascade_index = 0;
|
||||
@@ -564,15 +567,21 @@ randomPlaceWindow(WScreen *scr, WWindow *wwin, int *x_ret, int *y_ret,
|
||||
unsigned int width, unsigned int height,
|
||||
WArea usableArea)
|
||||
{
|
||||
int w, h, extra_height;
|
||||
int w, h;
|
||||
|
||||
if (wwin->frame)
|
||||
extra_height = wwin->frame->top_width + wwin->frame->bottom_width + 2;
|
||||
else
|
||||
extra_height = 24; /* random value */
|
||||
if (wwin->frame) {
|
||||
height += wwin->frame->top_width + wwin->frame->bottom_width;
|
||||
} else {
|
||||
if (HAS_TITLEBAR(wwin)) height += 18;
|
||||
if (HAS_RESIZEBAR(wwin)) height += 8;
|
||||
}
|
||||
if (HAS_BORDER(wwin)) {
|
||||
height += 2;
|
||||
width += 2;
|
||||
}
|
||||
|
||||
w = ((usableArea.x2-X_ORIGIN(scr)) - width);
|
||||
h = ((usableArea.y2-Y_ORIGIN(scr)) - height - extra_height);
|
||||
h = ((usableArea.y2-Y_ORIGIN(scr)) - height);
|
||||
if (w<1) w = 1;
|
||||
if (h<1) h = 1;
|
||||
*x_ret = X_ORIGIN(scr) + rand()%w;
|
||||
|
||||
+38
-14
@@ -62,6 +62,9 @@
|
||||
#ifdef OLWM_HINTS
|
||||
# include "openlook.h"
|
||||
#endif
|
||||
#ifdef NETWM_HINTS
|
||||
# include "wmspec.h"
|
||||
#endif
|
||||
|
||||
#include "xinerama.h"
|
||||
|
||||
@@ -787,6 +790,10 @@ wScreenInit(int screen_number)
|
||||
wOLWMInitStuff(scr);
|
||||
#endif
|
||||
|
||||
#ifdef NETWM_HINTS
|
||||
wNETWMInitStuff(scr);
|
||||
#endif
|
||||
|
||||
/* create initial workspace */
|
||||
wWorkspaceNew(scr);
|
||||
|
||||
@@ -1014,10 +1021,21 @@ wScreenUpdateUsableArea(WScreen *scr)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NETWM_HINTS
|
||||
{
|
||||
WArea area;
|
||||
if (wNETWMGetUsableArea(scr, &area)) {
|
||||
scr->totalUsableArea.x1 = WMAX(scr->totalUsableArea.x1, area.x1);
|
||||
scr->totalUsableArea.y1 = WMAX(scr->totalUsableArea.y1, area.y1);
|
||||
scr->totalUsableArea.x2 = WMIN(scr->totalUsableArea.x2, area.x2);
|
||||
scr->totalUsableArea.y2 = WMIN(scr->totalUsableArea.y2, area.y2);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef KWM_HINTS
|
||||
{
|
||||
WArea area;
|
||||
|
||||
if (wKWMGetUsableArea(scr, &area)) {
|
||||
scr->totalUsableArea.x1 = WMAX(scr->totalUsableArea.x1, area.x1);
|
||||
scr->totalUsableArea.y1 = WMAX(scr->totalUsableArea.y1, area.y1);
|
||||
@@ -1094,6 +1112,10 @@ wScreenUpdateUsableArea(WScreen *scr)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NETWM_HINTS
|
||||
wNETWMUpdateWorkarea(scr);
|
||||
#endif
|
||||
|
||||
{
|
||||
unsigned size = wPreferences.workspace_border_size;
|
||||
unsigned position = wPreferences.workspace_border_position;
|
||||
@@ -1146,7 +1168,16 @@ wScreenRestoreState(WScreen *scr)
|
||||
wfree(path);
|
||||
}
|
||||
|
||||
if (!wPreferences.flags.noclip && scr->session_state) {
|
||||
if (!scr->session_state) {
|
||||
scr->session_state = WMCreatePLDictionary(NULL, NULL);
|
||||
}
|
||||
|
||||
if (!wPreferences.flags.nodock) {
|
||||
state = WMGetFromPLDictionary(scr->session_state, dDock);
|
||||
scr->dock = wDockRestoreState(scr, state, WM_DOCK);
|
||||
}
|
||||
|
||||
if (!wPreferences.flags.noclip) {
|
||||
state = WMGetFromPLDictionary(scr->session_state, dClip);
|
||||
scr->clip_icon = wClipRestoreState(scr, state);
|
||||
}
|
||||
@@ -1154,17 +1185,10 @@ wScreenRestoreState(WScreen *scr)
|
||||
wWorkspaceRestoreState(scr);
|
||||
|
||||
#ifdef VIRTUAL_DESKTOP
|
||||
/*
|
||||
* * create inputonly windows at the border of screen
|
||||
* */
|
||||
wWorkspaceManageEdge(scr);
|
||||
/* create inputonly windows at the border of screen */
|
||||
wWorkspaceManageEdge(scr);
|
||||
#endif
|
||||
|
||||
if (!wPreferences.flags.nodock && scr->session_state) {
|
||||
state = WMGetFromPLDictionary(scr->session_state, dDock);
|
||||
scr->dock = wDockRestoreState(scr, state, WM_DOCK);
|
||||
}
|
||||
|
||||
wScreenUpdateUsableArea(scr);
|
||||
}
|
||||
|
||||
@@ -1201,7 +1225,7 @@ wScreenSaveState(WScreen *scr)
|
||||
|
||||
|
||||
old_state = scr->session_state;
|
||||
scr->session_state = WMCreatePLDictionary(NULL, NULL, NULL);
|
||||
scr->session_state = WMCreatePLDictionary(NULL, NULL);
|
||||
|
||||
WMPLSetCaseSensitive(True);
|
||||
|
||||
@@ -1239,9 +1263,9 @@ wScreenSaveState(WScreen *scr)
|
||||
|
||||
wMenuSaveState(scr);
|
||||
|
||||
if (wScreenCount == 1)
|
||||
if (wScreenCount == 1) {
|
||||
str = wdefaultspathfordomain("WMState");
|
||||
else {
|
||||
} else {
|
||||
char buf[16];
|
||||
snprintf(buf, sizeof(buf), "WMState.%i", scr->screen);
|
||||
str = wdefaultspathfordomain(buf);
|
||||
|
||||
+3
-4
@@ -77,10 +77,8 @@ typedef struct _WScreen {
|
||||
int scr_height;
|
||||
|
||||
#ifdef VIRTUAL_DESKTOP
|
||||
Window virtual_edge_u;
|
||||
Window virtual_edge_d;
|
||||
Window virtual_edge_l;
|
||||
Window virtual_edge_r;
|
||||
int virtual_nr_edges;
|
||||
Window * virtual_edges;
|
||||
#endif
|
||||
|
||||
Window root_win; /* root window of screen */
|
||||
@@ -328,6 +326,7 @@ typedef struct _WScreen {
|
||||
unsigned int colormap_stuff_blocked:1;
|
||||
unsigned int doing_alt_tab:1;
|
||||
unsigned int jump_back_pending:1;
|
||||
unsigned int ignore_focus_events:1;
|
||||
#ifdef KWM_HINTS
|
||||
unsigned int kwm_syncing_name:1;
|
||||
unsigned int kwm_syncing_count:1;
|
||||
|
||||
+13
-18
@@ -211,8 +211,6 @@ makeWindowState(WWindow *wwin, WApplication *wapp)
|
||||
{
|
||||
WScreen *scr = wwin->screen_ptr;
|
||||
Window win;
|
||||
int argc;
|
||||
char **argv;
|
||||
int i;
|
||||
unsigned mask;
|
||||
char *class, *instance, *command=NULL, buffer[512];
|
||||
@@ -225,10 +223,7 @@ makeWindowState(WWindow *wwin, WApplication *wapp)
|
||||
else
|
||||
win = wwin->client_win;
|
||||
|
||||
if (XGetCommand(dpy, win, &argv, &argc) && argc>0) {
|
||||
command = wtokenjoin(argv, argc);
|
||||
XFreeStringList(argv);
|
||||
}
|
||||
command = GetCommandForWindow(win);
|
||||
if (!command)
|
||||
return NULL;
|
||||
|
||||
@@ -266,14 +261,14 @@ makeWindowState(WWindow *wwin, WApplication *wapp)
|
||||
shortcut = WMCreatePLString(buffer);
|
||||
|
||||
win_state = WMCreatePLDictionary(sName, name,
|
||||
sCommand, cmd,
|
||||
sWorkspace, workspace,
|
||||
sShaded, shaded,
|
||||
sMiniaturized, miniaturized,
|
||||
sHidden, hidden,
|
||||
sShortcutMask, shortcut,
|
||||
sGeometry, geometry,
|
||||
NULL);
|
||||
sCommand, cmd,
|
||||
sWorkspace, workspace,
|
||||
sShaded, shaded,
|
||||
sMiniaturized, miniaturized,
|
||||
sHidden, hidden,
|
||||
sShortcutMask, shortcut,
|
||||
sGeometry, geometry,
|
||||
NULL);
|
||||
|
||||
WMReleasePropList(name);
|
||||
WMReleasePropList(cmd);
|
||||
@@ -321,7 +316,7 @@ wSessionSaveState(WScreen *scr)
|
||||
make_keys();
|
||||
|
||||
if (!scr->session_state) {
|
||||
scr->session_state = WMCreatePLDictionary(NULL, NULL, NULL);
|
||||
scr->session_state = WMCreatePLDictionary(NULL, NULL);
|
||||
if (!scr->session_state)
|
||||
return;
|
||||
}
|
||||
@@ -1072,9 +1067,9 @@ smSaveYourselfPhase2Proc(SmcConn smc_conn, SmPointer client_data)
|
||||
}
|
||||
|
||||
plState = WMCreatePLDictionary(WMCreatePLString("Version"),
|
||||
WMCreatePLString("1.0"),
|
||||
WMCreatePLString("Screens"),
|
||||
state, NULL);
|
||||
WMCreatePLString("1.0"),
|
||||
WMCreatePLString("Screens"),
|
||||
state, NULL);
|
||||
|
||||
WMWritePropListToFile(plState, statefile, False);
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "actions.h"
|
||||
#include "properties.h"
|
||||
#include "stacking.h"
|
||||
#include "workspace.h"
|
||||
|
||||
|
||||
/*** Global Variables ***/
|
||||
@@ -152,6 +153,9 @@ CommitStacking(WScreen *scr)
|
||||
XRestackWindows(dpy, windows, i);
|
||||
wfree(windows);
|
||||
|
||||
#ifdef VIRTUAL_DESKTOP
|
||||
wWorkspaceRaiseEdge(scr);
|
||||
#endif
|
||||
|
||||
WMPostNotificationName(WMNResetStacking, scr, NULL);
|
||||
}
|
||||
@@ -376,6 +380,10 @@ wLowerFrame(WCoreWindow *frame)
|
||||
}
|
||||
|
||||
notifyStackChange(frame, "lower");
|
||||
|
||||
#ifdef VIRTUAL_DESKTOP
|
||||
wWorkspaceRaiseEdge(scr);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -510,6 +518,10 @@ MoveInStackListAbove(WCoreWindow *next, WCoreWindow *frame)
|
||||
}
|
||||
|
||||
WMPostNotificationName(WMNResetStacking, scr, NULL);
|
||||
|
||||
#ifdef VIRTUAL_DESKTOP
|
||||
wWorkspaceRaiseEdge(scr);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
+14
-1
@@ -111,6 +111,7 @@ extern int wXkbEventBase;
|
||||
extern XContext wWinContext;
|
||||
extern XContext wAppWinContext;
|
||||
extern XContext wStackContext;
|
||||
extern XContext wVEdgeContext;
|
||||
|
||||
/* atoms */
|
||||
extern Atom _XA_WM_STATE;
|
||||
@@ -756,6 +757,7 @@ StartUp(Bool defaultScreenOnly)
|
||||
wWinContext = XUniqueContext();
|
||||
wAppWinContext = XUniqueContext();
|
||||
wStackContext = XUniqueContext();
|
||||
wVEdgeContext = XUniqueContext();
|
||||
|
||||
/* _XA_VERSION = XInternAtom(dpy, "VERSION", False);*/
|
||||
|
||||
@@ -820,6 +822,17 @@ StartUp(Bool defaultScreenOnly)
|
||||
wCursor[WCUR_QUESTION] = XCreateFontCursor(dpy, XC_question_arrow);
|
||||
wCursor[WCUR_TEXT] = XCreateFontCursor(dpy, XC_xterm); /* odd name???*/
|
||||
wCursor[WCUR_SELECT] = XCreateFontCursor(dpy, XC_cross);
|
||||
{
|
||||
Pixmap cur = XCreatePixmap(dpy, DefaultRootWindow(dpy), 16, 16, 1);
|
||||
GC gc = XCreateGC(dpy, cur, 0, NULL);
|
||||
XColor black;
|
||||
memset(&black, 0, sizeof(XColor));
|
||||
XSetForeground(dpy, gc, 0);
|
||||
XFillRectangle(dpy, cur, gc, 0, 0, 16, 16);
|
||||
XFreeGC(dpy, gc);
|
||||
wCursor[WCUR_EMPTY] = XCreatePixmapCursor(dpy, cur, cur, &black, &black, 0, 0);
|
||||
XFreePixmap(dpy, cur);
|
||||
}
|
||||
|
||||
/* signal handler stuff that gets called when a signal is caught */
|
||||
WMAddPersistentTimerHandler(500, delayedAction, NULL);
|
||||
@@ -1119,7 +1132,7 @@ manageAllWindows(WScreen *scr, int crashRecovery)
|
||||
if (crashRecovery) {
|
||||
int border;
|
||||
|
||||
border = (WFLAGP(wwin, no_border) ? 0 : FRAME_BORDER_WIDTH);
|
||||
border = (!HAS_BORDER(wwin) ? 0 : FRAME_BORDER_WIDTH);
|
||||
|
||||
wWindowMove(wwin, wwin->frame_x - border,
|
||||
wwin->frame_y - border -
|
||||
|
||||
+10
-9
@@ -28,6 +28,7 @@
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "WindowMaker.h"
|
||||
@@ -42,14 +43,14 @@
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
#ifdef DEBUG
|
||||
# define ENTER(X) fprintf(stderr,"Entering: %s()\n", X);
|
||||
# define LEAVE(X) fprintf(stderr,"Leaving: %s()\n", X);
|
||||
# define DEBUG(X) fprintf(stderr,"debug: %s()\n", X);
|
||||
# define PDEBUG(X) fprintf(stderr,"debug: %s()\n", X);
|
||||
#else
|
||||
# define ENTER(X)
|
||||
# define LEAVE(X)
|
||||
# define DEBUG(X)
|
||||
# define PDEBUG(X)
|
||||
#endif
|
||||
|
||||
extern Cursor wCursor[WCUR_LAST];
|
||||
@@ -582,32 +583,32 @@ textEventHandler( WObjDescriptor *desc, XEvent *event )
|
||||
* text so we can wTextRefresh() */
|
||||
if( event->xmotion.state & (Button1Mask|Button3Mask|Button2Mask) )
|
||||
{
|
||||
DEBUG("MotionNotify");
|
||||
PDEBUG("MotionNotify");
|
||||
handled = True;
|
||||
wtext->text.endPos = textXtoPos( wtext, event->xmotion.x );
|
||||
}
|
||||
break;
|
||||
|
||||
case ButtonPress:
|
||||
DEBUG("ButtonPress");
|
||||
PDEBUG("ButtonPress");
|
||||
handled = True;
|
||||
wtext->text.startPos = textXtoPos( wtext, event->xbutton.x );
|
||||
wtext->text.endPos = wtext->text.startPos;
|
||||
break;
|
||||
|
||||
case ButtonRelease:
|
||||
DEBUG("ButtonRelease");
|
||||
PDEBUG("ButtonRelease");
|
||||
handled = True;
|
||||
wtext->text.endPos = textXtoPos( wtext, event->xbutton.x );
|
||||
break;
|
||||
|
||||
case KeyPress:
|
||||
DEBUG("KeyPress");
|
||||
PDEBUG("KeyPress");
|
||||
handled = handleKeyPress( wtext, &event->xkey );
|
||||
break;
|
||||
|
||||
case EnterNotify:
|
||||
DEBUG("EnterNotify");
|
||||
PDEBUG("EnterNotify");
|
||||
handled = True;
|
||||
#if 0
|
||||
if (!wtext->magic)
|
||||
@@ -621,7 +622,7 @@ textEventHandler( WObjDescriptor *desc, XEvent *event )
|
||||
break;
|
||||
|
||||
case LeaveNotify:
|
||||
DEBUG("LeaveNotify");
|
||||
PDEBUG("LeaveNotify");
|
||||
handled = True;
|
||||
#if 0
|
||||
wtext->blinking = 0;
|
||||
|
||||
+1
-1
@@ -500,7 +500,7 @@ wDefaultChangeIcon(WScreen *scr, char *instance, char* class, char *file)
|
||||
int same = 0;
|
||||
|
||||
if (!dict) {
|
||||
dict = WMCreatePLDictionary(NULL, NULL, NULL);
|
||||
dict = WMCreatePLDictionary(NULL, NULL);
|
||||
if (dict) {
|
||||
db->dictionary = dict;
|
||||
} else {
|
||||
|
||||
+323
-223
File diff suppressed because it is too large
Load Diff
+31
-3
@@ -95,6 +95,7 @@ typedef struct {
|
||||
#ifdef XKB_BUTTON_HINT
|
||||
unsigned int no_language_button:1;
|
||||
#endif
|
||||
unsigned int no_movable:1;
|
||||
|
||||
/* decorations */
|
||||
unsigned int no_resizebar:1; /* draw the bottom handle? */
|
||||
@@ -135,6 +136,10 @@ typedef struct {
|
||||
|
||||
unsigned int full_maximize:1;
|
||||
|
||||
#ifdef VIRTUAL_DESKTOP
|
||||
unsigned int virtual_stick:1;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* emulate_app_icon must be automatically disabled for apps that can
|
||||
* generate their own appicons and for apps that have no_appicon=1
|
||||
@@ -201,6 +206,11 @@ typedef struct WWindow {
|
||||
unsigned int width, height; /* original geometry of the window */
|
||||
} old_geometry; /* (before things like maximize) */
|
||||
|
||||
struct {
|
||||
int x, y;
|
||||
unsigned int width, height; /* original geometry of the window */
|
||||
} bfs_geometry; /* (before fullscreen) */
|
||||
|
||||
/* client window info */
|
||||
short old_border_width; /* original border width of client_win*/
|
||||
Window client_win; /* the window we're managing */
|
||||
@@ -257,6 +267,7 @@ typedef struct WWindow {
|
||||
unsigned int hidden:1;
|
||||
unsigned int shaded:1;
|
||||
unsigned int maximized:2;
|
||||
unsigned int fullscreen:1;
|
||||
unsigned int omnipresent:1;
|
||||
|
||||
unsigned int semi_focused:1;
|
||||
@@ -307,19 +318,36 @@ typedef struct WWindow {
|
||||
unsigned int olwm_push_pin_out:1;/* emulate pushpin behaviour */
|
||||
unsigned int olwm_limit_menu:1;
|
||||
#endif
|
||||
#ifdef NET_HINTS
|
||||
#ifdef NETWM_HINTS
|
||||
unsigned int net_state_from_client:1; /* state hint was set by client */
|
||||
unsigned int net_skip_taskbar:1;
|
||||
unsigned int net_skip_pager:1;
|
||||
unsigned int net_handle_icon:1;
|
||||
unsigned int net_show_desktop:1;
|
||||
#endif
|
||||
} flags; /* state of the window */
|
||||
|
||||
struct WIcon *icon; /* icon info for the window */
|
||||
int icon_x, icon_y; /* position of the icon */
|
||||
#ifdef NETWM_HINTS
|
||||
int icon_w, icon_h;
|
||||
RImage *net_icon_image;
|
||||
Atom type;
|
||||
#endif
|
||||
} WWindow;
|
||||
|
||||
|
||||
#define IS_OMNIPRESENT(w) ((w)->flags.omnipresent ^ WFLAGP(w, omnipresent))
|
||||
#define HAS_TITLEBAR(w) (!(WFLAGP((w), no_titlebar) || (w)->flags.fullscreen))
|
||||
#define HAS_RESIZEBAR(w) (!(WFLAGP((w), no_resizebar) || (w)->flags.fullscreen))
|
||||
#define HAS_BORDER(w) (!(WFLAGP((w), no_border) || (w)->flags.fullscreen))
|
||||
#define IS_MOVABLE(w) (!(WFLAGP((w), no_movable) || (w)->flags.fullscreen))
|
||||
#define IS_RESIZABLE(w) (!(WFLAGP((w), no_resizable) || (w)->flags.fullscreen))
|
||||
|
||||
#ifdef VIRTUAL_DESKTOP
|
||||
# define IS_VSTUCK(w) (WFLAGP((w), virtual_stick) || (w)->flags.fullscreen)
|
||||
#endif
|
||||
|
||||
/* XXX: CHECK THIS,.. IT SEEMED WEIRD TO ME!!! */
|
||||
#define IS_OMNIPRESENT(w) ((w)->flags.omnipresent | WFLAGP(w, omnipresent))
|
||||
|
||||
#define WINDOW_LEVEL(w) ((w)->frame->core->stacking->window_level)
|
||||
|
||||
|
||||
+2
-2
@@ -586,10 +586,10 @@ updateMenuForWindow(WMenu *menu, WWindow *wwin)
|
||||
|
||||
menu->entries[MC_MAXIMIZE]->text = text;
|
||||
}
|
||||
wMenuSetEnabled(menu, MC_MAXIMIZE, !WFLAGP(wwin, no_resizable));
|
||||
wMenuSetEnabled(menu, MC_MAXIMIZE, IS_RESIZABLE(wwin));
|
||||
|
||||
|
||||
wMenuSetEnabled(menu, MC_MOVERESIZE, !WFLAGP(wwin, no_resizable)
|
||||
wMenuSetEnabled(menu, MC_MOVERESIZE, IS_RESIZABLE(wwin)
|
||||
&& !wwin->flags.miniaturized);
|
||||
|
||||
if (wwin->flags.shaded) {
|
||||
|
||||
+11
-3
@@ -47,6 +47,11 @@
|
||||
#include "dock.h"
|
||||
#include "client.h"
|
||||
|
||||
#ifdef NETWM_HINTS
|
||||
#include "wmspec.h"
|
||||
#endif
|
||||
|
||||
#include "xinerama.h"
|
||||
|
||||
#include <WINGs/WUtil.h>
|
||||
|
||||
@@ -540,7 +545,7 @@ saveSettings(WMButton *button, InspectorPanel *panel)
|
||||
return;
|
||||
|
||||
if (!dict) {
|
||||
dict = WMCreatePLDictionary(NULL, NULL, NULL);
|
||||
dict = WMCreatePLDictionary(NULL, NULL);
|
||||
if (dict) {
|
||||
db->dictionary = dict;
|
||||
} else {
|
||||
@@ -555,8 +560,8 @@ saveSettings(WMButton *button, InspectorPanel *panel)
|
||||
|
||||
WMPLSetCaseSensitive(True);
|
||||
|
||||
winDic = WMCreatePLDictionary(NULL, NULL, NULL);
|
||||
appDic = WMCreatePLDictionary(NULL, NULL, NULL);
|
||||
winDic = WMCreatePLDictionary(NULL, NULL);
|
||||
appDic = WMCreatePLDictionary(NULL, NULL);
|
||||
|
||||
/* Update icon for window */
|
||||
icon_file = WMGetTextFieldText(panel->fileText);
|
||||
@@ -875,6 +880,9 @@ applySettings(WMButton *button, InspectorPanel *panel)
|
||||
wwin->frame->flags.need_texture_change = 1;
|
||||
wWindowConfigureBorders(wwin);
|
||||
wFrameWindowPaint(wwin->frame);
|
||||
#ifdef NETWM_HINTS
|
||||
wNETWMUpdateActions(wwin, False);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Can't apply emulate_appicon because it will probably cause problems.
|
||||
|
||||
+1371
-242
File diff suppressed because it is too large
Load Diff
@@ -25,6 +25,21 @@
|
||||
#ifndef _WMSPEC_H_
|
||||
#define _WMSPEC_H_
|
||||
|
||||
#include <screen.h>
|
||||
#include <window.h>
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
void wNETWMInitStuff(WScreen *scr);
|
||||
void wNETWMUpdateWorkarea(WScreen *scr, WArea usableArea);
|
||||
Bool wNETWMGetUsableArea(WScreen *scr, int head, WArea *area);
|
||||
Bool wNETWMCheckInitialClientState(WWindow *wwin);
|
||||
Bool wNETWMProcessClientMessage(XClientMessageEvent *event);
|
||||
Bool wNETWMCheckClientHints(WWindow *wwin, int *layer, int *workspace);
|
||||
Bool wNETWMCheckClientHintChange(WWindow *wwin, XPropertyEvent *event);
|
||||
void wNETWMShowingDesktop(WScreen *scr, Bool show);
|
||||
void wNETWMUpdateActions(WWindow *wwin, Bool del);
|
||||
void wNETWMUpdateDesktop(WScreen *scr);
|
||||
void wNETWMPositionSplash(WWindow *wwin, int *x, int *y, int width, int height);
|
||||
int wNETWMGetPidForWindow(Window window);
|
||||
|
||||
#endif
|
||||
|
||||
+591
-151
File diff suppressed because it is too large
Load Diff
+10
-1
@@ -41,12 +41,21 @@ void wWorkspaceChange(WScreen *scr, int workspace);
|
||||
void wWorkspaceForceChange(WScreen *scr, int workspace);
|
||||
#ifdef VIRTUAL_DESKTOP
|
||||
void wWorkspaceManageEdge(WScreen *scr);
|
||||
void wWorkspaceUpdateEdge(WScreen *scr);
|
||||
void wWorkspaceDestroyEdge(WScreen *scr);
|
||||
void wWorkspaceRaiseEdge(WScreen *scr);
|
||||
void wWorkspaceLowerEdge(WScreen *scr);
|
||||
void wWorkspaceResizeViewPort(WScreen *scr, int workspace, int width, int height);
|
||||
void wWorkspaceResizeViewPort(WScreen *scr, int workspace);
|
||||
void wWorkspaceKeyboardMoveDesktop(WScreen *scr, WMPoint direction);
|
||||
Bool wWorkspaceSetViewPort(WScreen *scr, int workspace, int view_x, int view_y);
|
||||
Bool wWorkspaceAdjustViewPort(WScreen *scr, int workspace, int view_x, int view_y);
|
||||
void wWorkspaceGetViewPosition(WScreen *scr, int workspace, int *view_x, int *view_y);
|
||||
|
||||
#define VEC_LEFT wmkpoint(-1,0)
|
||||
#define VEC_RIGHT wmkpoint(1,0)
|
||||
#define VEC_UP wmkpoint(0,-1)
|
||||
#define VEC_DOWN wmkpoint(0,1)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ void wXDNDMakeAwareness(Window window) {
|
||||
}
|
||||
|
||||
void wXDNDClearAwareness(Window window) {
|
||||
long int xdnd_version = 3;
|
||||
//long int xdnd_version = 3;
|
||||
XDeleteProperty (dpy, window, _XA_XdndAware);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "wconfig.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user