Merge lp:~ted/appmenu-gtk/text-direction into lp:appmenu-gtk/0.4

Proposed by Ted Gould
Status: Merged
Merged at revision: 121
Proposed branch: lp:~ted/appmenu-gtk/text-direction
Merge into: lp:appmenu-gtk/0.4
Diff against target: 41 lines (+9/-3)
2 files modified
configure.ac (+2/-2)
src/bridge.c (+7/-1)
To merge this branch: bzr merge lp:~ted/appmenu-gtk/text-direction
Reviewer Review Type Date Requested Status
Conor Curran (community) Approve
Review via email: mp+51647@code.launchpad.net

Description of the change

If GTK has a set text direction we should use that instead of the dbusmenu one.

To post a comment you must log in.
Revision history for this message
Conor Curran (cjcurran) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2011-02-11 15:11:35 +0000
3+++ configure.ac 2011-02-28 22:51:14 +0000
4@@ -1,6 +1,6 @@
5 AC_PREREQ(2.59)
6
7-AC_INIT([appmenu-gtk], [0.1.93], [crussell@canonical.com])
8+AC_INIT([appmenu-gtk], [0.1.94], [crussell@canonical.com])
9 AC_COPYRIGHT([Copyright 2010 Canonical])
10 AC_CONFIG_SRCDIR([src/bridge.c])
11 AC_CONFIG_MACRO_DIR([build/autotools])
12@@ -25,7 +25,7 @@
13 ###########################
14
15 GTK_REQUIRED_VERSION=2.18
16-DBUSMENU_REQUIRED_VERSION=0.3.94
17+DBUSMENU_REQUIRED_VERSION=0.3.99
18
19 PKG_CHECK_MODULES(APPMENU, gtk+-2.0 >= $GTK_REQUIRED_VERSION
20 dbusmenu-gtk-0.4 >= $DBUSMENU_REQUIRED_VERSION)
21
22=== modified file 'src/bridge.c'
23--- src/bridge.c 2011-02-11 13:59:10 +0000
24+++ src/bridge.c 2011-02-28 22:51:14 +0000
25@@ -626,9 +626,15 @@
26 if (!context->path)
27 context->path = g_strdup_printf ("/com/canonical/menu/%X", (guint)xid);
28
29- if (!context->server)
30+ if (!context->server) {
31 context->server = dbusmenu_server_new (context->path);
32
33+ GtkTextDirection dir = gtk_widget_get_default_direction();
34+ if (dir != GTK_TEXT_DIR_NONE) {
35+ dbusmenu_server_set_text_direction(context->server, dir == GTK_TEXT_DIR_LTR ? DBUSMENU_TEXT_DIRECTION_LTR : DBUSMENU_TEXT_DIRECTION_RTL);
36+ }
37+ }
38+
39 DbusmenuMenuitem * mi = find_menu_bar(toplevel);
40 dbusmenu_server_set_root(context->server, mi);
41 if (mi != NULL) {

Subscribers

People subscribed via source and target branches