1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-24 15:12:32 +01:00
Commit Graph

1646 Commits

Author SHA1 Message Date
Tim Taenny
c803218ed1 New functions for the creation of scaled panels (WMCreateScaled*Panel)
To prevent breaking applications depending on the static layout
behavior of the WMCreateAlertPanel and WMCreateInputPanel functions
in WINGs, the scaling functionality has been moved to the new
functions WMCreateScaledAlertPanel and WMCreateScaledInputPanel.

The system dialogs (wMessageDialog, wExitDialog, etc.) now use the
new functions, thus keeping the improved layout introduced in the
previous patches.
2019-06-19 18:06:53 +01:00
Tim Taenny
b48b503eb1 Improved layout of the Info Panel
Instead of relying on static pixel values for position and size of
the widgets, the info panel now scales its widgets based on the
selected system font size.
2019-06-12 23:42:27 +01:00
Tim Taenny
1c8b680e3d Improved layout of the Legal Panel
Instead of relying on static pixel values for position and size of
the widgets, the legal panel now scales its widgets based on the
selected system font size.
2019-06-12 23:42:27 +01:00
Tim Taenny
5eeaf6b890 Improved layout of the Icon Chooser Panel
Instead of relying on static pixel values for position and size of
the widgets, the icon chooser panel now scales its widgets based
on the selected system font size.
2019-06-12 23:42:27 +01:00
Tim Taenny
f9236c8d20 Improved layout of the Input Panels
Instead of relying on static pixel values for position and size of
the widgets, the input panels now scale their widgets based on the
selected system font size.
2019-06-12 23:42:27 +01:00
Tim Taenny
26bb94a8e7 Improved layout of the Alert Panels
Instead of relying on static pixel values for position and size of
the widgets, the alert panels now scale their widgets based on the
selected system font size.
2019-06-12 23:42:27 +01:00
Tim Taenny
b185d46286 Added ScaleX and ScaleY macros to WINGs
To reduce code duplication the ScaleX and ScaleY macros have been
moved to WUtil.h. Along with the function WMGetScaleBaseFromSystemFont
these macros can be used in all panels to scale the widgets based on
the current system font size instead of giving fixed pixel sizes which
messes up the panels if a larger system font is selected in WPrefs.

Use the macros in the following way:

    instead of   WMResizeWidget(widget, 128, 64);
                 WMMoveWidget(widget, 32, 32);

    use          int fw, fh;
                 WMGetScaleBaseFromSystemFont(scr->wmscreen, &fw, &fh);
                 WMResizeWidget(widget, ScaleX(128), ScaleY(64));
                 WMMoveWidget(widget, ScaleX(32), ScaleY(32));
