Commit Graph
2204 Commits
Author SHA1 Message Date
Tobias StoeckmannandCarlos R. Mafra 6bc550d91b Remove curly brackets
...as they were completely wrapped up by another pair of curly brackets.
2012-05-07 20:42:34 -03:00
Tobias StoeckmannandCarlos R. Mafra cbff60297e Easier code path in appIconMouseDown 2012-05-07 20:41:18 -03:00
Tobias StoeckmannandCarlos R. Mafra 971f611bad wstrdup cannot fail, therefore no need to check for NULL. 2012-05-07 20:40:14 -03:00
Tobias StoeckmannandCarlos R. Mafra 70d8ad515b Easier error path in wDockTrackWindowLaunch.
There is no need to allocate command if the very next line might
fail independently from comand, freeing that memory again in error path.
2012-05-07 20:37:48 -03:00
Tobias StoeckmannandCarlos R. Mafra b5df97db95 Removed unused "buffer" variables. 2012-05-07 20:36:58 -03:00
Tobias StoeckmannandCarlos R. Mafra 72546aab81 Get rid of NEW definition.
The NEW definition merely calls wmalloc now, therefore it is not needed
anymore.  Pointed out and requested by Carlos R. Mafra.
2012-05-07 20:36:10 -03:00
Tobias StoeckmannandCarlos R. Mafra cc30444dda No need to call memset after wmalloc
memset is the last function call in wmalloc, just before it returns the
newly allocated memory.  Therefore it is not needed to call it again
after wmalloc call.  Although I would prefer to switch wmalloc to a
calloc-based wcalloc function, the compatibility of WINGs for old apps
should be kept.
2012-05-04 18:41:01 -03:00
Iain PattersonandCarlos R. Mafra aee0ad45f2 More intuitive maximization handling.
Avoid some pitfalls with window maximization and make it behave more
intuitively.  We now treat a window's vertical and horizontal
maximization as separate properties and only remember its original
geometry in a particular direction when it actually changes.  We also
deliberately do not remember a window's geometry when it changes from
one maximized state to another.  As a result windows can be more
reliably restored to their original size.

For example the "Maximize active window" hotkey followed by the
"Maximize active window vertically" hotkey will now result in the window
being maximized horizontally only, whereas previously the second hotkey
would have no effect because the window was already maximized
vertically.  In addition selecting the Unmaximize window menu in the
same example will now result in the window being restored to its
original size.  Previously the unmaximize attempt would have no effect
because the vertical maximization would have remembered the window's
"original" geometry when it was fully maximized.

Maximus is handled separately.  The "Maximus" hotkey will now toggle
Maximus mode regardless of the window's current maximization state.  For
example if two unmaximized windows are on screen and one is Maximusized
it will fill the space left by the second window, as before.  But if the
first window is maximized and the "Maximus" hotkey is pressed the window
will now fill the same space as if it were Maximusized from its original
size.  Previously the window would not change size from its fully
maximized state because the Maximus algorithm would consider
fully-maximized to be a valid Maximus size.
2012-05-04 18:39:21 -03:00
Tobias StoeckmannandCarlos R. Mafra e6e3e1aa49 Avoid memory leak on error path in constructMenu. 2012-05-04 18:39:21 -03:00
Tobias StoeckmannandCarlos R. Mafra 753f44c4b7 Fixed memory leak in wHideAll. 2012-05-04 18:39:21 -03:00
Tobias StoeckmannandCarlos R. Mafra 2755b1e45d Use proper (w)free functions for (w)malloced data. 2012-05-04 18:39:21 -03:00
Tobias StoeckmannandCarlos R. Mafra 975d4becf1 Fixed some typos. 2012-05-04 18:39:21 -03:00
Carlos R. Mafra 95c68d2b10 Scare people away from --enable-xrandr
Xrandr support is currently very primitive and stupid, but people
do not seem to be aware of its problems and still enable it in distros.

