summaryrefslogtreecommitdiff
path: root/plugins
diff options
authorRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-08-31 16:55:43 -0300
committerRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-08-31 16:55:43 -0300
commit0bbd42fc906c4ce887a90ebb2ffb950efe93f703 (patch)
tree80a0ad612c75f44e7585857b4dc54b93294421c3 /plugins
parentf59ebd6f25904a4a92b37b624f37eff898a5e443 (diff)
Moved function "GetWindowName" from UnityWindow to WindowManager.
(bzr r2650.1.1)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/unityshell/src/unityshell.cpp81
-rw-r--r--plugins/unityshell/src/unityshell.h5
2 files changed, 1 insertions, 85 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index 640fd3654..a22da6e54 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -3611,7 +3611,7 @@ void UnityWindow::RenderText (WindowCairoContext *context,
pango_layout_set_auto_dir (layout, false);
pango_layout_set_text (layout,
- GetWindowName (window->id ()).c_str (),
+ WindowManager::Default()->GetWindowName(window->id()).c_str(),
-1);
/* update the size of the pango layout */
@@ -3863,85 +3863,6 @@ bool UnityPluginVTable::init()
return true;
}
-CompString UnityWindow::GetUtf8Property (Window id,
- Atom atom)
-{
- Atom type;
- int result, format;
- unsigned long nItems, bytesAfter;
- char *val;
- CompString retval;
- Atom utf8StringAtom;
-
- utf8StringAtom = XInternAtom (screen->dpy (), "UTF8_STRING", 0);
- result = XGetWindowProperty (screen->dpy (), id, atom, 0L, 65536, False,
- utf8StringAtom, &type, &format, &nItems,
- &bytesAfter, (unsigned char **) &val);
-
- if (result != Success)
- return retval;
-
- if (type == utf8StringAtom && format == 8 && val && nItems > 0)
- {
- char valueString[nItems + 1];
- strncpy (valueString, val, nItems);
- valueString[nItems] = 0;
- retval = valueString;
- }
- if (val)
- XFree (val);
-
- return retval;
-}
-
-CompString UnityWindow::GetTextProperty (Window id,
- Atom atom)
-{
- XTextProperty text;
- CompString retval;
-
- text.nitems = 0;
- if (XGetTextProperty (screen->dpy (), id, &text, atom))
- {
- if (text.value)
- {
- char valueString[text.nitems + 1];
-
- strncpy (valueString, (char *) text.value, text.nitems);
- valueString[text.nitems] = 0;
-
- retval = valueString;
-
- XFree (text.value);
- }
- }
-
- return retval;
-}
-
-
-CompString UnityWindow::GetWindowName (Window id)
-{
- CompString name;
- Atom visibleNameAtom;
-
- visibleNameAtom = XInternAtom (screen->dpy (), "_NET_WM_VISIBLE_NAME", 0);
- name = GetUtf8Property (id, visibleNameAtom);
- if (name.empty ())
- {
- Atom wmNameAtom = XInternAtom (screen->dpy (), "_NET_WM_NAME", 0);
- name = GetUtf8Property (id, wmNameAtom);
- }
-
-
- if (name.empty ())
- name = GetTextProperty (id, XA_WM_NAME);
-
- return name;
-}
-
-
-
namespace
{
diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h
index b9bea314a..b9afe93d2 100644
--- a/plugins/unityshell/src/unityshell.h
+++ b/plugins/unityshell/src/unityshell.h
@@ -482,11 +482,6 @@ private:
float maxWidth, float maxHeight);
WindowCairoContext* CreateCairoContext (float width, float height);
- // based on compiz text plugin
- CompString GetWindowName (Window id);
- CompString GetUtf8Property (Window id, Atom atom);
- CompString GetTextProperty (Window id, Atom atom);
-
compiz::WindowInputRemoverLock::Weak input_remover_;
glib::Source::UniquePtr focus_desktop_timeout_;