1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00
Commit Graph

2594 Commits

Author SHA1 Message Date
Rodolfo García Peñas (kix)
829830c010 New function create_default_icon
The function create_default_icon sets the panel's default icon. This
is interesting to have a "cache" icon and don't search the default
icon more than one time if the icons don't have icon associated.

The code of create_default_icon was included in the addIconForWindow()
function, this patch only moves it to get a better (clear) code.
2012-07-15 16:23:54 +02:00
Rodolfo García Peñas (kix)
6d08aa22d8 switchpanel.c code clean
Some code clean in the file switchpanel.c, like spaces, curly brackets,
tabs, join ifs,...
2012-07-15 16:22:19 +02:00
Rodolfo García Peñas (kix)
43c3526d21 WPrefs: XKeycodeToKeysym deprecated function
The function XKeycodeToKeysym is deprecated and should be replaced
by XkbKeycodeToKeysym.
2012-07-15 13:34:37 +02:00
Christophe CURIS
139f912e61 Remove dependency to CPP: removed stuff related to CPP calls
Now that the built-in parser has support for all the feature of CPP
being used by WindowMaker's default menu, we can remove the stuff
related to calling CPP:
 - code for preparing and running CPP;
 - compile-time option to de-activate the call to CPP;
 - command-line option
2012-07-14 20:22:21 +02:00
Christophe CURIS
4658f4f9a1 Remove dependency to CPP: add support for conditional directives
It is now possible to use #ifdef/#ifndef to exclude some part of the
file. The implementation uses a stack to track conditionals so it is
possible to use nested constructs.
2012-07-14 20:22:20 +02:00
Christophe CURIS
9b792369cb Remove dependency to CPP: added pre-defined macros
A number of macros are pre-defined by WindowMaker for CPP in the
function 'MakeCPPArgs', they are now available in the internal
parser too. CPP also had some predefined macros, a subset of them
have been added.
The definition have been split in two parts:
 - the macro that are dependant on WindowMaker parameters are
defined by WindowMaker (src/rootmenu.c)
 - those that are independant, which can be defined by the parser
itself (WINGs/menuparser_macros.c)
2012-07-14 20:22:20 +02:00
Christophe CURIS
aaa4517df7 Remove dependency to CPP: support for #define macros
This adds support for defining new macros, with or without parameters, which
when found afterwards in the text are replaced by their definition.
The complex analysis for arguments replacement is done at macro definition
time, so it is done only once and the macro expansion will be fast.
The macro-related functions have been placed in their own file because it is
quite a complex task and we do not want filesize to explode, it is always
better to keep things human-sized.
2012-07-14 20:22:20 +02:00
Christophe CURIS
88a82ab8df Remove dependency to CPP: support for #include directive
The parser is prepared to handle '#' directives, starting with file
inclusion. The search path for the file are taken from what was
actually given to CPP. There is an arbitrary limit to the inclusion
nesting, which is actually not a design limitation but a security
to avoid infinite include loops.
2012-07-14 20:22:20 +02:00
Christophe CURIS
ed9482b626 Remove dependency to CPP: new parser that handles comments
Wrote a new parsing code that is able to skip over comments.
Note that because CPP is still active, you will not see any
effect unless you disable CPP pre-processing.
2012-07-14 20:22:20 +02:00
Christophe CURIS
7d74648fc3 Remove dependency to CPP: add function to report problems while parsing
The default function used so far provides informations not so useful
to user, like wmaker's source file, line number and function; it
also cannot provide the line number from the parsed file because cpp
messes this information.