Try to scare them to not do that.
2012-04-30 15:07:02 -03:00
Tobias StoeckmannandCarlos R. Mafra 1bcfb89cd1 Adjust OpenBSD-specific code to match OpenBSD-current
Also fix null pointer dereference by NOT calling strlen on a possible
null pointer.
2012-04-30 14:50:17 -03:00
Tobias StoeckmannandCarlos R. Mafra e83eeb15cc Include assert.h to avoid linker issues if -DDEBUG was not supplied. 2012-04-30 14:48:20 -03:00
Tobias StoeckmannandCarlos R. Mafra f25464c792 Avoid GNUism in Makefiles for *BSD support
Variable abs_srcdir will always point to proper source location.
With this patch, there is no need to call gmake on OpenBSD anymore.
2012-04-30 14:46:54 -03:00
Carlos R. Mafra 8311058a16 Revert "Inotify: Reload keyboard shortcut definitions when configuration changes"
This reverts commit cbe2f4e61a.

The reason for the revert is the regression reported here:
http://marc.info/?l=openbsd-ports&m=133151145814675&w=2

  I've been able to reliably reproduce the double-spawning of
  xterms I've been seeing. The bad news is that it still happens
  even with a fresh configuration directory.

  To reproduce:
  0) Create a keyboard shortcut if one does not already exist (I'm
  using <ctrl>+u set to spawn an xterm)
  1) Open WindowMaker's preferences.
  2) Click on "Applications Menu Definition" (it's the icon
  immediately to the left of the keyboard icon)
  3) Click save, and then close.
  4) Keyboard shortcuts will spawn two applications.

  I use keyboard shortcuts to spawn xterms, browsers, and filemanagers.
  All of them spawn twice after performing the above.  To fix it,
  <F12> or <right-click> -> Exit -> Restart.

  If I repeat steps 1-3, three windows will spawn.  Repeat again and
  four windows will spawn etc.  (I stopped after getting five to
  spawn at once).
2012-04-30 14:36:43 -03:00
Carlos R. Mafra 4e2ee27bfa Fix wrong wfree() use
There is a bug which happens when one modifies the "Initial Workspace" in the
"Attributes..." menu. Upon saving the change wmaker segfaults.

Commit ad373ef0dd ("WindowMaker: New function wGetWorkspaceNumber")
used wfree() in variables which were not wmalloc'ed. Fix this.
2012-04-26 11:11:32 -03:00
Christophe CURISandCarlos R. Mafra 39fdb451ba Fixed wrong structure declaration
The declaration of the structure actually also created an unused variable. This
variable was not used anywhere, and lead to symbol defined in multiple objects.
These symbol are silently merged by GCC, thus no problem was reported.

The issue was raised by Yves de Champlain when trying to compile with LLVM/clang
which is a bit stricter there.
2012-04-21 09:33:27 -03:00
Rodolfo García Peñas (kix)andCarlos R. Mafra 244b63e6b5 WindowMaker: New get_texture_image function
The new function get_texture_image includes the common code of
wTextureMakePixmap() and wTextureMakeTGradient()
2012-04-20 20:36:07 -03:00
Rodolfo García Peñas (kix)andCarlos R. Mafra 1b0ed30b9b WindowMaker: Header files clean code
Changes:
  - Spaces replaced by tabs in the structs
  - Removed unused variables:
    - has_titlebar, never used
  - Functions sort by return type
2012-04-16 09:33:39 -03:00
Rodolfo García Peñas (kix)andCarlos R. Mafra 0db76b822d wIconStore(): do not save the icon if it exists
The function wIconStore() doesn't write a new file overwriting the
previous icon if the icon file exists.
2012-04-16 09:32:24 -03:00
Rodolfo García Peñas (kix)andCarlos R. Mafra 21fb6db616 WindowMaker: New function wIconCreateCore()
The new function wIconCreateCore do the common work to create a WIcon.

