1
0
forked from vitrine/wmaker
Commit Graph

1766 Commits

Author SHA1 Message Date
cf87f7e83b Finish moving WApplication struct defn and methods into Rust. 2025-09-09 22:23:59 -04:00
4f4ef94400 Expose start_hidden and emulate_appicon attrs of WWindow. 2025-09-09 21:57:17 -04:00
023ab177b2 Expose WWindow attributes so they can be seen from Rust. 2025-09-09 21:56:30 -04:00
279f369256 Expose w_global.context so it can be seen from Rust. 2025-09-09 20:16:02 -04:00
0a2ff4f055 Expose various other WWindow fields so they can be seen from Rust.
Fields: client_win, screen_ptr, wm_hints, wm_class, wm_instance,
defined_user_flags.
2025-09-09 19:41:12 -04:00
108c913c1d Expose WWindow::user_flags so that it can be seen from Rust. 2025-09-09 19:36:36 -04:00
8c669d57b2 Expose WWindow::net_icon_image so that it can be seen from Rust. 2025-09-09 19:34:57 -04:00
83fa8119d9 Expose WWindow::main_windowc so that it can be seen from Rust. 2025-09-09 17:00:57 -04:00
507e69e209 Expose WWindow::fake_group so that it can be seen from Rust. 2025-09-09 16:54:30 -04:00
2ef6720890 Expose WIcon::highlighted so that it can be seen from Rust. 2025-09-09 15:52:33 -04:00
493d3c9738 Expose WScreen::root_win so that it can be seen from Rust. 2025-09-09 15:49:52 -04:00
3234e15388 Move WApplication refcount maintenance into Rust. 2025-09-05 02:24:03 -04:00
274d1459aa Move wApplicationClearUrgentBounceTimer into Rust. 2025-09-05 02:02:34 -04:00
7ba66fbc00 Get rid of unused intrusive linked list in WApplication.
There is code to maintain this list in wApplicationDestroy, but use of it was
removed in 2001 (see commit 672c42cc48). So let's do some cleanup.
2025-09-05 01:49:20 -04:00
289ceb2991 First stab at defining WApplication methods in Rust.
This builds and appears to run.
2025-09-03 21:38:35 -04:00
55d34ff0a1 Make bitfields in WApplication's flags struct into real fields.
This will ease interop with Rust.
2025-09-03 20:58:31 -04:00
0e7f125494 Move WApplication definition and remaining methods into a separate file.
This should provide a more solid interface boundary for a WApplication
replacement written in Rust.
2025-09-03 20:55:12 -04:00
9404c21fa8 Duplicate src/application.c to preserve revision history. 2025-09-03 20:43:59 -04:00
455aa71c19 Hide WAppIcon fields in favor of accessors. 2025-09-01 21:20:22 -04:00
18db22063c Hide WDock fields in favor of accessors. 2025-08-25 22:46:23 -04:00
b4d1dbe953 Hide WApplication fields in favor of accessors. 2025-08-24 23:41:16 -04:00
David Maciejak
215b6ee2e6 Set proper motif wm hints name
Just a cosmetic change as the variable is currently not in use.
According to the Motif Toolkit API and MwmUtil.h, the last long
variable from the Motif WM Hints struct is currenlty used
for the status.
2023-04-09 10:42:52 +01:00
David Maciejak
ab45c6c6c2 Add central position feature for active window
This patch adds a new Central feature under the window menu
"Other maximization" entry.
Shortcut can be configured via WPrefs "Center active window" action.
When called the active window is centered on the screen head.
If the window height or width are bigger than the head size,
the window is resized to fit.
There are some transitions defined as below:
*from fullscreen to center
*from any corner to center
*from top half to center top half
*from bottom half to center bottom half
*from left half to center left half
*from right half to center right half

Undoing the action is done via the window menu "Unmaximize" entry
or the shortcut.
2023-03-31 09:11:38 +01:00
David Maciejak
802cbc0d75 Hot corners feature core
Add mouse pointer position detection to trigger the corner actions.

Screen corners can be assigned an external command to be
executed when the mouse pointer is entering those areas.

In WPrefs, "Hot Corner Shortcut Preferences" can be used
for configuration or by manually adding a "HotCorners" key
and value to "YES" in the ~/GNUstep/Defaults/WindowMaker file.

Actions are specified by the "HotCornerActions" and are defined
as a four entries list ("top left action", "top right action",
"bottom left action", "bottom right action").
A screen corner area is a cube shape defined by the "HotCornerEdge"
which is a number of pixels from 2 (by default) to 10.