With this dedicated function we try to provide useful things which
are being tracked by the parser internally, like valid line number
and the name of the file being read (which can be convenient in the
case of #include, for which we may also be able to provide the
inclusion tree!)
2012-07-14 20:22:20 +02:00
Christophe CURIS
42cccb2313 Remove dependency to CPP: merged 'getLine' and 'separateline' into a single function call
From caller point of view, the two function have been merged into a
single function in the API. This will be needed by the advanced
parser that will have to not separate the concept of a 'line' and
the concept of 'content' (due to empty/comment lines, multi-line
comments, long lines split with '\')
2012-07-14 20:22:20 +02:00
Christophe CURIS
19f0998cd1 Remove dependency to CPP: create structure to keep info of file being parsed
All the information related to the file being parsed are stored in
a single place. The content of this structure is not visible to
caller to avoid messing the content; the parsing will be handled as
methods to this object.

Please note that all functions visible as part of the parser's API
are using the CamelCaseNotation to be consistent with the rest of
the API; however all internal functions use the non_camel_case_syntax
to follow the coding style set by Carlos for the project.
2012-07-14 20:22:20 +02:00
Christophe CURIS
f0e8b76c03 Remove dependency to CPP: Moving parser functions to a dedicated file
Due to the tasks to take in charge, the internal parser will grow in
size to support basic CPP feature, so it is a good idea to start by
moving the current functions into a dedicated file.
2012-07-14 20:22:20 +02:00
Rodolfo García Peñas (kix)
39fa6d9e2c Remove dup code from getWindowMakerIconImage()
The code to find the icon in the function getWindowMakerIconImage()
is duplicated, because it is the same code as in get_default_icon_filename()

This patch includes the prototypes of get_default_icon_filename()
and get_default_icon_rimage() in defaults.h, so these functions
can be used in other files.
2012-07-04 21:20:18 +02:00
Rodolfo García Peñas (kix)
76e8a8f963 wDefaultGetImage splitted
The function wDefaultGetImage() is splitted in two:

1. get_default_icon_filename(): This function returns the full
   path of an icon. The function searches the icon in the database
   using instance and class.
2. get_default_icon_rimage(): This function returns the RImage for
   a given image path (full path). This function validates the icon
   size, so the icon is fully usable.

The function get_default_icon_filename() now adds the .app icons in the
search (using wApplicationExtractDirPackIcon()). To do it, the command
should be included, because this function searches '"command".app' icons.
Setting the command to NULL, this case is not used.

To do it we need the function wApplicationExtractDirPackIcon() defined
at appicon.c, so we need set the function as non-static and provide their
prototype in appicon.h.

This patch also includes an extra pointer check at wDefaultGetStartWorkspace
to make sure that WDWindowAttributes exists.
2012-07-04 21:13:54 +02:00
Rodolfo García Peñas (kix)
f5d845cfad Remove unused argument from wDefaultFillAttributes()
The function wDefaultFillAttributes() doesn't use the argument WScreen,
so it can be removed.
2012-07-04 20:45:56 +02:00
Rodolfo García Peñas (kix)
d6db53af0b Remove unused argument from wDefaultGetIconFile()
The function wDefaultGetIconFile() doesn't use the argument WScreen,
so it can be removed.
2012-07-04 20:44:40 +02:00
Rodolfo García Peñas (kix)
fd07a6bb36 Remove unused argument from init_wdefaults()
The function init_wdefaults() doesn't use the argument WScreen,
so it can be removed.
2012-07-04 20:42:40 +02:00
Iain Patterson
347d6f9fda Support _NET_FRAME_EXTENTS.
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."
2012-07-04 20:38:51 +02:00
Iain Patterson
81eefca4ef More (un)maximize tweaks.
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"
2012-06-26 16:56:20 +01:00
Rodolfo García Peñas (kix)
8edb9dad81 Remove unused stuff from session.h
The struct WSessionData is not used and the function wSessionGetStateFor
is only defined, remove them.
2012-06-26 10:49:05 +01:00
Rodolfo García Peñas (kix)
46183e8215 window.h: Remove unused variables from WWindow struct
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.
2012-06-26 10:49:05 +01:00
Rodolfo García Peñas (kix)
c978b3fc2b Variables user_changed_* can be removed
The variables user_changed_ are set but their values are not checked/used
in the code, so they can be removed.
2012-06-26 10:49:05 +01:00
Rodolfo García Peñas (kix)
a13eb4e920 Remove never-set variable net_state_from_client
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
2012-06-26 10:38:53 +01:00
Rodolfo García Peñas (kix)
dd94b98b81 Remove unused variable wm_name_changed
wm_name_changed is not used and can be removed.
2012-06-25 23:56:59 +01:00
Rodolfo García Peñas (kix)
c815449e68 Remove unused wWindowCanReceiveFocus()
The function wWindowCanReceiveFocus() is not used, remove it.
2012-06-25 23:53:32 +01:00
Rodolfo García Peñas (kix)
fc9e453de2 Remove unused variables from WSessionData struct
The variables user_changed_width and user_changed_height are not used,
so they can be safely removed.
2012-06-25 23:50:59 +01:00
Rodolfo García Peñas (kix)
02feb72fdc New colormap header file and remove unused functions
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.
2012-06-25 23:49:10 +01:00
Rodolfo García Peñas (kix)
42cb1291e3 New move_window function 2012-06-25 23:43:39 +01:00
Rodolfo García Peñas (kix)
7facc79c0c Add helper functions for appicon list management
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.
2012-06-25 23:35:50 +01:00
Carlos R. Mafra
5795bb5638 wmaker.inst: Remove test for LITE and KDE message
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.
2012-06-24 23:07:39 +01:00
Rodolfo García Peñas (kix)
6bdc1318c1 Moving header functions to main.h
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.
2012-06-24 12:32:36 +01:00
Rodolfo García Peñas (kix)
ebbc5c48ba XKeycodeToKeysym deprecated function
The function XKeycodeToKeysym is deprecated and should be replaced
by XkbKeycodeToKeysym.
2012-06-24 12:30:51 +01:00
Rodolfo García Peñas (kix)
da4e4128b3 rootmenu header file updated
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.
2012-06-24 12:30:17 +01:00
Carlos R. Mafra
254c00ba6f Address 'may be used uninitialized' warnings
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.
2012-06-23 17:32:42 +01:00
Rodolfo García Peñas (kix)
a5eb4910e4 Remove code duplication in winmenu.c
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.
2012-06-23 14:39:20 +01:00
Carlos R. Mafra
b6ced4fa5d Address unprototyped call in dock.c
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
2012-06-23 12:09:41 +01:00
Rodolfo García Peñas (kix)
0e671d3683 icon.c code cleanup 2012-06-23 11:26:33 +01:00
Rodolfo García Peñas (kix)
6110610f5e Cleanup superfluous.c a bit
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)
2012-06-23 11:25:37 +01:00
Iain Patterson
cd7edbcc11 Correct window shading logic.
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.
2012-06-22 17:26:02 +01:00
Carlos R. Mafra
f97b997f38 Skip no_appicon apps in the application icon list
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>
2012-06-21 20:36:05 +01:00
Carlos R. Mafra
a1e80f5411 Unify save_appicon() and wAppIconSave()
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>
2012-06-21 20:34:22 +01:00
Carlos R. Mafra
4700e5f0b2 Make create_appicon_from_dock() do only what its name implies
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>
2012-06-21 20:32:31 +01:00
Alexey I. Froloff
2be53e92e6 WMPopFromArray(): avoid underflow
Signed-off-by: Alexey I. Froloff <raorn@raorn.name>
2012-06-20 14:02:39 +01:00
Rodolfo García Peñas (kix)
96800cdc16 app_icon_create_from_docks renamed to create_appicon_from_dock
The function app_icon_create_from_docks is renamed to create_appicon_from_dock
because the name reads better.
2012-06-19 00:12:40 +01:00
Alexey I. Froloff
d53b43608a wmmenugen: properly skip NoDispaly entries
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>
2012-06-18 23:34:46 +01:00
Rodolfo García Peñas (kix)
def62293e9 New debian version 0.95.3-2
* Hardening
* Upload allowed for maintainers
2012-06-18 23:26:39 +01:00
Rodolfo García Peñas (kix)
089c99941f Icon painting moved to makeAppIconFor()
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()
2012-06-18 23:25:34 +01:00
Rodolfo García Peñas (kix)
ee450acb30 Change a small comment in icon.c
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.
2012-06-18 23:22:22 +01:00
Rodolfo García Peñas (kix)
50765fab84 GetProgramNameForWindow removed
The function GetProgramNameForWindow is no longer used, so it can be removed.
2012-06-18 23:21:07 +01:00