summaryrefslogtreecommitdiff
path: root/mate-panel
AgeCommit message (Collapse)AuthorFilesLines
2024-02-04Constify some pointer references in localsColomban Wendling1-22/+22
No need to have pointers to mutables when not needed. This does not cover everything at all, and is limited to one file for the moment. origin commit was: https://github.com/mate-desktop/mate-panel/commit/b913762
2024-02-04Reduce scope of more codeColomban Wendling1-7/+7
The computed values are only used in one branch, so compute them there.
2024-02-04Avoid a redundant NULL checkColomban Wendling1-4/+5
It's probably not necessary to perform the NULL check at all as the only code paths that could make `list` NULL are already pretty dramatically broken, but as we have a NULL check move everything relevant inside it.
2024-02-04Reduce scope of variablesColomban Wendling12-47/+37
Mostly found by cppcheck. origin commit was: https://github.com/mate-desktop/mate-panel/commit/96c7ebc
2024-02-04Revert "Add "center-stick" capability applets on the panel"raveit6519-428/+196
This reverts commit 38e00280e9d17282717595a05411736a308804c0.
2024-02-04Revert "Fix center- and right-sticking of expanding applets"raveit651-121/+26
This reverts commit 7b1b00d5ddffc349ca117843bd0d015e9fb08a89.
2024-02-04Revert "Reduce scope of variables"raveit6512-40/+51
This reverts commit 96c7ebc6dc9e8b8327db04a9570054ee78743353.
2024-02-04Revert "Avoid a redundant NULL check"raveit651-5/+4
This reverts commit 17b87e321bfca409c31ce4b4e0e3326eeef92b88.
2024-02-04Revert "Reduce scope of more code"raveit651-7/+7
This reverts commit 655a8f484598a07a210dc56f1662021f8be69737.
2024-02-04Revert "Constify some pointer references in locals"raveit651-30/+30
This reverts commit b91376262abb56d95f9ec86993edaa8e9fb2cc1a.
2024-01-25run-dialog: Don't needlessly override DISPLAY environment variableColomban Wendling1-20/+2
This code got introduced with 3c21f66bf30810fcb25dfe8c3c0960df270dc416 trying to mimic `gdk_spawn_on_screen()`, but does not: what `gdk_spawn_on_screen()` did (on X11) was to append the screen number to the display, so that it worked on a multi-screen setup where the app is not on the default X screen. However, the code that got introduced just sets the display, which is gonna be already there anyway (yet possibly loosing the default screen in the process?), and AFAIK GDK dropped support for multi-screen setups anyway (not to be confused with multi-monitor with e.g. Xinerama). We should actually be better of without any of this, as it most likely doesn't do what it is supposed to, nobody needs what it failed to do, and it breaks XWayland on Wayland. Fixes #1387.
2024-01-06Update opacity when changed gsettings color valuezhu yaliang1-0/+17
2023-11-21Constify some pointer references in localsColomban Wendling1-30/+30
No need to have pointers to mutables when not needed. This does not cover everything at all, and is limited to one file for the moment.
2023-11-21Reduce scope of more codeColomban Wendling1-7/+7
The computed values are only used in one branch, so compute them there.
2023-11-21Remove a redundant NULL checkColomban Wendling1-2/+1
`info` cannot be NULL, and if it was it'd already have crashed above. > mate-panel/panel.c:893:34: warning: Either the condition 'info!=((void*)0)' is redundant or there is possible null pointer dereference: info. [nullPointerRedundantCheck] > parent = gtk_widget_get_parent (info->widget); > ^ > mate-panel/panel.c:895:11: note: Assuming that condition 'info!=((void*)0)' is not redundant > if (info != NULL && > ^ > mate-panel/panel.c:893:34: note: Null pointer dereference > parent = gtk_widget_get_parent (info->widget); > ^
2023-11-21Avoid a redundant NULL checkColomban Wendling1-4/+5
It's probably not necessary to perform the NULL check at all as the only code paths that could make `list` NULL are already pretty dramatically broken, but as we have a NULL check move everything relevant inside it.
2023-11-21Constify a parameterColomban Wendling2-2/+2
2023-11-21Return a value even after an assertion failureColomban Wendling1-1/+1
This is not strictly needed as there's already an assertion (assuming it's not compiled out), but returning a value help analyzers get this right.
2023-11-21Remove redundant shadowing variableColomban Wendling1-1/+0
No need to get the default icon theme again anyway.
2023-11-21Reduce scope of variablesColomban Wendling12-51/+40
Mostly found by cppcheck.
2023-11-21Remove unused member PanelAction::typeColomban Wendling1-9/+0
> mate-panel/panel-action-button.c:516:26: style: struct member 'PanelAction::type' is never used. [unusedStructMember] > PanelActionButtonType type; > ^
2023-11-21Do not perform useless incoherent NULL checkColomban Wendling1-1/+1
cppcheck tells us that we perform NULL checking inconsistently, and reports a potential NULL dereference. Here however the string cannot be NULL, so just drop the unnecessary check. > mate-panel/panel-run-dialog.c:1663:10: warning: Either the condition '!start' is redundant or there is possible null pointer dereference: start. [nullPointerRedundantCheck] > while (*start != '\0' && g_ascii_isspace (*start)) > ^ > mate-panel/panel-run-dialog.c:1679:6: note: Assuming that condition '!start' is not redundant > if (!start || !start [0]) { > ^ > mate-panel/panel-run-dialog.c:1663:10: note: Null pointer dereference > while (*start != '\0' && g_ascii_isspace (*start)) > ^
2023-11-21Reorder array index limit checkColomban Wendling1-3/+1
This is *not* an issue, as it's not really a bounds check but a mere limit, and the array is NULL-terminated. However, it looks odd and cppcheck (unsurprisingly) doesn't understand the details well enough and reports this as a misordered bounds check. > mate-panel/panel-run-dialog.c:166:12: style: Array index 'i' is used before limits check. [arrayIndexThenCheck] > items[i] && i < history_max_size; > ^
2023-10-12Main menus: fix missing Places, System iconslukefromdc1-2/+2
*After replacing gtk_image_menu_item with mate_image_menu_item *We must also replace GTK_TYPE_IMAGE_MENU_ITEM with MATE_TYPE_IMAGE_MENU_ITEM *This fixes leftover GtkImageMenuItem deprecation warnings and restores missing Places and System icons in main menus
2023-10-09replace deprecated gtk-image-menu-item*raveit654-13/+17
2023-10-05Wayland: Fix force-quit unsupported message dialoglukefromdc1-1/+1
*For some reason "widget" is not being properly passed to this, so use NULL for the parent window
2023-10-05Wayland: Make panel shutdown button work under waylandlukefromdc1-5/+203
*This uses systemd to be able to shutdown when a display manager is running as root *If no session or display manager is running as root, systemd used only to suspend or hibernate *Suspend/hibernate require systemd at this point *If suspend or hibernate not supported error dialog shown if those buttons clicked *If "disable logout" lockdown option set, shut down button cannot be added same as in x11 *If shut down button added to panel and lockout later disabled, same non-responsive button as in x11 *Logind support would be welcome
2023-10-05Force-quit/x11: Fix misalignment of popup with multimonitorslukefromdc1-6/+13
*Compute the size of the monitor we are actually showing the popup on *by getting the monitor it is shown on and running gdk_monitor_get_geometry() *This returns application (scaled) pixels not device pixels
2023-10-02Hidpi x11: center panel force-quit popup windowlukefromdc1-3/+4
2023-07-23button-widget.c: replace tabs with 4 spacesLuke from DC2-662/+663
- button-widget.c: replace tabs with 4 spaces and reformat as necessary - button-widget.h: tab to 4 spaces - button-widget.c: adjust indents and bracket style --------- Co-authored-by: raveit65 <[email protected]>
2023-07-20Wayland: Fix blurry rendering of panel launcher iconslukefromdc1-34/+49
*Custom icons not findable by gtk_icon_theme_load_surface are still blurry
2023-05-22Wayland, hidpi: do not scale buttons in wayland (#1370)Luke from DC1-8/+36
Otherwise they are rendered double-sized and offset. Wayland apparently handles this for us
2023-05-17tell dconf-edit about relocatable schemas (#1355)Denis Gorodnichev1-0/+47
* tell dconf-edit about relocatable schemas * self fix for incorrect and duplicated records remove duplicated schemas for currect path remove incorrect schemas for current path * remove clock applet hack * expose mate_panel_applet_settings_new to introspection add "transfer full" annotation to make this method available throught introspection
2023-05-07panel-run-dialog: Add accelerator keys for "list of known applications" (#1359)Matthias Reis1-20/+136
* panel-run-dialog: Add accelerator keys for "list of known applications" in panel run dialog, display modifier keys by using GtkCellRendererAccel * fixup! panel-run-dialog: Add accelerator keys for "list of known applications" in panel run dialog, display modifier keys by using GtkCellRendererAccel * fixup! fixup! panel-run-dialog: Add accelerator keys for "list of known applications" in panel run dialog, display modifier keys by using GtkCellRendererAccel * fixup! fixup! fixup! panel-run-dialog: Add accelerator keys for "list of known applications" in panel run dialog, display modifier keys by using GtkCellRendererAccel * fixup! fixup! fixup! fixup! panel-run-dialog: Add accelerator keys for "list of known applications" in panel run dialog, display modifier keys by using GtkCellRendererAccel
2022-12-23panel-menu-button: comment out wayland debugging messagelukefromdc1-4/+6
leave the code in place so it can be uncommented and used for further work on wayland
2022-08-20Fix center- and right-sticking of expanding appletsGordon Norman Squash1-26/+121
In a prior commit (38e00280e9d17282717595a05411736a308804c0), I added support to stick applets to the center of the panel, so that no matter the width of the applet or the panel, the applet would always stay at the center of the panel. That commit also added an "end-relative" mode, which is similar to the panel's old "right-stick" feature, except end-relative mode positions the applet's right edge relative to the panel's right edge, whereas right-sticking positioned the applet's left edge relative to the right edge of the panel. The advantage of end-relative positioning is that the applet can resize without moving itself even further to the right than the user intended, whereas if positioned so that there is empty space between the applet and the edge of the panel, right-stuck applets would change the size of that gap (or close it entirely) when the applet resized. Unfortunately, I have since discovered that my original implementation of the center-stick and end-relative positioning of applets was inadequate. Some applets can accept any amount of space between a minimum and their "preferred" size -- if such an applet cannot be allocated its preferred size (perhaps because panel space is scarce), then the applet will be allocated as much space as is available, and the applet will "flex" itself to compensate. Some examples of these "expanding" applets include the Window List (a component of the wncklet included in this package) and the MATE Dock Applet (a third-party panel applet from the Ubuntu MATE project). When writing my original center-stick code, I did not properly take expanding applets into account, and with my original commit, such applets were off-center -- usually way off-center since the code seemed to position such applets based on their minimum size, rather than their actual allocated size. This commit adds center-sticking support for expanding applets. It also works with end-relative expanding applets -- such applets will expand towards the left, thus keeping their right-relative position intact.
2022-06-08applet: SMALL_ICON_SIZE macro is not used [-Wunused-macros]rbuj1-2/+0
2022-06-01Add "center-stick" capability applets on the panelThe Squash19-196/+428
Conventionally, the applets on a MATE Panel are positioned relative to the left edge of the panel (if the panel is horizontal) or the top edge (if the panel is vertical). There has also been some (buggy) support for positioning of applets relative to the right (or bottom) edge of the panel, so that applets on the right side of the panel will stay on the right side even if the user changes screen resolutions or if the panel changes size for some other reason. However, many users want to also place applets at or near the center of their panel(s). There is no such conventional support for positioning applets relative to the center of the panel, so users have positioned applets near the center of the panel -- but the position recorded is relative to the left side of the panel. As such, the applets will almost certainly shift over to the left or right slightly if the panel is ever resized, and the user will have to reposition all those centered applets yet again. This is especially frustrating if the user switches monitors on a regular basis! This patch radically revamps the MATE Panel's positioning framework, and deprecates the original "right-stick" feature. To replace the right-stick feature, this patch instead associates an "edge relativity" setting with each and every panel applet: An applet can be relative to the start (left/ top), end (right/bottom), or center of the panel. This setting can be changed using DConf/GSettings, using a custom panel layout file, or even by simply dragging the applet to the appropriate place on the panel. (Conventionally, applets are not even right-stuck automatically even when the user drags the applet over to the far right of the panel!) As a bonus, when the user drags an applet across the center of the panel, the applet will temporarily "stick" to the very center of the panel, to allow the user to very precisely align any applet they wish.
2022-03-23fix undefined reference to g_clear_signal_handler (glib < 2.62)rbuj1-2/+0
2022-03-18panel-multimonitor: Condition '*monitors_ret>0' is always falserbuj1-6/+8
2022-01-26Fix implicit conversion changes signedness: 'gboolean' to 'guint'rbuj10-54/+54
2022-01-18panel-run-dialog: address of array 'dent->d_name' will always evaluate to 'true'rbuj1-2/+1
2021-12-20panel-toplevel.h: fix indentrbuj1-56/+56
2021-12-20Fix some -Wsign-compare warningsrbuj15-46/+56
2021-12-20Use dashes for applet-[added|removed|move], back-change, size-changerbuj2-10/+10
2021-12-20Remove unnecessary cast in g_signal_connect* callrbuj16-110/+126
2021-12-19Upscale in panel_xutils_set_strutrbuj4-24/+13
2021-12-19panel-toplevel: fix the computed dimension for (non) auto hidden panelsrbuj1-1/+1
2021-12-19struts: add support for _GNOME_WM_STRUT_AREAAlberts Muktupāvels3-6/+35
In addition to existing properties set also new _GNOME_WM_STRUT_AREA property that allows creating struts between monitors. https://mail.gnome.org/archives/wm-spec-list/2018-December/msg00000.html https://gitlab.freedesktop.org/xdg/xdg-specs/merge_requests/22 https://gitlab.gnome.org/GNOME/gnome-panel/merge_requests/3 Upscale area strut because of 73e025b0eab94fe06cdafee61c347fb5fe6f7545
2021-12-19Use dashes instead of underscores in signal namesrbuj13-52/+52