To lower the risk of triggering that feature accidentally a
"HotCornerDelay" key can be used which is the time before the action
is triggered while the pointer is in one of the screen corner.
Default value is 250 ms.

Hot Corners feature is disabled by default.
2023-03-26 10:35:33 +01:00
David Maciejak
157d1ba85f Fix internal function name typo
The patch is to fix a typo in the fct name movePionterToWindowCenter
2023-03-23 12:57:58 +00:00
David Maciejak
18a539b372 Add some more cases to handle window unusual size request
As discussed on the ML, the test to check for CARD16 limit is probably innacurate.
Check instead for maxH and maxW which are set by default to twice the size
of the screen or to the max values passed by the window normal hints property.
2023-03-16 15:02:18 +00:00
David Maciejak
eae9200c5d Fix ICCM ConfigureNotify request
According to ICCM specs at [1]

*Not changing the size, location, border width, or stacking order of the window at all.
A client will receive a synthetic ConfigureNotify event that describes the (unchanged)
geometry of the window. The (x,y) coordinates will be in the root coordinate system,
adjusted for the border width the client requested, irrespective of any reparenting
that has taken place. The border_width will be the border width the client requested.
The client will not receive a real ConfigureNotify event because no change has actually
taken place.

*Moving or restacking the window without resizing it or changing its border width.
A client will receive a synthetic ConfigureNotify event following the change that
describes the new geometry of the window. The event's (x,y) coordinates will be in
the root coordinate system adjusted for the border width the client requested.
The border_width will be the border width the client requested. The client may not
receive a real ConfigureNotify event that describes this change because the window
manager may have reparented the top-level window. If the client does receive a
real event, the synthetic event will follow the real one.

*Resizing the window or changing its border width
(regardless of whether the window was also moved or restacked).
A client that has selected for StructureNotify events will receive a real
ConfigureNotify event.
Note that the coordinates in this event are relative to the parent,
which may not be the root if the window has been reparented. The coordinates will
reflect the actual border width of the window (which the window manager may have
changed). The TranslateCoordinates request can be used to convert the coordinates
if required.

In Window Maker, the first case is not implemented: doing a synthetic ConfigureNotify
to notify no changes were done. That's creating some issues with app like Citrix icaclient
when sometime windows are blank and need to be moved to be refreshed.

[1]https://x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html#configuring_the_window
2023-03-16 15:02:18 +00:00
David Maciejak
25cb9d208a Update window.c copyright
Just updating the copyright line in the file header.
2023-03-16 15:02:18 +00:00
David Maciejak
23471b2e21 WPrefs: update maximization feature descriptions
Align the old maximization descriptions to the new visual indicator
names. The internal shortcut names had also been updated, meaning a
reconfiguration of the shortcuts in WPrefs is required.
2023-03-16 11:36:02 +00:00
David Maciejak
258ffc8b97 Window menu: add maximization visual indicators
Add visual indicators for the maximization options in the window menu.
2023-03-14 12:27:16 +00:00
David Maciejak
86b7ec1a58 Restore proper drawer direction when screen was resized
Since 48d4820dee the dock is positioned
dynamically based on the screen midpoint.
The side issue using such method is if in case the screen was temporarily
resized the dock as a chance to be displayed on the other side making
the drawer saved configuration from WMState esp the direction wrong when
wm is started again.
For example, the dock and drawer are displayed on the right of the screen.
Then the screen resolution is downsized temporaily to half or less of
the previous size. The position stored in WMState will be updated and the
direction of the drawer is still opening on the left.
But on next wm start, when reading the conf.
The position of the dock and drawer are corresponding to the
middle or less of the unresized screen. The dock and drawer will be sticked
on the left. But the drawer direction was not updated and still opening
on the left (which is out of the screen).
2023-03-14 12:27:16 +00:00
Doug Torrance
9831e3f72a Move declarations to beginning of switch statements
Several variable declarations were recently added immediately after
labels, but this causes compile errors in GCC versions prior to 11,
e.g.,

    wsmap.c: In function ‘handle_event’:
    wsmap.c:534:4: error: a label can only be part of a statement and a declaration is not a statement
      534 |    WMScreen *wmscr = wsmap->scr->wmscreen;
          |    ^~~~~~~~

