Add some patches

This commit is contained in:
longcheng 2022-08-08 15:14:52 +08:00
parent 19e81b50dd
commit 0646d1df3a
4 changed files with 267 additions and 2 deletions

View File

@ -0,0 +1,46 @@
From 49944cb7e9cda0a56e4e0c367e73d025b1e20983 Mon Sep 17 00:00:00 2001
From: longcheng <longcheng@kylinos.com.cn>
Date: Thu, 24 Mar 2022 18:53:11 +0800
Subject: [PATCH 0/5] change workspace titlebar and font and composite
---
configure | 2 +-
src/org.mate.marco.gschema.xml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index f89f5be..3135a6e 100755
--- a/configure
+++ b/configure
@@ -14897,7 +14897,7 @@ fi
if test x$have_xcomposite = xyes; then
MARCO_PC_MODULES="$MARCO_PC_MODULES xcomposite >= $XCOMPOSITE_VERSION xfixes xrender xdamage"
-$as_echo "#define HAVE_COMPOSITE_EXTENSIONS 1" >>confdefs.h
+$as_echo "#define HAVE_COMPOSITE_EXTENSIONS 0" >>confdefs.h
echo "Building with compositing manager"
diff --git a/src/org.mate.marco.gschema.xml b/src/org.mate.marco.gschema.xml
index 6632e6b..afd64b8 100644
--- a/src/org.mate.marco.gschema.xml
+++ b/src/org.mate.marco.gschema.xml
@@ -116,13 +116,13 @@
<description>If true, ignore the titlebar_font option, and use the standard application font for window titles.</description>
</key>
<key name="titlebar-font" type="s">
- <default>'Sans Bold 10'</default>
+ <default>'Noto Sans CJK SC Regular 9'</default>
<summary>Window title font</summary>
<description>A font description string describing a font for window titlebars. The size from the description will only be used if the titlebar_font_size option is set to 0. Also, this option is disabled if the titlebar_uses_desktop_font option is set to true.</description>
</key>
<key name="num-workspaces" type="i">
<range min="1" max="36"/>
- <default>4</default>
+ <default>2</default>
<summary>Number of workspaces</summary>
<description>Number of workspaces. Must be more than zero, and has a fixed maximum to prevent making the desktop unusable by accidentally asking for too many workspaces.</description>
</key>
--
2.27.0

View File

@ -0,0 +1,25 @@
From b638cc7c8bb7cfb9d61ae85e3ad00b3cfd1ec884 Mon Sep 17 00:00:00 2001
From: longcheng <longcheng@kylinos.com.cn>
Date: Thu, 24 Mar 2022 18:54:48 +0800
Subject: [PATCH 1/5] fix: disabled Alt+F1 to popop mate menu
---
src/org.mate.marco.gschema.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/org.mate.marco.gschema.xml b/src/org.mate.marco.gschema.xml
index afd64b8..94f63b4 100644
--- a/src/org.mate.marco.gschema.xml
+++ b/src/org.mate.marco.gschema.xml
@@ -603,7 +603,7 @@
<description>The format looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1". The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;". If you set the option to the special string "disabled", then there will be no keybinding for this action.</description>
</key>
<key name="panel-main-menu" type="s">
- <default>'&lt;Alt&gt;F1'</default>
+ <default>'disabled'</default>
<summary>Show the panel's main menu</summary>
<description>The format looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1". The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;". If you set the option to the special string "disabled", then there will be no keybinding for this action.</description>
</key>
--
2.27.0

View File