This code was before in wIconCreateWithIconFile() and wIconCreateWithIconFile().
2012-04-15 23:15:47 -03:00
Rodolfo García Peñas (kix)andCarlos R. Mafra 219315aa58 WindowMaker: Check iconPath variable only if needed
The variable iconPath should only checked inside the if block,
because outside is never initialized.
2012-04-15 23:15:47 -03:00
Rodolfo García Peñas (kix)andCarlos R. Mafra ad373ef0dd WindowMaker: New function wGetWorkspaceNumber
The new function wGetWorkspaceNumber returns the workspace number
for a given workspace name.

The code of this function is already used in session.c and wdefaults.c
and now is moved to workspace.c

In wSessionRestoreLastWorkspace the char value is checked before
calling the function, because without string, the function don't do
nothing.
2012-04-15 23:15:20 -03:00
Rodolfo García Peñas (kix)andCarlos R. Mafra 761fd37e51 WindowMaker: Clean curly brackets
This patch removes the unneeded curly brackets in multiple files.

It also add some comments in the code. In usermenu.c removes some
variables not used.
2012-04-15 23:15:20 -03:00
Rodolfo García Peñas (kix)andCarlos R. Mafra afe2e5d9d6 WindowMaker: appicon.h clean code
Changes to appicon.h:

- Spaces replaced by tabs in the struct
- Removed unused variables:
  - client_machine, never assigned
  - gnustep_app, never used
- Functions sort by return type

Then, in dock.c, the block with client_machine is never true,
then can be removed. The host variable then is never used.
2012-04-15 23:15:20 -03:00
Iain PattersonandCarlos R. Mafra b3afad67ff Use noreturn attribute in Exit() declaration.
Use the gcc-specific noreturn attribute to advise the compiler that
Exit() doesn't return.  This is safe because we already use preprocessor
rules to hide __attribute__ from other compilers.

Suggested independently by Christophe Curis and Brad Jorsch.
2012-04-11 23:56:31 +01:00
Iain PattersonandCarlos R. Mafra bca60318ca Compiler diet.
Don't feed the compiler.  RelaunchWindow() is declared to return Bool so
Bool it shall proudly return.
2012-04-11 23:55:58 +01:00
Iain PattersonandCarlos R. Mafra 0601e0f002 Style consistency.
Approved style is not to write a single-operation for loop in a single line.
2012-04-11 23:55:47 +01:00
Rodolfo García Peñas (kix)andCarlos R. Mafra 391a8edb9c Turn wApplication{Activate,Deactivate} into real functions
The functions wApplicationActivate and wApplicationDeactivate are now defined
as functions, not as preprocessor functions.
2012-04-05 12:26:25 +01:00
Rodolfo García Peñas (kix)andCarlos R. Mafra 517cd6a8be Remove unused functions
These functions are not used:

- wDefaultsDestroyDomain
- PropWriteGNUstepWMAttr
- wSessionSendSaveYourSelf
- wXDNDClearAwareness
- clearWaitingAckState
- wSessionSaveClients
2012-04-04 19:44:40 +01:00
Iain PattersonandCarlos R. Mafra ba786015b7 Describe relaunching in the NEWS file. 2012-04-04 14:07:42 +01:00
Iain PattersonandCarlos R. Mafra aaf934eb2f Compiler food.
main.c: In function ‘RelaunchWindow’:
main.c:461:1: warning: control reaches end of non-void function
[-Wreturn-type]

Actually we can't reach the end of the function because the three
possible cases are Exit(-1), return False and return True.  Of course if
Exit() were ever changed the above statement might become incorrect.
Some compiler food silences the warning.
2012-04-04 13:02:58 +01:00
Iain PattersonandCarlos R. Mafra 056a290a7d Also relaunch from appicon with Ctrl + DblClick.
Zoltan Balaton points out that Control + Doubleclick on docked app will
launch a new instance.  For consistency with that behaviour we now allow
Control + Doubleclick on an undocked appicon to invoke the new
relaunching functionality.