We move these declarations to the top of the corresponding switch
statements so that Window Maker can compile on these older versions of
GCC.
2023-03-13 15:33:21 +00:00
David Maciejak
0ecf7d3540 KeepDockOnPrimaryHead: fix drawer direction
When that option is on, swapping drawer does not always mean
swapping drawer direction. For example if drawer is on the left
side of the second head and moving to the left side of the first head,
the direction should be the same.
2023-03-13 15:32:19 +00:00
David Maciejak
4576b5bf1e Info Panel: display proper number of colors in deepcolor env
Instead of displaying a number of unitary colors in 10bit env,
display a more human readable message.
2023-03-13 15:32:19 +00:00
David Maciejak
4c52232ee7 Window titlebar double click to unmaximize
Commit 6e2075f3df from 2020 added
a feature to maximize window when double clicking on the titlebar.
But unmaximizing is not supported so when double clicking again
on the window titlebar the window geometry was not reverted back.
2023-03-12 09:44:10 +00:00
David Maciejak
43edd37ee2 Update file headers year copyright
Update copyright year for Window Maker Team entries.
2023-03-12 09:44:10 +00:00
David Maciejak
e95aea2e30 Workspace pager: display ? on non visited mini workspace
When the workspace pager is displayed it's showing grey mini workspaces
for non rendered/non visited workspaces. That patch is adding an exclamation
mark in the middle of the dummy grey background mini workspaces.
2023-03-11 11:38:25 +00:00
David Maciejak
3e991badf7 SwitchPanel: fix app icons opacity combination
For some apps the background is not displayed properly, showing
some kind of shawow around the app icon like for example firefox
or skype. This is due to an issue in combining alpha channels.
2023-03-09 15:05:58 +00:00
David Maciejak
d045ffcf7d Add a screenshot capture feature
This patch adds a feature to take screenshots directly from Window Maker.
Having the feature embeded direclty inside Window Maker allows us to take
advantage of how Window Maker is managing and handling Windows.
Three new actions can be bound to a key shortcut from WPrefs.
The screenshot files are saved in ~/GNUstep/Library/WindowMaker/Screenshots/
dir, with a "screenshot_%Y-%m-%d_at_%H:%M:%S" format followed by the
extension. Preferably as a PNG or JPG file if available.
Meaning, to work Window Maker via WRaster needs to support
at least one of those format.

"Capture the entire screen" is quite standard, it takes a screenshot
of the whole screen area (even in multiheads env).
"Capture a portion of the screen" requires the user to draw a rectangle which
will be captured.
Those two first are quite straightforward, just taking a live picture of
the screen.
The last one is "Capture a window" which works in best effort mode,
it catures the focused window. As Window Maker by default is not using
any compositor (like for example Xcompmgr) it can only dump the content
displayed on the screen.
If a window is minimized or out of the screen, there is high chance the
image will be split or some area greyed in case other windows overlapped it.
2023-03-07 17:30:59 +00:00
David Maciejak
7185af15cf Use wtokenfree whenever there is wtokensplit
Whenever wtokensplit is used to split into argv/argc, it's better to
use the built-in function wtokenfree() as a wfree call only on argv
is not freeing the memory properly.
2023-03-05 00:16:44 +00:00
David Maciejak
0ccc5bbde7 Coverity: fix wmspec dereference after null check 2023-03-02 17:04:48 +00:00
David Maciejak
0e00c6b605 Coverity: fix dialog dereference null return value
This patch is making sure defaultPath returns from FindImage() is not null
and freeing the variables.
2023-03-02 17:04:48 +00:00
David Maciejak
6c7266c338 Coverity: fix session resource leak 2023-03-02 17:04:48 +00:00
David Maciejak
b4bd6d0cad Coverity: fix xmodifier uninitialized scalar variable 2023-03-02 17:04:48 +00:00
David Maciejak
d831766572 Coverity: fix rootmenu structurally dead code 2023-03-02 17:04:48 +00:00
David Maciejak
1215680b6d Coverity: fix misc resource leak 2023-03-02 17:04:48 +00:00
David Maciejak
3cc5808dcd Coverity: fix wmspec uninitialized layer variable 2023-02-28 13:40:48 +00:00
David Maciejak
8ca89f0141 Coverity: fix RContextAttributes uninitialized variable 2023-02-28 13:33:11 +00:00
David Maciejak
d2d5297a1e Coverity: fix potential buffer overflow 2023-02-28 13:33:11 +00:00
David Maciejak
9f8dc6f5dc Use W_KeycodeToKeysym instead of XkbKeycodeToKeysym
This patch replaces XkbKeycodeToKeysym by our
own function W_KeycodeToKeysym.
2023-02-27 23:05:27 +00:00