This patch adds support for the _NET_FRAME_EXTENTS property as
described in the EWMH spec. With it I was able to use the compton
compositing manager to draw fully opaque windows with semi-transparent
titlebars and resizebars.
Set the _NET_FRAME_EXTENTS property based on border widths and
titlebar/resizebar heights.
The EWMH spec says:
"_NET_FRAME_EXTENTS, left, right, top, bottom, CARDINAL[4]/32
The Window Manager MUST set _NET_FRAME_EXTENTS to the extents of the
window's frame. left, right, top and bottom are widths of the
respective borders added by the Window Manager."
Update the saved X co-ordinate of a window which was moved when
maximized (only) vertically so that unmaximizing the window restores
its dimensions without warping it back to its previous X position.
Similarly update the saved Y co-ordinate of a window which was
moved when maximized (only) horizontally.
Handle Maximus as a special case. We remember the Maximusized X and Y
co-ordinates then adjust the restored co-ordinates relative to the
delta between the window's position just after Maximusizing and its
position just before restoring. So for example if a window is
Maximusized, moved 100 pixels to the left and restored, it will end
up 100 pixels left of its original geometry.
Also fix "jumping window" bug reported by Christian Wittmer:
This "jumping window" happens only when you
1) open new xterm (STRG +n)
2) current position is (+64, +0)
3) maximize window vertically
4) undo maximizing
5) move window to the right or left (up or down as you like)
I moved right to (+450, +0)
6) maximize vertically again
7) and undo maximizing
8) window jumps back to (+64, ..) position
If you move a new opened window to a new position (e.g. +200, +200)
and then start with "3)". window is jumping back "+200, +200"
The variables waiting_save_ack, dragged_while_fmaximized,
buttons_dont_fit, rebuild_texture and needs_full_repaint are not used,
so they can be removed.
Even though net_state_from_client was never being set, it was
being tested inside a
if (!wwin->flags.net_state_from_client)
which according to testing was always being true (probably because gcc
initializes it to zero). But this situation is confusing, so it's
better to remove the if() test altogether as that is the intention
if net_state_from_client is not explicitly set (which it isn't in
the current wmaker source).
This situation is analogous to:
[mafra@Pilar:c]$ cat init.c
int main(void)
{
int a;
if (!a)
printf("No a = %d\n", a);
return 0;
}
[mafra@Pilar:c]$ ./init
No a = 0
The functions related to colormap are moved from funcs.h to the new
file colormap.h. These files are included where needed.
The functions wColormapInstallRoot and wColormapUninstallRoot are
removed, because they are not used.
New functions
static void add_to_appicon_list()
static void remove_from_appicon_list()
to add or remove appicons from the app_icon_list, making the code easier
to follow.
LITE was removed in fe736e849c ("Remove LITE config option"), but
the check for it in wmaker.inst was missed.
Furthermore, remove confusing message about wmaker being configured for KDE.
The functions of main.c should be included in main.h, not in funcs.h.
This patch adds the main.h file and moves the function prototypes to
this file.
The not needed "include funcs.h" are removed.
The contents of the rootmenu.h file are not used and can be removed,
but the prototypes of rootmenu.c are in funcs.h and should be moved
to the correct (rootmenu.h) file.
Making all in src
CC actions.o
actions.c: In function ‘wMaximizeWindow’:
actions.c:421:14: warning: ‘maximus_height’ may be used uninitialized in this function [-Wuninitialized]
actions.c:440:29: warning: ‘maximus_width’ may be used uninitialized in this function [-Wuninitialized]
actions.c:442:35: warning: ‘maximus_y’ may be used uninitialized in this function [-Wuninitialized]
actions.c:454:18: warning: ‘maximus_x’ may be used uninitialized in this function [-Wuninitialized]
CCLD wmaker
These warnings were harmless because they were at a point where
find_Maximus_geometry() had already been called. So let's simply initialize
them to zero to silence gcc.
There are some code duplication in winmenu.c. Two new functions,
- open_window_menu_core
- prepare_menu_position
Join the common code and then the duplicated code can be removed.
Create a header file dockedapp.h to address a long-standing warning
which pollutes the compilation output with --enable-silent-rules:
Making all in src
CC dock.o
dock.c: In function ‘wDockDetach’:
dock.c:2118:3: warning: call to function ‘DestroyDockAppSettingsPanel’ without a real prototype [-Wunprototyped-calls]
dock.c:65:13: note: ‘DestroyDockAppSettingsPanel’ was declared here
CCLD wmaker
The superfluous.[ch] files have a few minor issues, this patch addresses some of them:
- Move the defines to the top of the superfluous.c file
- Include the ifdef NORMAL_ICON_KABOOM inside the DoKaboom() function
because the DoKaboom is used without the NORMAL_ICON_KABOOM ifdef in
other files.
- Include the ifdef WINDOW_BIRTH_ZOOM inside the DoWindowBirth() function,
therefore the function don't needs to be defined twice (with and whitout
WINDOW_BIRTH_ZOOM define.
- Now the functions are defined in superfluous.h and the externs are not
needed.
- We need include the dock.h in the superflous.h because is used by the
definition of MakeGhostDock().
- We need include the superfluous.h in window.c (removing the extern)
Fons Adriaensen reported that:
> WM's 'unshade' seems to use multiple Expose events [...] even when
> all animations and 'superfluous effects' are disabled.
Typo in shade_animate() could cause windows to be animated when the
no_animations preference was set. With this patch I see fewer
XMoveWindow() calls and quicker shading.
We want to avoid having to consider the position of an appicon whose
application has no_appicon set. The appicon is not "painted" so it
does not appear on the screen. But if the appicon is still added to
the list of application icons, the wArrangeIcons() function gets
confused and ends up creating holes in the icon positions which
correspond to the no_appicon apps.
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
Having two similarly named functions for doing the same thing is confusing.
In order to account for the extra check done by the late wAppIconSave(),
add an argument "dock".
Now there's only save_appicon().
And as pointed out by Rodolfo kix García, the save_appicon_core() function
can be removed too.
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
Function names are important and should not do more than their
names imply. In this case, create_appicon_from_dock() should only
try to get an icon from the dock (or clip).
If the icon is not there, do not try to make an icon from scratch.
You were told to create it from the dock!
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
Last group from a desktop file is always added to menu regardless of
NoDisplay property. Properly handle the NoDisplay and Hidden properties
at the end of file.
Signed-off-by: Alexey I. Froloff <raorn@raorn.name>
The icon painting is moved to the function makeAppIconFor()
including the check for no_appicon.
wAppIconCreate is now static because is only used in makeAppIconFor()
The path of the CacheIcons is defined at CACHE_ICON_PATH. The path
~/GNUstep/Library/WindowMaker/CachedPixmaps can be changed in a future
and the comment is incorrect.
The function extractIcon is removed, and its behaviour is moved to
save_app_icon, because this function is always called.
To do that, save_app_icon doesn't need to check if the icon is saved (it's
done at wIconStore). The icon now is saved always (if it doesn't exist),
like extractIcon() used to do.
When the application is created, the WAppIcon now is created always,
but it is only painted if the flag is not set.
The icon initialization to NULL can be done now at app_icon_create_from_docks
because it is always called.
The function app_icon_create_from_docks is moved to appicon.c, because
it is a function to create application icons.
The static function findDockIconFor is moved too because it is only used
at app_icon_create_from_docks().
The function wAppIconSave is splitted in two functions:
wAppIconSave() + save_app_icon_core()
The function save_app_icon_core will be used in other functions as
common code.
The Bool value is not used, therefore it suffices to return void.
wAppIconChangeImage is removed from appicon.h, because it is not implemented.
Small code cleanup for wAppIconCreateForDock at appicon.h.
The icon functions wApplicationExtractDirPackIcon() wApplicationSaveIconPathFor()
are moved to appicon.c from application.c.
This functions are Application Icon related and should be included in appicon.
The function get_name_for_icon is renamed to get_name_for_wwin.
The previous contents of get_name_for_icon are now at the new
function get_name_for_instance_class.
Center strategy: try to put window at the center of the usable area. If
window would overlap with existing windows, fall back to "Auto"
placement strategy.
It's very useful for fresh workplaces.
The function get_name_for_icon returns now the name of the icon,
without the full icon path and without extension (.xpm). Now is
not static.
The full path, including the folder creation, is done now by
wmkdirhier() (WINGs). This function is much better, because
supports "infinite" folders, not like the old get_name_for_icon
which could only create the specific folder for Cache Icons.
Using this functions, wIconStore() do the same work, but in a better
way, more clear.
This patch creates some functions:
1. Rename getnameforicon() to get_name_for_icon()
2. New function get_icon_cache_path, to get the icon cache folder
($HOME + GNUstep/Library/WindowMaker/CachedPixmaps). This folder
is defined now in the preprocessor. Not used yet, in next commits.
3. New function get_wwindow_image_from_wmhints to read the image from
X11 wmhints. Previous code at wIconStore() now changed.
The function wDefaultFillAttributes can be changed a lot:
1. Initialitation to NULL: If the pointers are initialized to NULL
then, the "if's" don't need the else block:
WMPropList *value, *dw, *dc, *dn, *da;
dw = dc = dn = da = NULL;
if's:
= if (instance)
= key2 = WMCreatePLString(instance);
- else
- key2 = NULL;
2. Added StrConcatDot in the class + instance block:
= if (class && instance) {
+ buffer = StrConcatDot(instance, class);
- buffer = wmalloc(strlen(class) + strlen(instance) + 2);
- sprintf(buffer, "%s.%s", instance, class);
3. init_wdefaults(scr); moved above. This function is used only
to load the default value "AnyWindow" (value "*"), to search
the default value. Can be moved above without problems.
4. Preprocessor code of APPLY_VAL moved to the top of the file.
5. New function get_value_from_instanceclass() to do the rest of
the (repetitive) code. This function is called to create the
proplist, search the value, and return the proplist.
EXTRA:
1. Added StrConcatDot (like dot 2) in wDefaultChangeIcon()
2. Added a comment in get_value()
The argument "src" is removed in the function get_generic_value()
because it is not used.
The function wDefaultGetIconFile() is moved close to
wDefaultGetStartWorkspace() because both are similar.