2019-06-12 23:42:27 +01:00
Tim Taenny
8f29bdc690 Improved layout of the widgets in the DockAppSettingsPanel
Instead of relying on static pixel values for position and size of
the widgets, the DockAppSettingsPanel now scales its widgets based
on the selected system font size.
2019-06-12 23:42:27 +01:00
Christophe CURIS
2913ac0f09 Do not allocate memory for a temporary buffer
This kind of things participates in memory fragmentation, so it is
generally a bad practice when an on-stack allocation is enough.
Took opportunity to reduce the buffer size, there's no point in
overallocating memory (the new size being still way too much).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2019-02-22 16:08:36 +00:00
Tim Taenny
2427200c3e Added feature: automatic scaling of application icons
If the option "Enforce icon margin" is selected, application window
icons will be selected or scaled so that they only use 75% of the
available icon_size.
Even if the feature is not enabled, this change will scale down
large application icons to icon_size, so that icons can be used
that were rejected by the previous implementation of findBestIcon.
(Example: The Qt Creator icon never showed before, because it is
only provided in 128x128 resolution. Now it's visible.)
2019-01-31 17:22:49 +00:00
Tim Taenny
d6c1ac3ecf Added icon feature option to WPrefs: Enforce icon margin
The current findBestIcon function usually selects an icon image
that almost completely fills up the (default) 64x64 pixels of an
icon. As Dan noted in the function, the icon images should use only
75% of the available space, which would result in room for the
miniwindow title and better overall aesthetics.

This feature option provides for enabling such an automatic "icon
shrinking" functionality.

Note: This commit only introduces the new option, not the actual
      image shrinking.
2019-01-31 17:22:49 +00:00
Tim Taenny
2beb5f2c52 Fixed icon loading during Attribute Inspector startup
When opening the "Icon and Initial Workspace" panel of the Attribute
Inspector, the Miniwindow Image and the corresponding text field were
always empty, even if an icon had been selected, applied and saved
before. The file name was not loaded from the database on startup
of the inspector window.

With this change, the icon and the text field are properly set on
startup of the inspector window.
2019-01-30 23:43:23 +00:00
Gaspar Chilingarov
8b919b0d33 support moving window between heads using keyboard
Window Maker allows to perform practically all operations with windows
using only keyboard. One of the actions so far which required using
mouse was dragging window from one head (monitor) to another.

This patch introduces support for keyboard shortcuts. These shortcuts
move windows in circular fashion (if you have 3 and more monitors).

In case of 2 or 3 monitors arranged horizontally - window will just move
right/left.

In case of 3x3 setup - it is impossible to move window to central
monitor with keyboard.

- preserves window position and size (if display sizes are same)
- otherwise tries to fit window to smaller display
2018-12-16 10:13:50 +00:00
Gaspar Chilingarov
6668715402 Detect and override illegal window size hints
The problem - when VirtualBox starts virtual machine, window has very
small height (couple of pixels) and it requires some manual fiddling
to resize it to something usable.

See related bugs here:

https://www.virtualbox.org/ticket/14718#comment:19 - small horizontal
line in the middle of the screen is newly opened virtual machine's
window.

https://www.virtualbox.org/ticket/15863

Inspecting with xdebug and xprop reveals that VirtualBox sends wrong hints:

Request(12): ConfigureWindow window=0x0660000a values={x=27 y=559
width=720 height=65512}

Which is interpreted by X server wrongly and shown with xprop as

WM_NORMAL_HINTS(WM_SIZE_HINTS)
:
                user specified location: 27, 559
                user specified size: 720 by -24
                program specified minimum size: 254 by 109
                window gravity: Static

Some part of X11 interprets such large value as signed int and wraps
it to negative value.

The solution will be if program requests such big window - detect it,
ignore requested size and resize it to some reasonable defaults.

Disclaimer - I tested it only on Ubuntu 16.04, but should apply to
another systems as well - see bug reports.
2018-05-21 13:02:22 +01:00
Bad Sector
c89ec25c80 Fixes missing appicons after restarting Window Maker
Fixes the bug where if the icon image is accidentally set to
nothing or the image file is deleted, the appicon keeps losing
its icon (it resets to the default cube icon) when Window Maker
exits/restarts (depending on how the user cleared the icon this
may persist even after redocking the application if information
about the application window is still in the WM).  One way to
easily see this bug is to open the main window's attributes and
press the Save button (no need to do anything else) as this
clears the icon file (this is a separate bug that needs to be
fixed but it is more of a minor UI bug since clearing the image
should simply reset the icon to the application provided one if
the Ignore client supplied icon is not set).  Another way to
see it is to open the properties box in a docked application
that is not running and clear the image field.  After either of
these two actions are performed, restart Window Maker and see
that the icons are missing.

This patch fixes the above bug by calling save_appicon when the
appicon object is created and the application provided icon is
already available (window maker actually tries to save the icon
at an earlier stage but this is done as a side effect of
"painting" the dock icon - which also saves the icon - but this
is done too early, before ownership information is available).

Note that this bug seems to be a regression introduced from
commit 9c4b19d8aa (or one of the
related commits around the same time, they seem to be a bit too
aggressive in not saving icons).  This patch addresses the
concern in that commit about only saving the icon for docked
applications.
2018-04-18 10:09:38 +01:00
Bad Sector
569fbff07c wmaker: Add new advanced option to ignore decoration changes from clients.
This adds an option (IgnoreDecorationChanges in plist) for windows to
ignore any requests from the clients for changing decorations. Since the
default state for any window pre-request is to have all decorations visible
this basically means that applications cannot hide any of the titlebar,
sizing bar, titlebar buttons, etc and any hint that causes these elements
to be hidden will be followed by a restoration if this option is set.

 This is useful for broken clients (e.g. Steam) and clients that force
subpar client side decorations. It is basically a per-window setting of the
global advanced option to ignore Gtk hints, except that it also applies to
non-Gtk applications.
2018-02-14 08:16:55 +00:00
Alwin
bfd88e07e6 wmaker: Adding copyright year 2017
The Info Panel didn't show the current year.
2017-09-14 21:08:26 +02:00
Doug Torrance
5f2dac318c menu: New macro #usergnusteppath# for user GNUstep directory
This macro is used when handling directories with OPEN_MENU, e.g., to list
available image files for setting the workspace background.

When parsing a menu file, we replace any instances of #usergnusteppath#
with either GNUSTEP_USER_ROOT or ~/GNUstep if the former is not set.  In
this way, authors of menu files do not have to worry about whether users
will have this variable set or not.

We also document this feature in WindowMaker/menu.in, which generates the
default English language old-style menu and currently contains the existing
documentation for the Window Maker menu system.
2017-08-19 11:14:38 +01:00
Doug Torrance
b07075aed3 wmaker: Allow WMRootMenu to reference menu files in proplist format.
Previously, WMRootMenu could either be a menu file in proplist format
itself, or it could reference another menu file in the old style format.

If WMRootMenu referenced another menu file in proplist format, this file
was parsed assuming it was in the old style format and thus failed, as
observed by Andreas Metzler [1].

In this patch, we first attempt to parse a referenced menu file as if
it were in proplist format.  If this fails, then we fall back on the old
style format.  This has the disadvantage of spamming the terminal with
various parsing errors if the menu file is in the old style format.

[1] https://www.mail-archive.com/wmaker-dev@lists.windowmaker.org/msg07097.html
2017-08-13 10:34:46 +01:00
Doug Torrance
3140c09240 wmaker: Consistent configuration options.
The default configuration options are given in two places in the source
code:
  - src/default.c
  - WindowMaker/Defaults/WindowMaker.in

The defaults are initially set in the former, but are then overwritten by
the latter.

Ideally, the default options in these two locations should coincide.
However, there are currently several issues.
- Many of the options are missing from WindowMaker/Defaults/WindowMaker.in
- Many of the options have conflicting defaults between the two locations.
- A number of options given in WindowMaker/Defaults/WindowMaker.in no longer
  exist.

In this patch, we bring the defaults in the two locations in line with one
another.  We have given preference to the defaults in W/D/WindowMaker, as
these are the one users have been used to.

Some of the paths in IconPath and PixmapPath have been removed.  In
particular, the various system pixmap paths (/usr/include/X11/pixmaps,
/usr/share/pixmaps, and /usr/local/share/pixmaps) have been removed in
favor of PIXMAPDIR, which is specified by the user at build.  Also,
/usr/share/icons has been removed from IconPath.  The root of this
directory will contain very few icons, as the icons themselves are located
in subdirectories corresponding to XDG icon themes.

We add a comment to src/defaults.c to remind future developers who
add or remove options to change the default values in both locations.

We also take the opportunity to remove the unused DEF_INFO_TEXT_FONT
macro.
2017-03-22 09:26:24 +00:00
Doug Torrance
fa8121ee61 wmaker/WPrefs: Remove legacy support for deprecated apercus.
Replaced by minipreviews in December 2014.  Over two years have passed.
2017-03-12 00:12:18 +00:00
Doug Torrance
6fa1c0c009 configure: Add option to specify global defaults directory.
Previously, this was only (partially) possible by redefining the macro
GLOBAL_DEFAULTS_SUBDIR.  This told Window Maker to look for the global
config files in a particular subdirectory of SYSCONFDIR.

However:
* This is undocumented.
* GLOBAL_DEFAULTS_SUBDIR is ignored when installing the config files.  They
  are always installed to SYSCONFDIR/WindowMaker.

To solve these issues, we add a "--with-defsdatadir" option to configure
which allows a user to specify the global defaults directory.
2017-03-10 10:20:58 +00:00
Cyrus Rahman
c052addd1d wmaker: Do not place icons under the dock
While I love the new maximizing functions, in the process of
developing them the code to keep icons from under the dock was lost.

I have created a patch to prevent this problem.
2017-03-06 15:19:55 +00:00
6e4698fe11 Fixed couple of compilator warning and removed unused macros. 2017-02-25 10:19:52 +00:00
f3fdf0b8dd Refactoring handleMaximize() function
Simplify handleMaximize function for "not effective" case, where there
was couple of duplicate code, now there is one indentation level less
and readability increased.
2017-02-21 19:24:36 +00:00
9328ba5b3c Implementation for moving mouse pointer within the maximized window.
Mouse pointer can be now moved together with window if keyboard was used
for arrange maximized windows on screen. This feature can be turned on
in WPrefs.app in Expert tab by selecting "Move mouse pointer with half
MAXIMIZED windows.", or setting "PointerWithHalfMaxWindows" to "Yes" on
~/GNUstep/Defaults/WindowMaker file.
2017-02-21 19:24:36 +00:00
c9fbcda0b0 New option for moving mouse pointer along with half-maximized windows.
This option might be usable for using keyboard for moving windows
around. This option will enable moving mouse pointer for such windows.
2017-02-21 19:24:36 +00:00
eadb7f3ab2 Alternative way for traversing half-maximized windows.
Now it is possible for change a bit pattern for changing state between
half-maximized windows. Half maximized windows will become maximized if
there is issued half-maximizing shortcut in opposite direction. Issue
half-maximizing command on same direction on already maximized window,
will have no effect.
2017-02-21 19:24:35 +00:00
9e7987713f New option for enabling alternative half-maximized window movement.
Added new option to Window Maker for enabling alternative way for
half-maximized windows movement. Option can be found on Expert section
in WPrefs app.
2017-02-21 19:24:35 +00:00
62d62eebf1 Bugfix for moving windows between heads.
Previous bugfix introduced another regression. It fixed the issue with
size of the unmaximized window, but break new functionality. Revert back
code for maximizing using mouse, leaving out head detection for keyboard
actions, since it is already calculated.

Mouse actions for maximize also has to be fixed due to different
behaviour in original implementation - movement of the window which is
called in handleMaximize filter out MAX_KEYBOARD from argument passed to
the wMaximizeWindow, so that it will always assume that all the actions
have to be done on the head where mouse pointer resides. For moving
windows between heads feature, calculated head is always passed and
used, regardless of how maximizing was invoked (keyboard or mouse) and
mouse pointer position.
2017-02-21 19:24:35 +00:00
160f879cce Fixed wrong (re)stored dimensions for unmaximized window. 2017-02-13 20:01:53 +00:00
28da4c98e3 Added possibility for half-maximized windows to move across the screens.
Using MoveHalfMaximizedWindowsBetweenScreens option user can enable
ability for moving half-maximized windows not only within current
screen/head/display, but also to other heads, if they exists. Note, that
only vertically or horizontally maximized windows can be transfered to
another display. Quarter-maximized windows are not supported, since it
is ambiguous to predict in which direction such window should be moved.
2017-02-08 07:26:35 +00:00
17a47af160 Added option for ability to move half-maximized between heads.
Added new option to Window Maker preferences to enable half-maximized
windows movement on all available heads. Option can be found in WPrefs
app on Expert section.
2017-02-08 07:26:35 +00:00
014a315f3a Added wGetHeadRelativeToCurrentHead function
A new function for obtaining possible heads (displays) was added. It
allow to query for a head in four directions relative to the current
one.
2017-02-08 07:26:35 +00:00
e2f8525728 Added 'head' parameter to wMaximizeWindow
Additional 'head' parameter will help to select head (display) where
window should be maximized.
2017-02-08 07:26:35 +00:00
002d415d02 Trivial cleanup: Removed unused defines. 2017-02-04 13:06:13 +00:00
Bjørn Mork
5561199c87 wmaker: allow alt+tabbed windows over fullscreen
Fullscreen windows should only be on top when they are in focus. Change
the stacking level temporarily back to WMNormalLevel if the fullscreen
window loses focus due to an alt+tab operation.

Change the stacking level back to WMFullscreenLevel if the fullscreen
window receives the focus again.

Cc: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2016-07-12 23:21:00 +01:00
Bjørn Mork
6429847494 wmaker: fix stacking order of dock and fullscreen
This reverts the commits:
 311ab6b08c ("Raise fullscreened window")
 a504370f3b ("Remove WMFullscreenLevel")

Removing WMFullscreenLevel had the side effect that a dock or panel
having the _NET_WM_WINDOW_TYPE_DOCK type would stack on top of
fullscreen windows, obscuring part of them.  This is unwanted. No
other window should cover a focused fullscreen window:.
https://specifications.freedesktop.org/wm-spec/latest/ar01s09.html#STACKINGORDER

Simply raising the fullscreen window to the top of the stack of normal
windows is not sufficient if there are windows with higher stacking
levels present.  The separate WMFullscreenLevel is needed.

Cc: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2016-07-12 23:21:00 +01:00
Doug Torrance
84727563f9 wmaker: Implement basic menu shading.
Menus may now be shaded like other windows by double clicking on their title
bars.  Note that, even if animations are enabled, the shade animation seen
with other windows does not work for menus.

This fixes Debian bug #72038 [1]:

  From: Chris Pimlott <pimlottc@null.net>
  Subject: wmaker: Persistant menus should be shade-able
  Date: Tue, 19 Sep 2000 14:04:41 -0400

  One of the many little things that makes me appreciate Window
  Maker is that by clicking on the title bar of a menu, it can be made
  "persistant" so it stays on screen and doesn't dissappear after click or
  mouseout like normal.  I find it useful if I need to run a number of
  commands in a submenu, or for keeping a list of open windows on
  screen.

  The usefulness of this feature could be extended by allowing menus
  to be shaded (by double-clicking the title) like normal windows, thus
  collapsing them to take up less space when not needed but still be
  persistant.  Perhaps other commands of windows (like maximizing/
  minimizing, resizing) might be considered as well, although
  personally only shading stands out as particularly useful for menus.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=72038
2016-01-21 08:52:36 -05:00
Doug Torrance
c7c0b43629 wmaker: Fix whitespace in menu.h; passes checkpatch.pl inspection. 2016-01-21 08:52:36 -05:00
Doug Torrance
ac33bb9d1b wmaker: Display keyboard shortcuts for remaining options in window menu.
In particular, Keep on top, Keep at bottom, and Omnipresent.
2016-01-20 08:27:07 -05:00
Doug Torrance
563cda28d3 wmaker: Add keyboard shortcuts for keeping window on top or at bottom.
This closes Debian bug #306808 [1].

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=306808
2016-01-20 08:27:07 -05:00
Doug Torrance
65802d3402 wmaker: Use window placement settings on other workspaces.
Previously, if a window was placed on a workspace other than the current one,
the window placement settings (given by WindowPlacement) were ignored and
the window was drawn in the upper left hand corner.  This is Debian
bug #181735, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=181735

Part of the bug report by Andrew Gorcester from the link above
is reproduced here:

"When placing a window in a non-active workspace (which usually happens
if the user asks for a program to be started when wmaker is launched,
and defines an initial workspace in the window's attributes dialog),
Windowmaker doesn't follow specified rules on window placement.

All windows of programs that don't manage their own window placement
(Gaim manages placement itself, for instance) are placed in the far
upper-left corner.  Usually windows originate from 64, 64, because the
clip occupies the upper-left corner by default."
2016-01-20 08:14:48 -05:00
Doug Torrance
9de5a27dbc wmaker: Add option for window snap to top edge to maximize to full screen.
This is a common behavior in a number of other environments, e.g., Unity
and Windows.
2016-01-17 22:54:49 -05:00
Doug Torrance
42e4069541 wmaker: Fix typos (used codespell). 2016-01-17 22:54:49 -05:00
Doug Torrance
e5632a9120 wmaker: Remove prototype for unused get_right_position_on_screen function. 2016-01-17 22:54:49 -05:00
Doug Torrance
c3ad2513a9 wmaker: Update copyright years in info panel. 2016-01-17 22:54:49 -05:00
Doug Torrance
2f33b3c2bc wmaker: Maintain sorting of windows by workspace in switch menu.
Previously, this sorting failed when one window was moved to another
workspace.

This fixes Debian bug #280851 [1].

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=280851
2016-01-16 01:13:20 -05:00
Doug Torrance
15ae70b159 wmaker: Print error dialog when attempting to delete an in-use workspace. 2015-10-02 07:14:53 -04:00
Satya Mishra
88393f4a6c wmaker: fixed infinite loop in switching within group 2015-10-01 17:06:40 -04:00