We also now restrict doubleclick handling to the left mouse button in
order to avoid relaunching the application twice when the middle button
is used.
2012-04-04 12:15:20 +01:00
Iain PattersonandCarlos R. Mafra 51c9f2a852 Also allow relaunching from appicon.
Allow relaunching an application with a middle mouse click to its
appicon or the Launch option of its appicon menu.
2012-04-04 12:15:09 +01:00
Iain PattersonandCarlos R. Mafra 3d01e5c879 Also allow relaunching from the window menu.
Allow relaunching an application from its window menu.
2012-04-04 12:14:46 +01:00
Iain PattersonandCarlos R. Mafra 8352c9ef60 Allow relaunch with shortcut key.
Use the WindowRelaunchKey shortcut to examine the WM_COMMAND property of
the active application's main window and launch a new instance of the
application using the retrieved command line.
2012-04-04 12:12:12 +01:00
Rodolfo García Peñas (kix)andCarlos R. Mafra 528d97b597 canReceiveFocus() should check no_focusable first
The function canReceiveFocus should check if the window is no_focusable first.

If the window is not focusable but is miniaturized, the window is shown in the
switchpanel.

How to reproduce the problem:

- Open an application
- Open the window properties, advanced options
- Set that the application can not get the focus and save
- Test the switchpanel (Alt+Tab) the window doesn't appear
- Minimize the window
- Test the switchpanel (Alt+Tab), the window appears
- If the window is selected (restored), and test again the switchpanel, the window doesn't appear!
2012-04-04 11:49:23 +01:00
Christoph SoehngenandCarlos R. Mafra 42a78ee73f wmgenmenu: Add more apps to our nice menu 2012-04-02 17:52:14 +01:00
Rodolfo García Peñas (kix)andCarlos R. Mafra aab9028fc2 Coding-style cleanup
Code style cleanup in multiple files. Tabs, spaces, curly brackets,...
2012-03-30 19:50:10 +01:00
Rodolfo García Peñas (kix)andCarlos R. Mafra 1a0e665e58 WindowMaker: icon.c comments added
Some comments added to icon.c file.
2012-03-16 09:04:03 +00:00
Rodolfo García Peñas (kix)andCarlos R. Mafra 1bec2efba0 WindowMaker: icon.c goto removed
The goto "make_icons" in icon.c was removed.
2012-03-16 09:03:11 +00:00
Rodolfo García Peñas (kix)andCarlos R. Mafra 72f359be44 WindowMaker: New function get_pixmap_icon_from_user_icon
The new function get_pixmap_icon_from_user_icon() splits the
function wIconUpdate().
2012-03-16 08:59:45 +00:00
Rodolfo García Peñas (kix)andCarlos R. Mafra cf9f0ec67e WindowMaker: New function get_pixmap_icon_from_wm_hints
The new function get_pixmap_icon_from_wm_hints() splits the
function wIconUpdate().
2012-03-16 08:57:35 +00:00
Rodolfo García Peñas (kix)andCarlos R. Mafra 3adc058421 WindowMaker: New function get_pixmap_icon_from_icon_win
The new function get_pixmap_icon_from_icon_win() splits the
function wIconUpdate().
2012-03-16 08:55:50 +00:00
Takeo HashimotoandCarlos R. Mafra ebe9a27e8d Japanese translation updated 2012-03-11 02:41:53 +01:00
Rodolfo García Peñas (kix)andCarlos R. Mafra 6cbdebb84b WindowMaker: New get_wwindow_image_from_x11 function
A new function is created to get the image from the X11 window.

The function updateIconImage is splitted in two blocks, one is moved
to get_wwindow_image_from_x11 with the X11 code, and other is used
to update the Application and Window icons (kept in the same function).
2012-03-08 23:31:32 +01:00
Rodolfo García Peñas (kix)andCarlos R. Mafra 9079b904d6 Little simplification in makeIcon() 2012-03-08 23:19:05 +01:00
Rodolfo García Peñas (kix)andCarlos R. Mafra f550333474 Coding style cleanup in wmspec.c
This commit cleans the source a bit and adds some comments.
2012-03-08 23:18:55 +01:00