[metacity] core: simplify meta_core_get_workspace_name_with_index
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] core: simplify meta_core_get_workspace_name_with_index
- Date: Tue, 4 Jul 2017 09:16:30 +0000 (UTC)
commit 999643f764c2ffdac2ad47f579998de0882c00a1
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Tue Jul 4 12:09:36 2017 +0300
core: simplify meta_core_get_workspace_name_with_index
src/core/core.c | 6 +-----
src/include/core.h | 1 -
src/ui/menu.c | 10 ++--------
3 files changed, 3 insertions(+), 14 deletions(-)
---
diff --git a/src/core/core.c b/src/core/core.c
index 18ff0ed..563d184 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -606,17 +606,13 @@ meta_core_get_menu_accelerator (MetaMenuOp menu_op,
const char*
meta_core_get_workspace_name_with_index (Display *xdisplay,
- Window xroot,
int index)
{
MetaDisplay *display;
- MetaScreen *screen;
MetaWorkspace *workspace;
display = meta_display_for_x_display (xdisplay);
- screen = meta_display_screen_for_root (display, xroot);
- g_assert (screen != NULL);
- workspace = meta_screen_get_workspace_by_index (screen, index);
+ workspace = meta_screen_get_workspace_by_index (display->screen, index);
return workspace ? meta_workspace_get_name (workspace) : NULL;
}
diff --git a/src/include/core.h b/src/include/core.h
index 8a38618..364decc 100644
--- a/src/include/core.h
+++ b/src/include/core.h
@@ -157,7 +157,6 @@ int meta_core_get_active_workspace (Screen *xscreen);
int meta_core_get_frame_workspace (Display *xdisplay,
Window frame_xwindow);
const char* meta_core_get_workspace_name_with_index (Display *xdisplay,
- Window xroot,
int index);
void meta_core_show_window_menu (Display *xdisplay,
diff --git a/src/ui/menu.c b/src/ui/menu.c
index ee9c84d..2a2b692 100644
--- a/src/ui/menu.c
+++ b/src/ui/menu.c
@@ -155,14 +155,13 @@ activate_cb (GtkWidget *menuitem, gpointer data)
*/
static char*
get_workspace_name_with_accel (Display *display,
- Window xroot,
int index)
{
const char *name;
int number;
int charcount=0;
- name = meta_core_get_workspace_name_with_index (display, xroot, index);
+ name = meta_core_get_workspace_name_with_index (display, index);
g_assert (name != NULL);
@@ -343,8 +342,6 @@ meta_window_menu_new (MetaFrames *frames,
if (ops & META_MENU_OP_WORKSPACES)
{
Display *display;
- Window xroot;
- GdkScreen *screen;
GdkWindow *window;
GtkWidget *submenu;
int j;
@@ -360,9 +357,6 @@ meta_window_menu_new (MetaFrames *frames,
window = gtk_widget_get_window (GTK_WIDGET (frames));
display = GDK_WINDOW_XDISPLAY (window);
- screen = gdk_window_get_screen (window);
- xroot = GDK_WINDOW_XID (gdk_screen_get_root_window (screen));
-
submenu = gtk_menu_new ();
g_assert (mi==NULL);
@@ -379,7 +373,7 @@ meta_window_menu_new (MetaFrames *frames,
j + 1,
&key, &mods);
- label = get_workspace_name_with_accel (display, xroot, j);
+ label = get_workspace_name_with_accel (display, j);
moveitem.type = MENU_ITEM_NORMAL;
moveitem.op = META_MENU_OP_WORKSPACES;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]