Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Revert "Prevent libreoffice global from clearing after `window.clos…
Browse files Browse the repository at this point in the history
…e()`" (#133)
  • Loading branch information
AlexJubs authored Feb 22, 2024
2 parents e50fa23 + 818f429 commit 79df156
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ jobs:
- name: Windows x64
os: macro-windows
runner: WINDOWS_RUNNER_INSTANCE_ID
working_dir: el
- name: Linux x64
os: macro-linux
runner: LINUX_RUNNER_INSTANCE_ID
working_dir: el
name: Build for ${{ matrix.name }}
uses: ./.github/workflows/build.yml
with:
Expand Down
1 change: 0 additions & 1 deletion qa/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
</div>
<div style="display: flex">
<button type="button" onclick="iframewin()">Open iframe win</button>
<button type="button" onclick="closeiframewin()">Close iframe win</button>
<!-- <button type="button" onclick="applyDefinitions()">Apply definitions</button> -->
<!-- <button type="button" onclick="gotoOverlay()">Go To Overlay</button> -->
</div>
Expand Down
6 changes: 1 addition & 5 deletions qa/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,13 @@ function insertTable() {
Col: { value: 3, type: 'long' },
});
}
let winhandle;
function iframewin() {
const url = 'https://github.com/coparse-inc/electron-libreoffice';
winhandle = window.open('about:blank', 'bug_dialog', 'nodeIntegration=no');
const winhandle = window.open('about:blank', 'bug_dialog', 'nodeIntegration=no');
winhandle.focus();
const iFrameStyle =
'position:fixed; top:0; left:0; bottom:0; right:0; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;';
winhandle.document.write(
`<iframe src="${url}" style="${iFrameStyle}"}></iframe>`
);
}
function closeiframewin() {
winhandle.close();
}
11 changes: 3 additions & 8 deletions src/electron/office/office_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ static void GetOfficeHandle(v8::Local<v8::Name> name,
}
} // namespace

base::AtomicRefCount g_client_counter{0};

// static
void OfficeClient::InstallToContext(v8::Local<v8::Context> context) {
v8::Context::Scope context_scope(context);
Expand All @@ -104,7 +102,6 @@ void OfficeClient::InstallToContext(v8::Local<v8::Context> context) {
GetOfficeHandle, nullptr, v8::MaybeLocal<v8::Value>(),
v8::AccessControl::ALL_CAN_READ, v8::PropertyAttribute::ReadOnly)
.Check();
g_client_counter.Increment();
}

void OfficeClient::Unset() {
Expand All @@ -114,11 +111,9 @@ void OfficeClient::Unset() {

// static
void OfficeClient::RemoveFromContext(v8::Local<v8::Context> /*context*/) {
if (!g_client_counter.Decrement()) {
if (lazy_tls->Get())
lazy_tls->Get()->Unset();
lazy_tls->Set(nullptr);
}
if (lazy_tls->Get())
lazy_tls->Get()->Unset();
lazy_tls->Set(nullptr);
}

OfficeClient::OfficeClient()
Expand Down

0 comments on commit 79df156

Please sign in to comment.