+2007-11-30 17:25 UTC Tuomo Valkonen <tuomov@iki.fi>
+ tagged ion-3rc-20071130
+
+2007-11-30 17:24 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Some release notes
+
+2007-11-29 19:48 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Removed pointer event subwindow forwarding hack.
+ Only useful use cases seem to be handled by not grabbing modifierless
+ bindings. This was stopping global (WScreen) grabs of buttons from
+ being handled if there was a frame in the way. (Note that modifierless
+ pointing device bindings are never grabbed, on purpose, so they still
+ don't work through frames or client windows.)
+
+2007-11-29 17:56 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Oops, ion-completeman preferred system over user cache.
+
+2007-11-28 00:33 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * edge_resistance wasn't dynamically configurable.
+
+2007-11-27 23:56 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * 'exec' ion-runinxterm
+ (Simple case that doesn't clutter the configs etc.; the rest can be
+ configured by those with crappy shells.)
+
+2007-11-27 23:48 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Snap to base size
+
+2007-11-27 23:32 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Size hint usage tuning
+
+2007-11-25 15:38 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Removed redundant settings from lookcommon_*
+
+2007-11-25 15:37 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Added the -alt bit to all frame modes for completeness.
+
+2007-11-25 12:30 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * typo fixes
+
+2007-11-25 12:09 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Frame mode change shape setting fix
+
+2007-11-25 11:52 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Added missing header
+
+2007-11-25 01:27 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * reorg
+
+2007-11-25 00:00 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * License intro clarifications
+
+2007-11-24 23:22 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Further license simplification
+
+2007-11-23 17:50 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Minor clarification
+
+2007-11-23 17:39 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Try to prevent EnterWindow event triggered focus change when switchto=false.
+
+2007-11-22 16:43 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Added some missing variable initialisations.
+
+2007-11-21 23:00 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Fixes/improvements to dockapp detection kludges on startup.
+
+2007-11-21 15:16 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Clarifications
+
+2007-11-20 18:28 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Clarified the full ancestry of de/fontset.c.
+ (That can also be seen by examining 'changeset 956'.)
+
+2007-11-18 09:56 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Don't try to store working dir of dead/nameless objects
+
+2007-11-16 22:22 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Do not complain when attempting to nil non-existent binding.
+
+2007-11-09 18:20 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Winprop matching hack fix (?)
+
+2007-11-09 18:03 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Lua-posix dir. checking support fixes.
+
+2007-11-09 17:50 UTC Tuomo Valkonen <tuomov@iki.fi>
+ * Improvements to mod_query 'cd' and 'pwd' override hacks
+
2007-11-09 14:47 UTC Tuomo Valkonen <tuomov@iki.fi>
tagged ion-3rc-20071109
Copyright (c) Tuomo Valkonen 1999-2007.
-The code of this project is "essentially" licensed under the LGPL, version
-2.1, unless otherwise indicated in components taken from elsewhere. It is
-reproduced below. Additionally, the following terms apply to the use of
-the name of the project, Ion(tm), names of particular "branches" such as
-Ion3(tm), and other derived names, in relation to this software, including
-derived works:
+Unless otherwise indicated in components taken from elsewhere, this software
+is licensed under the GNU Lesser General Public License, version 2.1 ("LGPL",
+reproduced below), extended and modified with the following terms:
If the name Ion(tm) or other names that can be associated with the Ion
project are used to distribute this software, then:
- A version that does not significantly differ from one of the
- original author's versions must be provided by default.
+ copyright holder's releases, must be provided by default.
- - When there are no further prominent notices of possible out-datedness,
- and no prominent original author's version qualifiers present (resp.
- only branch qualifier is present), then the version distributed online
- may not significantly differ from the original author's latest stable
- release (resp. latest release on the branch) within a reasonable delay
- (normally 28 days). The holders of physical distribution media must
- be provided ways to upgrade to the latest release within this delay.
+ - Versions not based on the copyright holder's latest release (on
+ the corresponding "branch", such as Ion3(tm)), must within 28 days
+ of this release, be prominently marked as (potentially) obsolete
+ and unsupported.
- Significantly altered versions may be provided only if the user
explicitly requests for those modifications to be applied, and
is prominently notified that the software is no longer considered
- the standard version, and is not supported by the original author.
+ the standard version, and is not supported by the copyright holder.
The version string displayed by the program must describe these
modifications and the "support void" status.
- Derived works that do not satisfy the above terms must be renamed so
- that they can not be associated with the Ion project, their executables
- must be given names that do not conflict with the original author's
- version, and this author may not be referred to for support.
+ Versions for which the above conditions are not satisfied, must be
+ renamed so that they can not be associated with the Ion project, their
+ executables must be given names that do not conflict with the copyright
+ holder's version, and neither the copyright holder nor the Ion project
+ may be referred to for support.
- Modules and other (standalone) extensions to Ion must also be named
- so that they can not be confused to be supported by the original
- author. If "Ion" occurs in the name, it must be in the form
- "Foo for Ion" instead of "Ion Foo", etc.
+ In the text of sections 0-2, 4-12, and 14-16 of the LGPL, "this License"
+ is to be understood to refer to the LGPL extended with these terms and,
+ where applicable, possible similar terms related to the names of other
+ works forming a whole. Sections 3 and 13 of the LGPL are void. Where
+ contradictory, these additional terms are primary to the LGPL.
- This name policy notice may not be altered, and must be included in
- any altered versions and binary redistributions. It may only be
- removed when using small portions of the code in unrelated projects.
+End of terms.
- The original author and the Ion project retain the same rights to
- your modifications that it would have under the LGPL or GPL without
- these or similar additional terms.
- If you fail to follow these terms, you lose the rights granted to
- you by the LGPL.
+Explanations
-Explanations:
+Trademarks: With the terms above primarily appealing to copyright law,
+should any of the indicated trademarks be found invalid, does not excuse
+you from the conditions imposed by those terms. The use of these names
+in contexts other than redistribution of this software and modifications,
+is outside the scope of the terms above, and governed by applicable
+trademark or other laws.
+
+ With regard to modules and other extensions to Ion(tm), the permission
+ is hereby granted to use "Ion" as part of the name, provided that it
+ occurs in a form suggesting that the work is supported by neither the
+ copyright holder nor the Ion project: "Foo for Ion" instead of "Ion Foo",
+ etc.
Significant change: Bug fixes are a priori insignificant as additions.
Basic changes that are needed to install or run the software on a target
platform are a priori insignificant. Additionally, basic configuration
changes to better integrate the software with the target platform,
without obstructing the standard behaviour, are a priori insignificant.
-Everything else is significant. The author reserves the right to refine
-the definition of significant changes on a per-case basis. Please consult
-when in doubt.
+Everything else is significant. The copyright holder reserves the right
+to refine the definition of significant changes on a per-case basis.
+Please consult when in doubt.
Distributions: For example, suppose an aggregate distribution of software
provides an `installpkg` command for installing packages. Then the action
-`installpkg ion3` (resp. `installpkg ion`) should within a reasonable
-delay install the latest release of Ion3 (resp. the latest stable release),
-or prominently notify the user that the provided version is not or may not
-be the latest. The action `installpkg ion-3ds-20070318` may at any date
-install this particular mentioned release. Likewise, the action `installpkg
---support-void-featurex ion3` may apply additional patches to the latest
-Ion3, within the further constraints set above.
+`installpkg ion3` (resp. `installpkg ion`) should after 28 days provide the
+latest release of Ion3 (resp. the latest stable release), or prominently
+notify the user that the provided version is (likely to be) obsolete and
+unsupported. Specific versions (including modified versions) may be provided
+if the user explicitly requests for those, within the constraints set above.
+The latest release being provided by default, or prominently appearing in
+a listing, constitutes prominent marking of earlier releases as obsolete.
The intent of these terms is to curb the power that "distributions", as
the primary sources of software for many users, have in defining what
`utils/ion-completefile/ion-completefile.c` is based on editline, (c)
1992 Simmule Turner and Rich Salz. See the file for details.
-The code that `de/fontset.c` is based on was apparently originally
-written by Tomohiro Kubota; see
-<http://www.debian.org/doc/manuals/intro-i18n/ch-examples.en.html#s13.4.5>.
+The code that `de/fontset.c` is based on seems to have been originally
+written by Tomohiro Kubota, but see the file for details.
Various (minor) patches have been contributed by other individuals
unlisted here. See the mailing list archives and the darcs source
+ion-3rc-20071130
+----------------
+
+This RC features various minor fixes, and some clarifications and
+simplifications to the license, which people seem to have had trouble
+understanding.
+
+
ion-3rc-20071109
----------------
*
* This file contains routines to attempt to add fonts to a font pattern
* so that XCreateFontSet will not fail because the given font(s) do not
- * contain all the characters required by the locale. The original code
- * was apparently written by Tomohiro Kubota; see
+ * contain all the characters required by the locale.
+ *
+ * The original code was apparently written by Tomohiro Kubota; see
* <http://www.debian.org/doc/manuals/intro-i18n/ch-examples.en.html#s13.4.5>.
- *
+ *
+ * However, the code that this file is based on, was taken from:
+ *
+ * Screen.cc for Blackbox - an X11 Window manager
+ * Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry <shaleh@debian.org>
+ * Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
*/
#include <string.h>
spacing = 1,
})
-de.defstyle("frame-tiled-alt", {
- bar = "none",
-})
+--de.defstyle("frame-tiled-alt", {
+-- bar = "none",
+--})
de.defstyle("frame-floating", {
- bar = "shaped",
+ --bar = "shaped",
padding_pixels = 0,
})
de.defstyle("frame-transient", {
- bar = "none",
+ --bar = "none",
padding_pixels = 0,
})
padding_pixels = 1,
})
-de.defstyle("frame-tiled-alt", {
- bar = "none",
-})
+--de.defstyle("frame-tiled-alt", {
+-- bar = "none",
+--})
de.defstyle("frame-floating", {
- bar = "shaped",
+ --bar = "shaped",
spacing = 0,
})
de.defstyle("frame-transient", {
- bar = "none",
+ --bar = "none",
spacing = 0,
})
Context:
-[TAG ion-3rc-20071109
-Tuomo Valkonen <tuomov@iki.fi>**20071109144719]
+[TAG ion-3rc-20071130
+Tuomo Valkonen <tuomov@iki.fi>**20071130172504]
param.dockapp=FALSE;
-again:
/* Is the window already being managed? */
cwin=XWINDOW_REGION_OF_T(win, WClientWin);
if(cwin!=NULL)
*/
xwindow_unmanaged_selectinput(win, StructureNotifyMask);
+ if(!XGetWindowAttributes(ioncore_g.dpy, win, &attr)){
+ if(maprq)
+ warn(TR("Window %#x disappeared."), win);
+ goto fail2;
+ }
/* Is it a dockapp?
*/
hints=XGetWMHints(ioncore_g.dpy, win);
-
- if(hints!=NULL && hints->flags&StateHint)
- init_state=hints->initial_state;
- if(!param.dockapp && init_state==WithdrawnState &&
- hints->flags&IconWindowHint && hints->icon_window!=None){
- /* The dockapp might be displaying its "main" window if no
- * wm that understands dockapps has been managing it.
- */
- if(!maprq)
- XUnmapWindow(ioncore_g.dpy, win);
-
- xwindow_unmanaged_selectinput(win, 0);
-
- /* Copy WM_CLASS as _ION_DOCKAPP_HACK */
- {
- char **p=NULL;
- int n=0;
-
- p=xwindow_get_text_property(win, XA_WM_CLASS, &n);
+ if(hints!=NULL){
+ if(hints->flags&StateHint)
+ init_state=hints->initial_state;
+
+ if(!param.dockapp && init_state==WithdrawnState &&
+ hints->flags&IconWindowHint && hints->icon_window!=None){
+ Window icon_win=hints->icon_window;
+ XWindowAttributes icon_attr;
- if(p!=NULL){
- xwindow_set_text_property(hints->icon_window,
- ioncore_g.atom_dockapp_hack,
- (const char **)p, n);
- XFreeStringList(p);
+ if(!XGetWindowAttributes(ioncore_g.dpy, icon_win, &icon_attr)){
+ if(maprq)
+ warn(TR("Window %#x disappeared."), win);
+ XFree((void*)hints);
+ goto fail2;
+ }
+
+ if(!maprq){
+ if(attr.map_state==IsViewable){
+ /* The dockapp might be displaying its "main" window if no
+ * wm that understands dockapps has been managing it.
+ */
+ XUnmapWindow(ioncore_g.dpy, win);
+ param.dockapp=TRUE;
+ }else{
+ /* Main window is unmapped on initial scan, but icon window
+ * is mapped. Let's hope it's a dockapp left by e.g. us.
+ */
+ if(icon_attr.map_state==IsViewable)
+ param.dockapp=TRUE;
+ }
}else{
- const char *pdummy[2]={"unknowndockapp", "UnknownDockapp"};
- xwindow_set_text_property(hints->icon_window,
- ioncore_g.atom_dockapp_hack,
- pdummy, 2);
+ param.dockapp=TRUE;
+ }
+
+ if(param.dockapp){
+ char **p=NULL;
+ int n=0;
+
+ xwindow_unmanaged_selectinput(win, 0);
+ xwindow_unmanaged_selectinput(icon_win, StructureNotifyMask);
+
+ win=icon_win;
+ attr=icon_attr;
+
+ /* Copy WM_CLASS as _ION_DOCKAPP_HACK */
+
+ p=xwindow_get_text_property(win, XA_WM_CLASS, &n);
+
+ if(p!=NULL){
+ xwindow_set_text_property(icon_win, ioncore_g.atom_dockapp_hack,
+ (const char **)p, n);
+ XFreeStringList(p);
+ }else{
+ const char *pdummy[2]={"unknowndockapp", "UnknownDockapp"};
+ xwindow_set_text_property(icon_win, ioncore_g.atom_dockapp_hack,
+ pdummy, 2);
+ }
}
}
- /* It is a dockapp, do everything again from the beginning, now
- * with the icon window.
- */
- win=hints->icon_window;
- param.dockapp=TRUE;
- goto again;
- }
-
- if(hints!=NULL)
XFree((void*)hints);
-
- if(!XGetWindowAttributes(ioncore_g.dpy, win, &attr)){
- if(maprq)
- warn(TR("Window %#x disappeared."), win);
- goto fail2;
}
- attr.width=maxof(attr.width, 1);
- attr.height=maxof(attr.height, 1);
-
/* Do we really want to manage it? */
if(!param.dockapp && (attr.override_redirect ||
(!maprq && attr.map_state!=IsViewable))){
goto fail2;
}
+ attr.width=maxof(attr.width, 1);
+ attr.height=maxof(attr.height, 1);
+
/* Find root window */
FOR_ALL_ROOTWINS(rootwin){
if(WROOTWIN_ROOT(rootwin)==attr.root)
binding.func=func;
if(bindmap_remove_binding(bindmap, &binding))
return TRUE;
- warn(TR("Unable to remove binding %s."), str);
+ /*warn(TR("Unable to remove binding %s."), str);*/
}
return FALSE;
* \var{kbresize_t_min} & (integer) See below. \\
* \var{kbresize_step} & (floating point) See below. \\
* \var{kbresize_maxacc} & (floating point) See below. \\
+ * \var{edge_resistance} & (integer) Resize edge resistance in pixels. \\
* \var{framed_transients} & (boolean) Put transients in nested frames. \\
* \var{float_placement_method} & (string) How to place floating frames.
* One of \codestr{udlr} (up-down, then left-right),
* See the included file LICENSE for details.
*/
+#include <string.h>
+
#include <libtu/objp.h>
#include <libtu/setparam.h>
#include <libtu/minmax.h>
*mode=FRAME_MODE_FLOATING;
- if(OBJ_IS(mplex, WFrame)
- && frame_mode((WFrame*)mplex)==FRAME_MODE_TRANSIENT){
- *mode=FRAME_MODE_TRANSIENT;
+ if(OBJ_IS(mplex, WFrame)){
+ WFrameMode mode2=frame_mode((WFrame*)mplex);
+ if(framemode_unalt(mode2)==FRAME_MODE_TRANSIENT)
+ *mode=mode2;
}
return (WRegion*)mplex;
#define CF_TAB_MAX_TEXT_X_OFF 10
-static void frame_shaped_recalc_bar_size(WFrame *frame)
+static void frame_shaped_recalc_bar_size(WFrame *frame, bool complete)
{
int bar_w=0, textw=0, tmaxw=frame->tab_min_w, tmp=0;
WLListIterTmp itmp;
bar_w=frame->bar_max_width_q*REGION_GEOM(frame).w;
}
- if(frame->bar_w!=bar_w){
+ if(complete || frame->bar_w!=bar_w){
frame->bar_w=bar_w;
frame_set_shape(frame);
}
}
-void frame_recalc_bar(WFrame *frame)
+void frame_recalc_bar(WFrame *frame, bool complete)
{
int textw, i;
WLListIterTmp tmp;
return;
if(frame->barmode==FRAME_BAR_SHAPED)
- frame_shaped_recalc_bar_size(frame);
+ frame_shaped_recalc_bar_size(frame, complete);
i=0;
void frame_brushes_updated(WFrame *frame)
{
- WFrameBarMode barmode=FRAME_BAR_INSIDE;
+ WFrameBarMode barmode;
ExtlTab tab;
char *s;
if(frame->brush==NULL)
return;
- if(frame->mode==FRAME_MODE_FLOATING)
+ if(frame->mode==FRAME_MODE_FLOATING){
barmode=FRAME_BAR_SHAPED;
- else if(frame->mode==FRAME_MODE_TRANSIENT)
- barmode=FRAME_BAR_NONE;
- else if(frame->mode==FRAME_MODE_TILED_ALT)
+ }else if(frame->mode==FRAME_MODE_TILED || frame->mode==FRAME_MODE_UNKNOWN ||
+ frame->mode==FRAME_MODE_TRANSIENT_ALT){
+ barmode=FRAME_BAR_INSIDE;
+ }else{
barmode=FRAME_BAR_NONE;
+ }
if(grbrush_get_extra(frame->brush, "bar", 's', &s)){
if(strcmp(s, "inside")==0)
region_updategr_default((WRegion*)frame);
mplex_fit_managed(&frame->mplex);
- frame_recalc_bar(frame);
+ frame_recalc_bar(frame, TRUE);
frame_set_background(frame, TRUE);
}
-StringIntMap frame_tab_styles[]={
+static StringIntMap frame_tab_styles[]={
+ {"tab-frame-unknown", FRAME_MODE_UNKNOWN},
+ {"tab-frame-unknown-alt", FRAME_MODE_UNKNOWN_ALT},
{"tab-frame-tiled", FRAME_MODE_TILED},
{"tab-frame-tiled-alt", FRAME_MODE_TILED_ALT},
{"tab-frame-floating", FRAME_MODE_FLOATING},
+ {"tab-frame-floating-alt", FRAME_MODE_FLOATING_ALT},
{"tab-frame-transient", FRAME_MODE_TRANSIENT},
+ {"tab-frame-transient-alt", FRAME_MODE_TRANSIENT_ALT},
END_STRINGINTMAP
};
extern void frame_draw(const WFrame *frame, bool complete);
extern void frame_draw_bar(const WFrame *frame, bool complete);
-extern void frame_recalc_bar(WFrame *frame);
+extern void frame_recalc_bar(WFrame *frame, bool complete);
extern void frame_bar_geom(const WFrame *frame, WRectangle *geom);
extern void frame_border_geom(const WFrame *frame, WRectangle *geom);
extern void frame_border_inner_geom(const WFrame *frame, WRectangle *geom);
WHook *frame_managed_changed_hook=NULL;
-#define IS_FLOATING_MODE(FRAME) \
- ((FRAME)->mode==FRAME_MODE_FLOATING || (FRAME)->mode==FRAME_MODE_TRANSIENT)
-#define FORWARD_CWIN_RQGEOM(FRAME) IS_FLOATING_MODE(FRAME)
-#define USE_MINMAX(FRAME) IS_FLOATING_MODE(FRAME)
-#define DEST_EMPTY(FRAME) IS_FLOATING_MODE(FRAME)
+#define FORWARD_CWIN_RQGEOM(FRAME) framemode_is_floating(frame_mode(FRAME))
+#define USE_MINMAX(FRAME) framemode_is_floating(frame_mode(FRAME))
+#define DEST_EMPTY(FRAME) framemode_is_floating(frame_mode(FRAME))
+
+
+WFrameMode framemode_unalt(WFrameMode mode)
+{
+ if(mode==FRAME_MODE_UNKNOWN_ALT)
+ return FRAME_MODE_UNKNOWN;
+ else if(mode==FRAME_MODE_TILED_ALT)
+ return FRAME_MODE_TILED;
+ else if(mode==FRAME_MODE_FLOATING_ALT)
+ return FRAME_MODE_FLOATING;
+ else if(mode==FRAME_MODE_TRANSIENT_ALT)
+ return FRAME_MODE_TRANSIENT;
+ else
+ return mode;
+}
+
+
+static WFrameMode framemode_is_floating(WFrameMode mode)
+{
+ WFrameMode modea=framemode_unalt(mode);
+
+ return (modea==FRAME_MODE_FLOATING || modea==FRAME_MODE_TRANSIENT);
+}
/*{{{ Destroy/create frame */
static void frame_add_mode_bindmaps(WFrame *frame)
{
- WFrameMode mode=frame->mode;
+ WFrameMode modea=framemode_unalt(frame->mode);
- if(mode==FRAME_MODE_FLOATING){
+ if(modea==FRAME_MODE_FLOATING){
region_add_bindmap((WRegion*)frame, ioncore_mplex_toplevel_bindmap);
region_add_bindmap((WRegion*)frame, ioncore_frame_toplevel_bindmap);
region_add_bindmap((WRegion*)frame, ioncore_frame_floating_bindmap);
- }else if(mode==FRAME_MODE_TRANSIENT){
+ }else if(modea==FRAME_MODE_TRANSIENT){
region_add_bindmap((WRegion*)frame, ioncore_frame_transient_bindmap);
region_add_bindmap((WRegion*)frame, ioncore_frame_floating_bindmap);
}else{
frame_initialise_gr(frame);
mplex_fit_managed(&frame->mplex);
- frame_recalc_bar(frame);
+ frame_recalc_bar(frame, TRUE);
frame_set_background(frame, TRUE);
}
}
-StringIntMap frame_modes[]={
+static StringIntMap frame_modes[]={
{"unknown", FRAME_MODE_UNKNOWN},
+ {"unknown-alt", FRAME_MODE_UNKNOWN_ALT},
{"tiled", FRAME_MODE_TILED},
{"tiled-alt", FRAME_MODE_TILED_ALT},
{"floating", FRAME_MODE_FLOATING},
+ {"floating-alt", FRAME_MODE_FLOATING_ALT},
{"transient", FRAME_MODE_TRANSIENT},
+ {"transient-alt", FRAME_MODE_TRANSIENT_ALT},
END_STRINGINTMAP
};
/*EXTL_DOC
- * Set frame mode.
+ * Set frame mode (one of
+ * \codestr{unknown}, \codestr{tiled}, \codestr{floating}, \codestr{transient},
+ * or any of these suffixed with \codestr{-alt}).
*/
EXTL_EXPORT_AS(WFrame, set_mode)
bool frame_set_mode_extl(WFrame *frame, const char *modestr)
}
}
- frame_recalc_bar(frame);
+ frame_recalc_bar(frame, FALSE);
return TRUE;
}
woff=maxof(REGION_GEOM(frame).w-subgeom.w, 0);
hoff=maxof(REGION_GEOM(frame).h-subgeom.h, 0);
- if(FRAME_CURRENT(frame)!=NULL){
+ if(FRAME_CURRENT(frame)!=NULL)
region_size_hints(FRAME_CURRENT(frame), hints_ret);
- if(!USE_MINMAX(frame)){
- hints_ret->max_set=0;
- hints_ret->min_set=0;
- /*hints_ret->base_set=0;*/
- hints_ret->aspect_set=0;
- hints_ret->no_constrain=FALSE;
- /*hints_ret->no_constrain=TRUE;*/
- }
- }else{
+ else
sizehints_clear(hints_ret);
- }
FRAME_MX_FOR_ALL(sub, frame, tmp){
sizehints_adjust_for(hints_ret, sub);
}
- if(!hints_ret->base_set){
- hints_ret->base_width=0;
- hints_ret->base_height=0;
- hints_ret->base_set=TRUE;
+ if(!USE_MINMAX(frame)){
+ hints_ret->max_set=0;
+ hints_ret->min_set=0;
+ /*hints_ret->base_set=0;*/
+ hints_ret->aspect_set=0;
+ hints_ret->no_constrain=FALSE;
+ /*hints_ret->no_constrain=TRUE;*/
}
-
+
if(!hints_ret->min_set){
hints_ret->min_width=0;
hints_ret->min_height=0;
hints_ret->min_set=TRUE;
}
+ if(!hints_ret->base_set){
+ hints_ret->base_width=0;
+ hints_ret->base_height=0;
+ hints_ret->base_set=TRUE;
+ }
+
hints_ret->base_width+=woff;
hints_ret->base_height+=hoff;
hints_ret->max_width+=woff;
how==ioncore_g.notifies.tag){
frame_update_attrs(frame);
- frame_recalc_bar(frame);
+ frame_recalc_bar(frame, FALSE);
frame_draw_bar(frame, FALSE);
}
}
int bar_w=frame->bar_w;
if(wchg)
- frame_recalc_bar(frame);
+ frame_recalc_bar(frame, TRUE);
if(frame->barmode==FRAME_BAR_SHAPED &&
((!wchg && hchg) || (wchg && bar_w==frame->bar_w))){
/* Transient manager searches should not cross tiled frames
* unless explicitly floated.
*/
- if(IS_FLOATING_MODE(frame) ||
+ if(framemode_is_floating(frame_mode(frame)) ||
extl_table_is_bool_set(transient->proptab, "float")){
return region_prepare_manage_transient_default((WRegion*)frame,
transient,
FRAME_MODE_TILED,
FRAME_MODE_TILED_ALT,
FRAME_MODE_FLOATING,
- FRAME_MODE_TRANSIENT
+ FRAME_MODE_TRANSIENT,
+ FRAME_MODE_UNKNOWN_ALT,
+ FRAME_MODE_FLOATING_ALT,
+ FRAME_MODE_TRANSIENT_ALT
} WFrameMode;
typedef enum{
extern WHook *frame_managed_changed_hook;
+extern WFrameMode framemode_unalt(WFrameMode mode);
+
#endif /* ION_IONCORE_FRAME_H */
if(st->reg!=NULL){
WFitParams fp;
-
+
+ fp.mode=0;
fp.g=REGION_GEOM(cwg);
sizepolicy(&st->szplcy, st->reg, NULL,
frame=OBJ_CAST(reg, WFrame);
if(frame!=NULL){
- WFrameMode m=frame_mode(frame);
- if(m==FRAME_MODE_TILED || m==FRAME_MODE_TILED_ALT)
+ if(framemode_unalt(frame_mode(frame))==FRAME_MODE_TILED)
frame_set_mode(frame, FRAME_MODE_FLOATING);
}
region_set_focus(st->reg);
else
ws->current_managed=st;
+ }else if(region_is_fully_mapped(reg)){
+ region_pointer_focus_hack(reg);
}
-
+
return TRUE;
}
stdisp->flags|=REGION_SKIP_FOCUS;
fp.g=REGION_GEOM(ws);
+ fp.mode=0;
+
sizepolicy(&ws->managed_stdisp->szplcy, stdisp, NULL, 0, &fp);
region_fitrep(stdisp, NULL, &fp);
fp.mode=REGION_FIT_EXACT;
}else{
fp.g=REGION_GEOM(ws);
+ fp.mode=0;
sizepolicy(&st->szplcy, reg, &rq->geom, rq->flags, &fp);
}
"Ion " ION_VERSION ", copyright (c) Tuomo Valkonen 1999-2007.";
static const char ioncore_license[]=DUMMY_TR(
- "This software is essentially licensed under the GNU Lesser General\n"
- "Public License (LGPL), version 2.1, unless otherwise indicated in\n"
- "components taken from elsewhere. Additional terms apply to the use\n"
- "of the name of the project, Ion(tm). For details, see the file\n"
- "LICENSE that you should have received with this software.\n"
+ "This software is licensed under the GNU Lesser General Public License\n"
+ "(LGPL), version 2.1, extended with terms applying to the use of the name\n"
+ "of the project, Ion(tm), unless otherwise indicated in components taken\n"
+ "from elsewhere. For details, see the file LICENSE that you should have\n"
+ "received with this software.\n"
"\n"
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
if not d2 then
return nil, err
else
- print('follow')
return checkdir(d2)
end
elseif t=="directory" then
return true
else
- return TR("Not a directory.")
+ return nil, TR("Not a directory.")
end
end
end
--DOC
-- Change default working directory for new programs started in \var{reg}.
function ioncore.chdir_for(reg, dir)
- assert(type(dir)=="string")
+ assert(dir==nil or type(dir)=="string")
if dir=="" or dir==nil then
dirs[reg]=nil
return true
local function lookup_runinxterm_warn(prog, title, wait)
local rx=lookup_script_warn("ion-runinxterm")
if rx then
+ rx="exec "..rx
if wait then
rx=rx.." -w"
end
local function save_config()
local t={}
for r, d in pairs(dirs) do
- t[r:name()]=d
+ local nm=obj_exists(r) and r:name()
+ if nm then
+ t[nm]=d
+ end
end
ioncore.write_savefile(savefile, t)
end
if p==nil then
return true
else
- return (p==(i and true))
- -- hack for nil
+ return (p==(i and true or false))
+ -- hack for nil i
end
end
static double accel=1, accelinc=30, accelmax=100*100;
static long actmax=200, uptmin=50;
static int resize_delay=CF_RESIZE_DELAY;
+/* Here to not have to write other set callback for resize code... */
+int ioncore_edge_resistance=CF_EDGE_RESISTANCE;
static void accel_reset()
void ioncore_set_moveres_accel(ExtlTab tab)
{
- int t_max, t_min, rd;
+ int t_max, t_min, rd, er;
double step, maxacc;
if(extl_table_gets_i(tab, "kbresize_t_max", &t_max))
accelmax=(maxacc>0 ? maxacc*maxacc : 1);
if(extl_table_gets_i(tab, "kbresize_delay", &rd))
resize_delay=maxof(0, rd);
+ if(extl_table_gets_i(tab, "edge_resistance", &er))
+ ioncore_edge_resistance=maxof(0, er);
}
extl_table_sets_d(tab, "kbresize_step", accelinc);
extl_table_sets_d(tab, "kbresize_maxacc", accelmax);
extl_table_sets_d(tab, "kbresize_delay", resize_delay);
+ extl_table_sets_i(tab, "edge_resistance", ioncore_edge_resistance);
}
node=mplex_find_stacking(mplex, sub);
assert(node!=NULL);
-
+
+ fp.mode=0;
mplex_managed_geom(mplex, &fp.g);
-
+
sizepolicy(&node->szplcy, sub, &rq->geom, rq->flags, &fp);
if(geomret!=NULL)
if(!(param->flags&MPLEX_ATTACH_WHATEVER)){
WFitParams fp;
+ fp.mode=0;
mplex_managed_geom(mplex, &(fp.g));
sizepolicy(&node->szplcy, reg,
* client windows still..)
*/
mplex_refocus(mplex, NULL, FALSE);
+ }else if(!hidden){
+ region_pointer_focus_hack(reg);
}
+ }else if(!hidden){
+ region_pointer_focus_hack(reg);
}
if(lnode!=NULL)
if(reg==NULL)
return FALSE;
- if(ev->subwindow!=None){
- XButtonEvent ev2=*ev;
- ev2.window=ev->subwindow;
- if(XTranslateCoordinates(ioncore_g.dpy, ev->window, ev2.window,
- ev->x, ev->y, &(ev2.x), &(ev2.y),
- &(ev2.subwindow))){
- if(ioncore_do_handle_buttonpress(&ev2))
- return TRUE;
- }
- }
-
dblclick=(p_clickcnt==1 && time_in_threshold(ev->time) &&
p_button==button && p_state==state && reg==p_reg);
#define XOR_RESIZE (!ioncore_g.opaque_resize)
+extern int ioncore_edge_resistance;
+
+
/*{{{ Size/position display and rubberband */
w=mode->geom.w;
h=mode->geom.h;
- if((mode->hints.inc_set) &&
- (mode->hints.width_inc>1 || mode->hints.height_inc>1)){
- if(mode->hints.base_set){
- w-=mode->hints.base_width;
- h-=mode->hints.base_height;
- }
- w/=mode->hints.width_inc;
- h/=mode->hints.height_inc;
+ if(mode->hints.base_set){
+ w=maxof(0, w-mode->hints.base_width);
+ h=maxof(0, h-mode->hints.base_height);
+ }
+
+ if(mode->hints.inc_set){
+ w/=maxof(1, mode->hints.width_inc);
+ h/=maxof(1, mode->hints.height_inc);
}
snprintf(buf, INFOWIN_BUFFER_LEN, "%dx%d", w, h);
if(mgr==(WRegion*)parent){
mode->snapgeom.x=0;
mode->snapgeom.y=0;
- mode->snap_enabled=FALSE;
- }else if(REGION_PARENT(mgr)==parent){
- mode->snap_enabled=TRUE;
+ /*mode->snap_enabled=FALSE;*/
}
+ mode->snap_enabled=TRUE;
}
if(!mode->hints.min_set || mode->hints.min_width<1)
}
+static int clamp_up(int t, int low, int high)
+{
+ return (t < high && t > low ? high : t);
+}
+
+
static void moveresmode_delta(WMoveresMode *mode,
int dx1, int dx2, int dy1, int dy2,
WRectangle *rret)
{
int realdx1, realdx2, realdy1, realdy2;
WRQGeomParams rq=RQGEOMPARAMS_INIT;
+ int er=ioncore_edge_resistance;
int w=0, h=0;
realdx1=(mode->dx1+=dx1);
/* snap */
if(mode->snap_enabled){
WRectangle *sg=&mode->snapgeom;
- int er=CF_EDGE_RESISTANCE;
if(mode->dx1!=0 && rq.geom.x+mode->dx1<sg->x && rq.geom.x+mode->dx1>sg->x-er)
realdx1=sg->x-rq.geom.x;
realdy2=sg->y+sg->h-rq.geom.y-rq.geom.h;
}
- w=mode->origgeom.w-realdx1+realdx2;
- h=mode->origgeom.h-realdy1+realdy2;
-
- if(w<=0)
- w=mode->hints.min_width;
- if(h<=0)
- h=mode->hints.min_height;
+ w=maxof(1, mode->origgeom.w-realdx1+realdx2);
+ h=maxof(1, mode->origgeom.h-realdy1+realdy2);
+
+ if(mode->snap_enabled && mode->hints.base_set){
+ w=clamp_up(w, mode->hints.base_width-er, mode->hints.base_width);
+ h=clamp_up(h, mode->hints.base_height-er, mode->hints.base_height);
+ }
+ /* Correct size */
sizehints_correct(&mode->hints, &w, &h, TRUE, TRUE);
/* Do not modify coordinates and sizes that were not requested to be
-- See the included file LICENSE for details.
--
+local function simplify_path(path)
+ local npath=string.gsub(path, "([^/]+)/+%.%./+", "")
+ if npath~=path then
+ return simplify_path(npath)
+ else
+ return string.gsub(string.gsub(path, "([^/]+)/+%.%.$", ""), "/+", "/")
+ end
+end
+
+local function relative_path(path)
+ return not string.find(path, "^/")
+end
+
+local function empty_path(path)
+ return (not path or path=="")
+end
+
local function ws_chdir(mplex, params)
+ local nwd=params[1]
+
ws=assert(ioncore.find_manager(mplex, "WGroupWS"))
- local ok, err=ioncore.chdir_for(ws, params[1] or "")
+
+ if not empty_path(nwd) and relative_path(nwd) then
+ local owd=ioncore.get_dir_for(ws)
+ if empty_path(owd) then
+ owd=os.getenv("PWD")
+ end
+ if owd then
+ nwd=owd.."/"..nwd
+ end
+ end
+ local ok, err=ioncore.chdir_for(ws, nwd and simplify_path(nwd))
if not ok then
mod_query.warn(mplex, err)
end
end
local function ws_showdir(mplex, params)
- local dir=assert(ioncore.get_dir_for(mplex) or os.getenv("PWD"))
- mod_query.message(mplex, dir)
+ local dir=ioncore.get_dir_for(mplex)
+ if empty_path(dir) then
+ dir=os.getenv("PWD")
+ end
+ mod_query.message(mplex, dir or "(?)")
end
mod_query.defcmd("cd", ws_chdir)
frame=OBJ_CAST(reg, WFrame);
if(frame!=NULL){
- WFrameMode mode=frame_mode(frame);
- if(mode!=FRAME_MODE_TILED && mode!=FRAME_MODE_TILED_ALT)
+ if(framemode_unalt(frame_mode(frame))==FRAME_MODE_TILED)
frame_set_mode(frame, FRAME_MODE_TILED);
}
complete)
if test "x$usercache" != x -a -f "$usercache"; then
cachefile="$usercache"
- fi
-
- if test -f "$syscache"; then
+ elif test -f "$syscache"; then
cachefile="$syscache"
fi
-#define ION_VERSION "3rc-20071109"
+#define ION_VERSION "3rc-20071130"
#define ION_API_VERSION "3"