mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 727940 - Windows app can't read Firefox setting for hardware acceleration (D2D), r=marcoz, tbsaunde
This commit is contained in:
parent
614603a7a2
commit
e08f8dd3b6
@ -42,6 +42,8 @@
|
||||
|
||||
#include "AccessibleApplication_i.c"
|
||||
|
||||
#include "nsIGfxInfo.h"
|
||||
#include "nsIPersistentProperties2.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@ -49,6 +51,31 @@
|
||||
NS_IMPL_ISUPPORTS_INHERITED0(nsApplicationAccessibleWrap,
|
||||
nsApplicationAccessible)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsApplicationAccessibleWrap::GetAttributes(nsIPersistentProperties** aAttributes)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aAttributes);
|
||||
*aAttributes = nsnull;
|
||||
|
||||
nsCOMPtr<nsIPersistentProperties> attributes =
|
||||
do_CreateInstance(NS_PERSISTENTPROPERTIES_CONTRACTID);
|
||||
NS_ENSURE_STATE(attributes);
|
||||
|
||||
nsCOMPtr<nsIGfxInfo> gfxInfo = do_GetService("@mozilla.org/gfx/info;1");
|
||||
if (gfxInfo) {
|
||||
bool isD2DEnabled = false;
|
||||
gfxInfo->GetD2DEnabled(&isD2DEnabled);
|
||||
nsAutoString unused;
|
||||
attributes->SetStringProperty(
|
||||
NS_LITERAL_CSTRING("D2D"),
|
||||
isD2DEnabled ? NS_LITERAL_STRING("true") : NS_LITERAL_STRING("false"),
|
||||
unused);
|
||||
}
|
||||
|
||||
attributes.swap(*aAttributes);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// IUnknown
|
||||
|
||||
|
@ -52,6 +52,9 @@ public:
|
||||
// nsISupporst
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIAccessible
|
||||
NS_IMETHOD GetAttributes(nsIPersistentProperties** aAttributes);
|
||||
|
||||
// IUnknown
|
||||
STDMETHODIMP QueryInterface(REFIID, void**);
|
||||
|
||||
|
@ -96,6 +96,15 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=558036
|
||||
testAttrs("th2", { "abbr": "SS#" }, true);
|
||||
testAttrs("th2", { "axis": "social" }, true);
|
||||
|
||||
// application accessible
|
||||
if (WIN) {
|
||||
var gfxInfo = Components.classes["@mozilla.org/gfx/info;1"].
|
||||
getService(Components.interfaces.nsIGfxInfo);
|
||||
var attrs = {
|
||||
"D2D": (gfxInfo.D2DEnabled ? "true" : "false")
|
||||
}
|
||||
testAttrs(getApplicationAccessible(), attrs, false);
|
||||
}
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user