@ -0,0 +1,179 @@
From bf212ac737d114d639457802ce8b1363a465c7a3 Mon Sep 17 00:00:00 2001
From: longcheng <longcheng@kylinos.com.cn>
Date: Thu, 24 Mar 2022 18:58:13 +0800
Subject: [PATCH 2/5] feature[menu] : pop up start menu when press super key
---
po/zh_CN.po | 3 +++
src/50-marco-desktop-key.xml.in | 2 ++
src/core/atomnames.h | 1 +
src/core/keybindings.c | 48 +++++++++++++++++++++++++++++++++
src/include/all-keybindings.h | 2 ++
src/include/prefs.h | 3 ++-
src/org.mate.marco.gschema.xml | 5 ++++
src/ui/ui.c | 8 ++++++
8 files changed, 71 insertions(+), 1 deletion(-)
diff --git a/po/zh_CN.po b/po/zh_CN.po
index ad1d1eb..4399cda 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -42,6 +42,9 @@ msgstr "显示面板的“运行应用程序”对话框"
msgid "Show the panel's main menu"
msgstr "显示面板主菜单"
+msgid "Show the panel's main menu of kiran"
+msgstr "显示开始菜单"
+
#: ../src/50-marco-desktop-key.xml.in.h:4
#: ../src/org.mate.marco.gschema.xml.h:101
msgid "Take a screenshot"
diff --git a/src/50-marco-desktop-key.xml.in b/src/50-marco-desktop-key.xml.in
index 219109e..1719291 100644
--- a/src/50-marco-desktop-key.xml.in
+++ b/src/50-marco-desktop-key.xml.in
@@ -5,6 +5,8 @@
<KeyListEntry name="panel-main-menu" _description="Show the panel's main menu" />
+ <KeyListEntry name="panel-kiran-menu" _description="Show the panel's main menu of kiran" />
+
<KeyListEntry name="run-command-screenshot" _description="Take a screenshot" />
<KeyListEntry name="run-command-window-screenshot" _description="Take a screenshot of a window" />
diff --git a/src/core/atomnames.h b/src/core/atomnames.h
index 3744f42..48582aa 100644
--- a/src/core/atomnames.h
+++ b/src/core/atomnames.h
@@ -64,6 +64,7 @@ item(_GTK_SHOW_WINDOW_MENU)
item(_MATE_PANEL_ACTION)
item(_MATE_PANEL_ACTION_MAIN_MENU)
item(_MATE_PANEL_ACTION_RUN_DIALOG)
+item(_MATE_PANEL_ACTION_KIRAN_MENU)
item(_MARCO_SENTINEL)
item(_MARCO_VERSION)
item(WM_CLIENT_MACHINE)
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 83ff985..542c89f 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -2917,6 +2917,54 @@ handle_panel (MetaDisplay *display,
meta_error_trap_pop (display, FALSE);
}
+static void
+handle_kiran_panel (MetaDisplay *display,
+ MetaScreen *screen,
+ MetaWindow *window,
+ XEvent *event,
+ MetaKeyBinding *binding)
+ {
+ /*MetaKeyBindingAction action = binding->handler->data;*/
+ MetaKeyBindingAction action = META_KEYBINDING_ACTION_KIRAN_PANEL_MENU;
+ Atom action_atom;
+ XClientMessageEvent ev;
+
+ action_atom = None;
+ switch (action)
+ {
+ /* FIXME: The numbers are wrong */
+ case META_KEYBINDING_ACTION_KIRAN_PANEL_MENU:
+ action_atom = display->atom__MATE_PANEL_ACTION_KIRAN_MENU;
+ break;
+ default:
+ return;
+ }
+
+ ev.type = ClientMessage;
+ ev.window = screen->xroot;
+ ev.message_type = display->atom__MATE_PANEL_ACTION;
+ ev.format = 32;
+ ev.data.l[0] = action_atom;
+ ev.data.l[1] = event->xkey.time;
+
+ meta_topic (META_DEBUG_KEYBINDINGS,
+ "Sending panel message with timestamp %lu, and turning mouse_mode "
+ "off due to keybinding press\n", event->xkey.time);
+ display->mouse_mode = FALSE;
+
+ meta_error_trap_push (display);
+
+ /* Release the grab for the panel before sending the event */
+ XUngrabKeyboard (display->xdisplay, event->xkey.time);
+ XSendEvent (display->xdisplay,
+ screen->xroot,
+ False,
+ StructureNotifyMask,
+ (XEvent*) &ev);
+
+ meta_error_trap_pop (display, FALSE);
+}
+
static void
handle_activate_window_menu (MetaDisplay *display,
MetaScreen *screen,
diff --git a/src/include/all-keybindings.h b/src/include/all-keybindings.h
index cba8e9f..a7ade33 100644
--- a/src/include/all-keybindings.h
+++ b/src/include/all-keybindings.h
@@ -154,6 +154,8 @@ keybind (show-desktop, handle_show_desktop, 0, 0)
keybind (panel-main-menu, handle_panel, META_KEYBINDING_ACTION_PANEL_MAIN_MENU, 0)
keybind (panel-run-dialog, handle_panel, META_KEYBINDING_ACTION_PANEL_RUN_DIALOG, 0)
+keybind (panel-kiran-menu, handle_kiran_panel, META_KEYBINDING_ACTION_KIRAN_PANEL_MENU, 0)
+
/* Yes, the param is offset by one. Historical reasons. (Maybe worth fixing
* at some point.) The description is NULL here because the stanza is
* irregularly shaped in marco.schemas.in. This will probably be fixed
diff --git a/src/include/prefs.h b/src/include/prefs.h
index 34ab802..eda0693 100644
--- a/src/include/prefs.h
+++ b/src/include/prefs.h
@@ -205,7 +205,8 @@ typedef enum _MetaKeyBindingAction
META_KEYBINDING_ACTION_COMMAND_9,
META_KEYBINDING_ACTION_COMMAND_10,
META_KEYBINDING_ACTION_COMMAND_11,
- META_KEYBINDING_ACTION_COMMAND_12
+ META_KEYBINDING_ACTION_COMMAND_12,
+ META_KEYBINDING_ACTION_KIRAN_PANEL_MENU
} MetaKeyBindingAction;
typedef struct
diff --git a/src/org.mate.marco.gschema.xml b/src/org.mate.marco.gschema.xml
index 94f63b4..5716af3 100644
--- a/src/org.mate.marco.gschema.xml
+++ b/src/org.mate.marco.gschema.xml
@@ -607,6 +607,11 @@
<summary>Show the panel's main menu</summary>
<description>The format looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1". The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;". If you set the option to the special string "disabled", then there will be no keybinding for this action.</description>
</key>
+ <key name="panel-kiran-menu" type="s">
+ <default>'&lt;Super&gt;'</default>
+ <summary>Show the panel's main menu of kiran</summary>
+ <description>The format looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1". The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;". If you set the option to the special string "disabled", then there will be no keybinding for this action.</description>
+ </key>
<key name="panel-run-dialog" type="s">
<default>'&lt;Alt&gt;F2'</default>
<summary>Show the panel's "Run Application" dialog box</summary>
diff --git a/src/ui/ui.c b/src/ui/ui.c
index ed2c577..ddfa9bc 100644
--- a/src/ui/ui.c
+++ b/src/ui/ui.c
@@ -772,6 +772,14 @@ meta_ui_parse_accelerator (const char *accel,
return TRUE;
meta_ui_accelerator_parse (accel, &gdk_sym, &gdk_code, &gdk_mask);
+ if(gdk_mask & GDK_SUPER_MASK)
+ {
+ unsigned char super_L_keycode=0;
+ Display *display = XOpenDisplay(NULL);
+ super_L_keycode = XKeysymToKeycode(display , XK_Super_L);
+ gdk_code = super_L_keycode;
+ gdk_mask = 0;
+ }
if (gdk_mask == 0 && gdk_sym == 0 && gdk_code == 0)
return FALSE;
--
2.27.0

View File

@ -15,9 +15,9 @@
Name: marco
Version: %{branch}.3
%if 0%{?rel_build}
Release: 1%{?dist}
Release: 4
%else
Release: 0.11%{?git_rel}%{?dist}
Release: 0.12%{?git_rel}
%endif
Summary: MATE Desktop window manager
License: LGPLv2+ and GPLv2+
@ -29,6 +29,10 @@ URL: http://mate-desktop.org
# Source for snapshot-builds.
%{!?rel_build:Source0: http://git.mate-desktop.org/%{name}/snapshot/%{name}-%{commit}.tar.xz#/%{git_tar}}
Patch0: 0000-change-workspace-titlebar-and-font-and-composite-49944cb7.patch
Patch1: 0001-fix-disabled-Alt-F1-to-popop-mate-menu-b638cc7c.patch
Patch2: 0002-feature-menu-pop-up-start-menu-when-press-super-key-bf212ac7.patch
BuildRequires: desktop-file-utils
BuildRequires: gtk3-devel
BuildRequires: libcanberra-devel
@ -145,6 +149,17 @@ desktop-file-install \
%changelog
* Wed Jul 06 2022 longcheng <longcheng@kylinos.com.cn> - 1.22.3-4
- KYOS-F: changed number of workspace to 2; set marco compositor to 0; changed title-bar font to 'Noto Sans CJK SC Regular'
- KYOS-F: fix: disabled Alt+F1 to popop mate menu Related #28275
- KYOS-F: pop up start menu when press super key, Related #28467
* Thu Mar 24 2022 caodongxia <caodongxia@huawei.com> - 1.22.3-3
- restore else branch release
* Mon Dec 13 2021 liweigang <liweiganga@uniontech.com> - 1.22.3-2
- delete %dist
* Thu Sep 19 2019 Wolfgang Ulbrich <fedora@raveit.de> - 1.22.3-1
- update 1.22.3 release