[Libreoffice-commits] core.git: 2 commits - sysui/desktop vcl/generic vcl/inc vcl/unx
LuboÅ¡ LuÅák
l.lunak at suse.cz
Thu Jun 6 09:35:48 PDT 2013
sysui/desktop/menus/base.desktop | 1 +
sysui/desktop/menus/calc.desktop | 1 +
sysui/desktop/menus/draw.desktop | 1 +
sysui/desktop/menus/impress.desktop | 1 +
sysui/desktop/menus/math.desktop | 1 +
sysui/desktop/menus/startcenter.desktop | 1 +
sysui/desktop/menus/writer.desktop | 1 +
vcl/generic/app/gensys.cxx | 16 ++++------------
vcl/inc/generic/gensys.h | 1 -
vcl/unx/generic/window/salframe.cxx | 2 +-
vcl/unx/gtk/window/gtksalframe.cxx | 2 +-
11 files changed, 13 insertions(+), 15 deletions(-)
New commits:
commit bd40bfd897f193857de10f64bbc47909c4ea5757
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Thu Jun 6 18:34:20 2013 +0200
fix WM_CLASS
VCLSalFrame is definitely not the name of any instance of LibreOffice.
Change-Id: Iba227061c0c0541290c90876c94d1016aa1e783e
diff --git a/vcl/generic/app/gensys.cxx b/vcl/generic/app/gensys.cxx
index 68d2192..c65f0e5 100644
--- a/vcl/generic/app/gensys.cxx
+++ b/vcl/generic/app/gensys.cxx
@@ -29,6 +29,7 @@
#include <rtl/bootstrap.hxx>
#include <osl/process.h>
#include <osl/thread.h>
+#include <unotools/configmgr.hxx>
#include "vcl/unohelp.hxx"
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -179,7 +180,8 @@ const char* SalGenericSystem::getFrameResName()
aResName.append( pEnv );
}
if( !aResName.getLength() )
- aResName.append( "VCLSalFrame" );
+ aResName.append( OUStringToOString( utl::ConfigManager::getProductName().toAsciiLowerCase(),
+ osl_getThreadTextEncoding()));
}
return aResName.getStr();
}
@@ -198,21 +200,11 @@ const char* SalGenericSystem::getFrameClassName()
if( !aProduct.isEmpty() )
aClassName.append( OUStringToOString( aProduct, osl_getThreadTextEncoding() ) );
else
- aClassName.append( "VCLSalFrame" );
+ aClassName.append( OUStringToOString( utl::ConfigManager::getProductName(), osl_getThreadTextEncoding()));
}
return aClassName.getStr();
}
-OString SalGenericSystem::getFrameResName( SalExtStyle nStyle )
-{
- OStringBuffer aBuf( 64 );
- aBuf.append( getFrameResName() );
- if( (nStyle & SAL_FRAME_EXT_STYLE_DOCUMENT) )
- aBuf.append( ".DocumentWindow" );
-
- return aBuf.makeStringAndClear();
-}
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/generic/gensys.h b/vcl/inc/generic/gensys.h
index d60cc17..25d73a0 100644
--- a/vcl/inc/generic/gensys.h
+++ b/vcl/inc/generic/gensys.h
@@ -47,7 +47,6 @@ class VCL_DLLPUBLIC SalGenericSystem : public SalSystem
// Simple helpers for X11 WM_CLASS hints
static const char *getFrameResName();
static const char *getFrameClassName();
- static OString getFrameResName( SalExtStyle nStyle );
#endif
};
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 374fce0..0ef369e 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -2042,7 +2042,7 @@ void X11SalFrame::SetApplicationID( const OUString &rWMClass )
void X11SalFrame::updateWMClass()
{
XClassHint* pClass = XAllocClassHint();
- OString aResName = SalGenericSystem::getFrameResName( mnExtStyle );
+ OString aResName = SalGenericSystem::getFrameResName();
pClass->res_name = const_cast<char*>(aResName.getStr());
OString aResClass = OUStringToOString(m_sWMClass, RTL_TEXTENCODING_ASCII_US);
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 0f53e93..254437f 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -2170,7 +2170,7 @@ void GtkSalFrame::updateWMClass()
if( IS_WIDGET_REALIZED( m_pWindow ) )
{
XClassHint* pClass = XAllocClassHint();
- OString aResName = SalGenericSystem::getFrameResName( m_nExtStyle );
+ OString aResName = SalGenericSystem::getFrameResName();
pClass->res_name = const_cast<char*>(aResName.getStr());
pClass->res_class = const_cast<char*>(pResClass);
XSetClassHint( display,
commit 4d479ebf1511fd0c2b8bff0f6aa26305709aa338
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Thu Jun 6 18:28:07 2013 +0200
add StartupWMClass= to .desktop files (bnc#777070)
The actual purpose is to help Plasma taskbar associate taskbar items
with .desktop files for the purpose of creating launchers. LibreOffice's
WM_CLASS handling is rather broken, but the class part of it usually
ends up being 'libreoffice-<component>', which however doesn't match
names of .desktop files or executables. I fear renaming .desktop files
would cause too much breakages in various places that expect the current
names, so adding StartupWMClass will help Plasma match them.
Change-Id: Ia946307b429d9a7c00408b2b508726fdc88908ac
diff --git a/sysui/desktop/menus/base.desktop b/sysui/desktop/menus/base.desktop
index 5756260..d21293d 100755
--- a/sysui/desktop/menus/base.desktop
+++ b/sysui/desktop/menus/base.desktop
@@ -31,6 +31,7 @@ X-GIO-NoFuse=true
Keywords=Data;SQL;
InitialPreference=5
X-Ayatana-Desktop-Shortcuts=X-New
+StartupWMClass=libreoffice-base
[X-New Shortcut Group]
UnityQuicklist=New Database
Exec=libreoffice --base %%FILE%%
diff --git a/sysui/desktop/menus/calc.desktop b/sysui/desktop/menus/calc.desktop
index 81be9a8..a259fd0 100755
--- a/sysui/desktop/menus/calc.desktop
+++ b/sysui/desktop/menus/calc.desktop
@@ -31,6 +31,7 @@ X-GIO-NoFuse=true
Keywords=Accounting;Stats;OpenDocument Spreadsheet;Chart;Microsoft Excel;Microsoft Works;OpenOffice Calc;ods;xls;xlsx;
InitialPreference=5
X-Ayatana-Desktop-Shortcuts=X-New
+StartupWMClass=libreoffice-calc
[X-New Shortcut Group]
UnityQuicklist=New Spreadsheet
Exec=libreoffice --calc %%FILE%%
diff --git a/sysui/desktop/menus/draw.desktop b/sysui/desktop/menus/draw.desktop
index 9e56d05..11acf93 100755
--- a/sysui/desktop/menus/draw.desktop
+++ b/sysui/desktop/menus/draw.desktop
@@ -31,6 +31,7 @@ X-GIO-NoFuse=true
Keywords=Vector;Schema;Diagram;Layout;OpenDocument Graphics;Microsoft Publisher;Corel Draw;cdr;odg;svg;
InitialPreference=5
X-Ayatana-Desktop-Shortcuts=X-New
+StartupWMClass=libreoffice-draw
[X-New Shortcut Group]
UnityQuicklist=New Drawing
Exec=libreoffice --draw %%FILE%%
diff --git a/sysui/desktop/menus/impress.desktop b/sysui/desktop/menus/impress.desktop
index 10c9cec..91ec579 100755
--- a/sysui/desktop/menus/impress.desktop
+++ b/sysui/desktop/menus/impress.desktop
@@ -31,6 +31,7 @@ X-GIO-NoFuse=true
Keywords=Slideshow;Slides;OpenDocument Presentation;Microsoft PowerPoint;Microsoft Works;OpenOffice Impress;odp;ppt;pptx;
InitialPreference=5
X-Ayatana-Desktop-Shortcuts=X-New
+StartupWMClass=libreoffice-impress
[X-New Shortcut Group]
UnityQuicklist=New Presentation
Exec=libreoffice --impress %%FILE%%
diff --git a/sysui/desktop/menus/math.desktop b/sysui/desktop/menus/math.desktop
index 2e0d344..00f2fd5 100755
--- a/sysui/desktop/menus/math.desktop
+++ b/sysui/desktop/menus/math.desktop
@@ -32,6 +32,7 @@ X-GIO-NoFuse=true
Keywords=Equation;OpenDocument Formula;Formula;odf;
InitialPreference=5
X-Ayatana-Desktop-Shortcuts=X-New
+StartupWMClass=libreoffice-math
[X-New Shortcut Group]
UnityQuicklist=New Formula
Exec=libreoffice --math %%FILE%%
diff --git a/sysui/desktop/menus/startcenter.desktop b/sysui/desktop/menus/startcenter.desktop
index d8b0f1a..9312def 100755
--- a/sysui/desktop/menus/startcenter.desktop
+++ b/sysui/desktop/menus/startcenter.desktop
@@ -29,3 +29,4 @@ GenericName=Office
Comment=The office productivity suite compatible to the open and standardized ODF document format. Supported by The Document Foundation.
StartupNotify=true
X-GIO-NoFuse=true
+StartupWMClass=libreoffice-startcenter
diff --git a/sysui/desktop/menus/writer.desktop b/sysui/desktop/menus/writer.desktop
index 1eef64e..202daba 100755
--- a/sysui/desktop/menus/writer.desktop
+++ b/sysui/desktop/menus/writer.desktop
@@ -31,6 +31,7 @@ X-GIO-NoFuse=true
Keywords=Text;Letter;Fax;Document;OpenDocument Text;Microsoft Word;Microsoft Works;Lotus WordPro;OpenOffice Writer;CV;odt;doc;docx;rtf;
InitialPreference=5
X-Ayatana-Desktop-Shortcuts=X-New
+StartupWMClass=libreoffice-writer
[X-New Shortcut Group]
UnityQuicklist=New Document
Exec=libreoffice --writer %%FILE%%
More information about the Libreoffice-commits
mailing list