diff options
author | raveit65 (via Travis CI) <[email protected]> | 2024-08-21 19:15:53 +0000 |
---|---|---|
committer | raveit65 (via Travis CI) <[email protected]> | 2024-08-21 19:15:53 +0000 |
commit | 6f228fcf7ac0b0b1ba58f3908e48fab4c78e9c4c (patch) | |
tree | 097793701fb811b0156cd0b327f3a5de5c56d289 /2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish | |
download | mate-session-manager-6f228fcf7ac0b0b1ba58f3908e48fab4c78e9c4c.tar.bz2 mate-session-manager-6f228fcf7ac0b0b1ba58f3908e48fab4c78e9c4c.tar.xz |
Deploy mate-desktop/mate-session-manager to github.com/mate-desktop/mate-session-manager.git:gh-pagesgh-pages
Diffstat (limited to '2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish')
28 files changed, 39354 insertions, 0 deletions
diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/index.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/index.html new file mode 100644 index 0000000..025a4ed --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/index.html @@ -0,0 +1,173 @@ +<html> +<head> +<title>rootdir - scan-build results</title> +<link type="text/css" rel="stylesheet" href="scanview.css"/> +<script src="sorttable.js"></script> +<script language='javascript' type="text/javascript"> +function SetDisplay(RowClass, DisplayVal) +{ + var Rows = document.getElementsByTagName("tr"); + for ( var i = 0 ; i < Rows.length; ++i ) { + if (Rows[i].className == RowClass) { + Rows[i].style.display = DisplayVal; + } + } +} + +function CopyCheckedStateToCheckButtons(SummaryCheckButton) { + var Inputs = document.getElementsByTagName("input"); + for ( var i = 0 ; i < Inputs.length; ++i ) { + if (Inputs[i].type == "checkbox") { + if(Inputs[i] != SummaryCheckButton) { + Inputs[i].checked = SummaryCheckButton.checked; + Inputs[i].onclick(); + } + } + } +} + +function returnObjById( id ) { + if (document.getElementById) + var returnVar = document.getElementById(id); + else if (document.all) + var returnVar = document.all[id]; + else if (document.layers) + var returnVar = document.layers[id]; + return returnVar; +} + +var NumUnchecked = 0; + +function ToggleDisplay(CheckButton, ClassName) { + if (CheckButton.checked) { + SetDisplay(ClassName, ""); + if (--NumUnchecked == 0) { + returnObjById("AllBugsCheck").checked = true; + } + } + else { + SetDisplay(ClassName, "none"); + NumUnchecked++; + returnObjById("AllBugsCheck").checked = false; + } +} +</script> +<!-- SUMMARYENDHEAD --> +</head> +<body> +<h1>rootdir - scan-build results</h1> + +<table> +<tr><th>User:</th><td>root@5ac8d73070ba</td></tr> +<tr><th>Working Directory:</th><td>/rootdir</td></tr> +<tr><th>Command Line:</th><td>make -j 2</td></tr> +<tr><th>Clang Version:</th><td>clang version 18.1.6 (Fedora 18.1.6-3.fc40) +</td></tr> +<tr><th>Date:</th><td>Wed Aug 21 19:13:47 2024</td></tr> +</table> +<h2>Bug Summary</h2><table> +<thead><tr><td>Bug Type</td><td>Quantity</td><td class="sorttable_nosort">Display?</td></tr></thead> +<tr style="font-weight:bold"><td class="SUMM_DESC">All Bugs</td><td class="Q">25</td><td><center><input type="checkbox" id="AllBugsCheck" onClick="CopyCheckedStateToCheckButtons(this);" checked/></center></td></tr> +<tr><th>Logic error</th><th colspan=2></th></tr> +<tr><td class="SUMM_DESC">Cast from non-struct type to struct type</td><td class="Q">2</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_logic_error_cast_from_non-struct_type_to_struct_type');" checked/></center></td></tr> +<tr><td class="SUMM_DESC">Dereference of undefined pointer value</td><td class="Q">1</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_logic_error_dereference_of_undefined_pointer_value');" checked/></center></td></tr> +<tr><td class="SUMM_DESC">Out-of-bound access</td><td class="Q">1</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_logic_error_out-of-bound_access');" checked/></center></td></tr> +<tr><td class="SUMM_DESC">Uninitialized argument value</td><td class="Q">1</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_logic_error_uninitialized_argument_value');" checked/></center></td></tr> +<tr><td class="SUMM_DESC">Use fixed address</td><td class="Q">1</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_logic_error_use_fixed_address');" checked/></center></td></tr> +<tr><th>Unused code</th><th colspan=2></th></tr> +<tr><td class="SUMM_DESC">Dead assignment</td><td class="Q">5</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_unused_code_dead_assignment');" checked/></center></td></tr> +<tr><td class="SUMM_DESC">Unreachable code</td><td class="Q">14</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_unused_code_unreachable_code');" checked/></center></td></tr> +</table> +<h2>Reports</h2> + +<table class="sortable" style="table-layout:automatic"> +<thead><tr> + <td>Bug Group</td> + <td class="sorttable_sorted">Bug Type<span id="sorttable_sortfwdind"> ▾</span></td> + <td>File</td> + <td>Function/Method</td> + <td class="Q">Line</td> + <td class="Q">Path Length</td> + <td class="sorttable_nosort"></td> + <!-- REPORTBUGCOL --> +</tr></thead> +<tbody> +<tr class="bt_logic_error_cast_from_non-struct_type_to_struct_type"><td class="DESC">Logic error</td><td class="DESC">Cast from non-struct type to struct type</td><td>mate-submodules/libegg/eggsmclient-xsmp.c</td><td class="DESC">array_prop</td><td class="Q">1199</td><td class="Q">1</td><td><a href="report-b8f564.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-b8f564.html" --> +</tr> +<tr class="bt_logic_error_cast_from_non-struct_type_to_struct_type"><td class="DESC">Logic error</td><td class="DESC">Cast from non-struct type to struct type</td><td>mate-submodules/libegg/eggsmclient-xsmp.c</td><td class="DESC">ptrarray_prop</td><td class="Q">1232</td><td class="Q">1</td><td><a href="report-cf3974.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-cf3974.html" --> +</tr> +<tr class="bt_unused_code_dead_assignment"><td class="DESC">Unused code</td><td class="DESC">Dead assignment</td><td>mate-session/gsm-consolekit.c</td><td class="DESC">get_current_seat_id</td><td class="Q">675</td><td class="Q">1</td><td><a href="report-1f1edf.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-1f1edf.html" --> +</tr> +<tr class="bt_unused_code_dead_assignment"><td class="DESC">Unused code</td><td class="DESC">Dead assignment</td><td>mate-session/gsm-logout-dialog.c</td><td class="DESC">gsm_logout_supports_system_suspend</td><td class="Q">197</td><td class="Q">1</td><td><a href="report-37d955.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-37d955.html" --> +</tr> +<tr class="bt_unused_code_dead_assignment"><td class="DESC">Unused code</td><td class="DESC">Dead assignment</td><td>mate-session/gsm-logout-dialog.c</td><td class="DESC">gsm_logout_supports_system_hibernate</td><td class="Q">211</td><td class="Q">1</td><td><a href="report-615882.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-615882.html" --> +</tr> +<tr class="bt_unused_code_dead_assignment"><td class="DESC">Unused code</td><td class="DESC">Dead assignment</td><td>mate-session/main.c</td><td class="DESC">signal_cb</td><td class="Q">438</td><td class="Q">1</td><td><a href="report-f291f4.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-f291f4.html" --> +</tr> +<tr class="bt_unused_code_dead_assignment"><td class="DESC">Unused code</td><td class="DESC">Dead assignment</td><td>mate-session/gsm-manager.c</td><td class="DESC">maybe_restart_user_bus</td><td class="Q">919</td><td class="Q">1</td><td><a href="report-fc5e64.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-fc5e64.html" --> +</tr> +<tr class="bt_logic_error_dereference_of_undefined_pointer_value"><td class="DESC">Logic error</td><td class="DESC">Dereference of undefined pointer value</td><td>capplet/gsm-app-dialog.c</td><td class="DESC">gsm_app_dialog_run</td><td class="Q">576</td><td class="Q">10</td><td><a href="report-7c304e.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-7c304e.html" --> +</tr> +<tr class="bt_logic_error_out-of-bound_access"><td class="DESC">Logic error</td><td class="DESC">Out-of-bound access</td><td>mate-session/main.c</td><td class="DESC">require_dbus_session</td><td class="Q">518</td><td class="Q">15</td><td><a href="report-5a3b3a.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-5a3b3a.html" --> +</tr> +<tr class="bt_logic_error_uninitialized_argument_value"><td class="DESC">Logic error</td><td class="DESC">Uninitialized argument value</td><td>capplet/gsm-app-dialog.c</td><td class="DESC">gsm_app_dialog_run</td><td class="Q">583</td><td class="Q">12</td><td><a href="report-27b446.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-27b446.html" --> +</tr> +<tr class="bt_unused_code_unreachable_code"><td class="DESC">Unused code</td><td class="DESC">Unreachable code</td><td>capplet/main.c</td><td class="DESC">main</td><td class="Q">89</td><td class="Q">1</td><td><a href="report-0bc662.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-0bc662.html" --> +</tr> +<tr class="bt_unused_code_unreachable_code"><td class="DESC">Unused code</td><td class="DESC">Unreachable code</td><td>tools/mate-session-save.c</td><td class="DESC">main</td><td class="Q">275</td><td class="Q">1</td><td><a href="report-156f0d.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-156f0d.html" --> +</tr> +<tr class="bt_unused_code_unreachable_code"><td class="DESC">Unused code</td><td class="DESC">Unreachable code</td><td>tools/mate-session-save.c</td><td class="DESC">main</td><td class="Q">229</td><td class="Q">1</td><td><a href="report-16cb4d.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-16cb4d.html" --> +</tr> +<tr class="bt_unused_code_unreachable_code"><td class="DESC">Unused code</td><td class="DESC">Unreachable code</td><td>tools/mate-session-save.c</td><td class="DESC">main</td><td class="Q">254</td><td class="Q">1</td><td><a href="report-1f463e.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-1f463e.html" --> +</tr> +<tr class="bt_unused_code_unreachable_code"><td class="DESC">Unused code</td><td class="DESC">Unreachable code</td><td>tools/mate-session-save.c</td><td class="DESC">main</td><td class="Q">259</td><td class="Q">1</td><td><a href="report-4cf1eb.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-4cf1eb.html" --> +</tr> +<tr class="bt_unused_code_unreachable_code"><td class="DESC">Unused code</td><td class="DESC">Unreachable code</td><td>tools/mate-session-save.c</td><td class="DESC">main</td><td class="Q">279</td><td class="Q">1</td><td><a href="report-5ded7d.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-5ded7d.html" --> +</tr> +<tr class="bt_unused_code_unreachable_code"><td class="DESC">Unused code</td><td class="DESC">Unreachable code</td><td>mate-session/mdm-signal-handler.c</td><td class="DESC">signal_handler</td><td class="Q">279</td><td class="Q">1</td><td><a href="report-836628.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-836628.html" --> +</tr> +<tr class="bt_unused_code_unreachable_code"><td class="DESC">Unused code</td><td class="DESC">Unreachable code</td><td>tools/mate-session-check-accelerated-gl-helper.c</td><td class="DESC">main</td><td class="Q">505</td><td class="Q">1</td><td><a href="report-88d32f.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-88d32f.html" --> +</tr> +<tr class="bt_unused_code_unreachable_code"><td class="DESC">Unused code</td><td class="DESC">Unreachable code</td><td>mate-session/gsm-manager.c</td><td class="DESC">gsm_manager_new</td><td class="Q">2932</td><td class="Q">1</td><td><a href="report-a80670.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-a80670.html" --> +</tr> +<tr class="bt_unused_code_unreachable_code"><td class="DESC">Unused code</td><td class="DESC">Unreachable code</td><td>tools/mate-session-check-accelerated-gl-helper.c</td><td class="DESC">main</td><td class="Q">462</td><td class="Q">1</td><td><a href="report-bd4e55.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-bd4e55.html" --> +</tr> +<tr class="bt_unused_code_unreachable_code"><td class="DESC">Unused code</td><td class="DESC">Unreachable code</td><td>tools/mate-session-save.c</td><td class="DESC">main</td><td class="Q">283</td><td class="Q">1</td><td><a href="report-cd0613.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-cd0613.html" --> +</tr> +<tr class="bt_unused_code_unreachable_code"><td class="DESC">Unused code</td><td class="DESC">Unreachable code</td><td>tools/mate-session-save.c</td><td class="DESC">main</td><td class="Q">271</td><td class="Q">1</td><td><a href="report-d9bc25.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-d9bc25.html" --> +</tr> +<tr class="bt_unused_code_unreachable_code"><td class="DESC">Unused code</td><td class="DESC">Unreachable code</td><td>tools/mate-session-check-accelerated-gl-helper.c</td><td class="DESC">main</td><td class="Q">508</td><td class="Q">1</td><td><a href="report-e4efad.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-e4efad.html" --> +</tr> +<tr class="bt_unused_code_unreachable_code"><td class="DESC">Unused code</td><td class="DESC">Unreachable code</td><td>tools/mate-session-check-accelerated-gles-helper.c</td><td class="DESC">main</td><td class="Q">223</td><td class="Q">1</td><td><a href="report-f05804.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-f05804.html" --> +</tr> +<tr class="bt_logic_error_use_fixed_address"><td class="DESC">Logic error</td><td class="DESC">Use fixed address</td><td>mate-session/main.c</td><td class="DESC">main</td><td class="Q">628</td><td class="Q">3</td><td><a href="report-abdc03.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-abdc03.html" --> +</tr> +</tbody> +</table> + +</body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-0bc662.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-0bc662.html new file mode 100644 index 0000000..132b372 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-0bc662.html @@ -0,0 +1,780 @@ +<!doctype html> +<html> +<head> +<title>main.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC This statement is never executed --> + +<!-- BUGTYPE Unreachable code --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/capplet/main.c --> + +<!-- FILENAME main.c --> + +<!-- FUNCTIONNAME main --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 0bc6628fc93645ffffa3356e0cd639d2 --> + +<!-- BUGLINE 89 --> + +<!-- BUGCOLUMN 3 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>capplet/main.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 89, column 3</a><br />This statement is never executed</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/capplet -fcoverage-compilation-dir=/rootdir/capplet -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/freetype2 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/harfbuzz -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -I ../mate-session -D LOCALE_DIR="/usr/local/share/locale" -D GTKBUILDER_DIR="/usr/local/share/mate-session-manager" -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c main.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"89": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* main.c</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 1999 Free Software Foundation, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Copyright (C) 2008 Lucas Rocha.</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* This program is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU General Public License as</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* published by the Free Software Foundation; either version 2 of the</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>* License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful, but</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>* Lesser General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>* 02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <config.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include "gsm-properties-dialog.h"</span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"><span class='keyword'>static</span> gboolean show_version = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='keyword'>static</span> GOptionEntry options[] = {</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> {<span class='string_literal'>"version"</span>, 0, 0, G_OPTION_ARG_NONE, &show_version, <span class='macro'>N_(<span class='string_literal'>"Version of this application"</span>)<span class='macro_popup'>("Version of this application")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> {<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, 0, 0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>}</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> dialog_response(GsmPropertiesDialog* dialog, guint response_id, gpointer data)</td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> <span class='keyword'>if</span> (response_id == GTK_RESPONSE_HELP)</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> gtk_show_uri_on_window (<span class='macro'>GTK_WINDOW (dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>, <span class='string_literal'>"help:mate-user-guide/gosstartsession-2"</span>,</td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"> gtk_get_current_event_time (), &error);</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> GtkWidget* d = gtk_message_dialog_new(<span class='macro'>GTK_WINDOW(dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, <span class='string_literal'>"%s"</span>, <span class='macro'>_(<span class='string_literal'>"Could not display help document"</span>)<span class='macro_popup'>gettext ("Could not display help document")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> gtk_message_dialog_format_secondary_text(<span class='macro'>GTK_MESSAGE_DIALOG(d)<span class='macro_popup'>((((GtkMessageDialog*) (void *) g_type_check_instance_cast ((<br>GTypeInstance*) ((d)), ((gtk_message_dialog_get_type ()))))))</span></span>, <span class='string_literal'>"%s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> g_error_free(error);</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> gtk_dialog_run(<span class='macro'>GTK_DIALOG (d)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((d)), ((gtk_dialog_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> gtk_widget_destroy(d);</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> gtk_widget_destroy(<span class='macro'>GTK_WIDGET (dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_widget_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> gtk_main_quit();</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"><span class='keyword'>int</span> main(<span class='keyword'>int</span> argc, <span class='keyword'>char</span>* argv[])</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> GtkWidget* dialog;</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"><span class='directive'>#ifdef <span class='macro'>ENABLE_NLS<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> bindtextdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='macro'>LOCALE_DIR<span class='macro_popup'>"/usr/local/share/locale"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> bind_textdomain_codeset(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='string_literal'>"UTF-8"</span>);</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> textdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"><span class='directive'>#endif /* ENABLE_NLS */</span></td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> <span class='keyword'>if</span> (!gtk_init_with_args(&argc, &argv, <span class='macro'>_(<span class='string_literal'>"- MATE Session Properties"</span>)<span class='macro_popup'>gettext ("- MATE Session Properties")</span></span>, options, <span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, &error))</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> g_warning(<span class='string_literal'>"Unable to start: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> g_error_free(error);</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='keyword'>return</span> 1;</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> <span class='keyword'>if</span> (show_version)</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> <span class="mrange">g_print</span>(<span class='string_literal'>"%s %s\n"</span>, argv[0], <span class='macro'>VERSION<span class='macro_popup'>"1.28.0"</span></span>);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:17ex">This statement is never executed</div></td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> <span class='keyword'>return</span> 0;</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> dialog = gsm_properties_dialog_new();</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> <span class='macro'>g_signal_connect(dialog, <span class='string_literal'>"response"</span>, G_CALLBACK(dialog_response), NULL)<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>dialog_response))), (((void*)0)), ((void*)0), (GConnectFlags)<br> 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> gtk_widget_show(dialog);</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> gtk_main();</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> <span class='keyword'>return</span> 0;</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-156f0d.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-156f0d.html new file mode 100644 index 0000000..74f1826 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-156f0d.html @@ -0,0 +1,967 @@ +<!doctype html> +<html> +<head> +<title>mate-session-save.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC This statement is never executed --> + +<!-- BUGTYPE Unreachable code --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/tools/mate-session-save.c --> + +<!-- FILENAME mate-session-save.c --> + +<!-- FUNCTIONNAME main --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 156f0d0f4760c80ab12110078ea0b71c --> + +<!-- BUGLINE 275 --> + +<!-- BUGCOLUMN 3 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>tools/mate-session-save.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 275, column 3</a><br />This statement is never executed</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mate-session-save.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/tools -fcoverage-compilation-dir=/rootdir/tools -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -D LOCALE_DIR="/usr/local/share/locale" -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c mate-session-save.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"275": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* save-session.c - Small program to talk to session manager.</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>Copyright (C) 1998 Tom Tromey</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>Copyright (C) 2008 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>This program is free software; you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>it under the terms of the GNU General Public License as published by</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>the Free Software Foundation; either version 2, or (at your option)</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>any later version.</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"><span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <config.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_SERVICE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_PATH_DBUS<span class='macro_popup'>"/org/gnome/SessionManager"</span></span> "/org/gnome/SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_INTERFACE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_SERVICE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span> "org.mate.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_PATH_DBUS_OLD<span class='macro_popup'>"/org/mate/SessionManager"</span></span> "/org/mate/SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_INTERFACE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span> "org.mate.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> GSM_LOGOUT_MODE_NORMAL = 0,</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> GSM_LOGOUT_MODE_NO_CONFIRMATION,</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> GSM_LOGOUT_MODE_FORCE</td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='comment'>/* True if killing. This is deprecated, but we keep it for compatibility</span></td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> <span class='comment'>* reasons. */</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> gboolean kill_session = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"><span class='comment'>/* The real options that should be used now. They are not ambiguous. */</span></td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='keyword'>static</span> gboolean logout = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"><span class='keyword'>static</span> gboolean force_logout = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"><span class='keyword'>static</span> gboolean logout_dialog = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"><span class='keyword'>static</span> gboolean shutdown_dialog = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"><span class='comment'>/* True if we should use dialog boxes */</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"><span class='keyword'>static</span> gboolean show_error_dialogs = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"><span class='comment'>/* True if we should do the requested action without confirmation */</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"><span class='keyword'>static</span> gboolean no_interaction = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>char</span>* session_name = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"><span class='keyword'>static</span> GOptionEntry options[] = {</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> {<span class='string_literal'>"logout"</span>, '\0', 0, G_OPTION_ARG_NONE, &logout, <span class='macro'>N_(<span class='string_literal'>"Log out"</span>)<span class='macro_popup'>("Log out")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> {<span class='string_literal'>"force-logout"</span>, '\0', 0, G_OPTION_ARG_NONE, &force_logout, <span class='macro'>N_(<span class='string_literal'>"Log out, ignoring any existing inhibitors"</span>)<span class='macro_popup'>("Log out, ignoring any existing inhibitors")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> {<span class='string_literal'>"logout-dialog"</span>, '\0', 0, G_OPTION_ARG_NONE, &logout_dialog, <span class='macro'>N_(<span class='string_literal'>"Show logout dialog"</span>)<span class='macro_popup'>("Show logout dialog")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> {<span class='string_literal'>"shutdown-dialog"</span>, '\0', 0, G_OPTION_ARG_NONE, &shutdown_dialog, <span class='macro'>N_(<span class='string_literal'>"Show shutdown dialog"</span>)<span class='macro_popup'>("Show shutdown dialog")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> {<span class='string_literal'>"gui"</span>, '\0', 0, G_OPTION_ARG_NONE, &show_error_dialogs, <span class='macro'>N_(<span class='string_literal'>"Use dialog boxes for errors"</span>)<span class='macro_popup'>("Use dialog boxes for errors")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> <span class='comment'>/* deprecated options */</span></td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> {<span class='string_literal'>"session-name"</span>, 's', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &session_name, <span class='macro'>N_(<span class='string_literal'>"Set the current session name"</span>)<span class='macro_popup'>("Set the current session name")</span></span>, <span class='macro'>N_(<span class='string_literal'>"NAME"</span>)<span class='macro_popup'>("NAME")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> {<span class='string_literal'>"kill"</span>, '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &kill_session, <span class='macro'>N_(<span class='string_literal'>"Kill session"</span>)<span class='macro_popup'>("Kill session")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> {<span class='string_literal'>"silent"</span>, '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &no_interaction, <span class='macro'>N_(<span class='string_literal'>"Do not require confirmation"</span>)<span class='macro_popup'>("Do not require confirmation")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> {<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, 0, G_OPTION_ARG_NONE, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>}</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> display_error(<span class='keyword'>const</span> <span class='keyword'>char</span>* message)</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> <span class='keyword'>if</span> (show_error_dialogs && !no_interaction)</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> GtkWidget* dialog = gtk_message_dialog_new(<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, <span class='string_literal'>"%s"</span>, message);</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> gtk_window_set_default_icon_name (<span class='string_literal'>"dialog-error"</span>);</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> gtk_dialog_run(<span class='macro'>GTK_DIALOG(dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> gtk_widget_destroy(dialog);</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> g_printerr(<span class='string_literal'>"%s\n"</span>, message);</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"><span class='keyword'>static</span> GDBusProxy* get_sm_proxy(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> GDBusProxy *sm_proxy = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> sm_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> G_DBUS_PROXY_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> <span class='macro'>GSM_SERVICE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> <span class='macro'>GSM_PATH_DBUS<span class='macro_popup'>"/org/gnome/SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='macro'>GSM_INTERFACE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> g_warning (<span class='string_literal'>"Couldn't create DBus proxy: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> <span class='comment'>/* Try the old name - for the case when we've just upgraded from 1.10</span></td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> <span class='comment'>* so the old m-s-m is currently running */</span></td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> sm_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> G_DBUS_PROXY_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> <span class='macro'>GSM_SERVICE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='macro'>GSM_PATH_DBUS_OLD<span class='macro_popup'>"/org/mate/SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> <span class='macro'>GSM_INTERFACE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> <span class='comment'>/* Okay, it wasn't the upgrade case, so now we can give up. */</span></td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> display_error (<span class='macro'>_(<span class='string_literal'>"Could not connect to the session manager"</span>)<span class='macro_popup'>gettext ("Could not connect to the session manager")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> do_logout(<span class='keyword'>unsigned</span> <span class='keyword'>int</span> mode)</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> GDBusProxy* sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> GVariant *ret;</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> sm_proxy = get_sm_proxy ();</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> ret = g_dbus_proxy_call_sync (sm_proxy, <span class='string_literal'>"Logout"</span>,</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> g_variant_new (<span class='string_literal'>"(u)"</span>, mode),</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> G_DBUS_CALL_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> <span class='keyword'>if</span> (ret == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> g_warning (<span class='string_literal'>"Failed to call logout: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> g_variant_unref (ret);</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> <span class='keyword'>if</span> (sm_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> g_object_unref (sm_proxy);</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> do_shutdown_dialog(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> GDBusProxy* sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> GVariant *ret;</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> sm_proxy = get_sm_proxy ();</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> ret = g_dbus_proxy_call_sync (sm_proxy, <span class='string_literal'>"Shutdown"</span>,</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> g_variant_new (<span class='string_literal'>"()"</span>),</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> G_DBUS_CALL_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='keyword'>if</span> (ret == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> g_warning (<span class='string_literal'>"Failed to call shutdown: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> g_variant_unref (ret);</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='keyword'>if</span> (sm_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> g_object_unref (sm_proxy);</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"><span class='keyword'>int</span> main(<span class='keyword'>int</span> argc, <span class='keyword'>char</span>* argv[])</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='keyword'>int</span> conflicting_options;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> <span class='comment'>/* Initialize the i18n stuff */</span></td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"><span class='directive'>#ifdef <span class='macro'>ENABLE_NLS<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> bindtextdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='macro'>LOCALE_DIR<span class='macro_popup'>"/usr/local/share/locale"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> bind_textdomain_codeset(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='string_literal'>"UTF-8"</span>);</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> textdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"><span class='directive'>#endif /* ENABLE_NLS */</span></td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='keyword'>if</span> (!gtk_init_with_args(&argc, &argv, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, options, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &error))</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> g_warning(<span class='string_literal'>"Unable to start: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> g_error_free(error);</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> exit(1);</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> conflicting_options = 0;</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (kill_session)</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> <span class='keyword'>if</span> (logout)</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='keyword'>if</span> (force_logout)</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> <span class='keyword'>if</span> (logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>if</span> (shutdown_dialog)</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> <span class='keyword'>if</span> (conflicting_options > 1)</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> display_error(<span class='macro'>_(<span class='string_literal'>"Program called with conflicting options"</span>)<span class='macro_popup'>gettext ("Program called with conflicting options")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> <span class='keyword'>if</span> (kill_session)</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>if</span> (no_interaction)</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> force_logout = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> logout_dialog = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> <span class='keyword'>if</span> (logout)</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> do_logout(GSM_LOGOUT_MODE_NO_CONFIRMATION);</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (force_logout)</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> <span class="mrange">do_logout</span>(GSM_LOGOUT_MODE_FORCE);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:17ex">This statement is never executed</div></td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> do_logout(GSM_LOGOUT_MODE_NORMAL);</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (shutdown_dialog)</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> do_shutdown_dialog();</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> <span class='keyword'>return</span> 0;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-16cb4d.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-16cb4d.html new file mode 100644 index 0000000..62a0143 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-16cb4d.html @@ -0,0 +1,967 @@ +<!doctype html> +<html> +<head> +<title>mate-session-save.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC This statement is never executed --> + +<!-- BUGTYPE Unreachable code --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/tools/mate-session-save.c --> + +<!-- FILENAME mate-session-save.c --> + +<!-- FUNCTIONNAME main --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 16cb4dba793115d2101cc264152b6297 --> + +<!-- BUGLINE 229 --> + +<!-- BUGCOLUMN 3 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>tools/mate-session-save.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 229, column 3</a><br />This statement is never executed</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mate-session-save.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/tools -fcoverage-compilation-dir=/rootdir/tools -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -D LOCALE_DIR="/usr/local/share/locale" -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c mate-session-save.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"229": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* save-session.c - Small program to talk to session manager.</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>Copyright (C) 1998 Tom Tromey</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>Copyright (C) 2008 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>This program is free software; you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>it under the terms of the GNU General Public License as published by</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>the Free Software Foundation; either version 2, or (at your option)</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>any later version.</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"><span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <config.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_SERVICE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_PATH_DBUS<span class='macro_popup'>"/org/gnome/SessionManager"</span></span> "/org/gnome/SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_INTERFACE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_SERVICE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span> "org.mate.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_PATH_DBUS_OLD<span class='macro_popup'>"/org/mate/SessionManager"</span></span> "/org/mate/SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_INTERFACE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span> "org.mate.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> GSM_LOGOUT_MODE_NORMAL = 0,</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> GSM_LOGOUT_MODE_NO_CONFIRMATION,</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> GSM_LOGOUT_MODE_FORCE</td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='comment'>/* True if killing. This is deprecated, but we keep it for compatibility</span></td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> <span class='comment'>* reasons. */</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> gboolean kill_session = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"><span class='comment'>/* The real options that should be used now. They are not ambiguous. */</span></td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='keyword'>static</span> gboolean logout = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"><span class='keyword'>static</span> gboolean force_logout = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"><span class='keyword'>static</span> gboolean logout_dialog = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"><span class='keyword'>static</span> gboolean shutdown_dialog = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"><span class='comment'>/* True if we should use dialog boxes */</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"><span class='keyword'>static</span> gboolean show_error_dialogs = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"><span class='comment'>/* True if we should do the requested action without confirmation */</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"><span class='keyword'>static</span> gboolean no_interaction = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>char</span>* session_name = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"><span class='keyword'>static</span> GOptionEntry options[] = {</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> {<span class='string_literal'>"logout"</span>, '\0', 0, G_OPTION_ARG_NONE, &logout, <span class='macro'>N_(<span class='string_literal'>"Log out"</span>)<span class='macro_popup'>("Log out")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> {<span class='string_literal'>"force-logout"</span>, '\0', 0, G_OPTION_ARG_NONE, &force_logout, <span class='macro'>N_(<span class='string_literal'>"Log out, ignoring any existing inhibitors"</span>)<span class='macro_popup'>("Log out, ignoring any existing inhibitors")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> {<span class='string_literal'>"logout-dialog"</span>, '\0', 0, G_OPTION_ARG_NONE, &logout_dialog, <span class='macro'>N_(<span class='string_literal'>"Show logout dialog"</span>)<span class='macro_popup'>("Show logout dialog")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> {<span class='string_literal'>"shutdown-dialog"</span>, '\0', 0, G_OPTION_ARG_NONE, &shutdown_dialog, <span class='macro'>N_(<span class='string_literal'>"Show shutdown dialog"</span>)<span class='macro_popup'>("Show shutdown dialog")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> {<span class='string_literal'>"gui"</span>, '\0', 0, G_OPTION_ARG_NONE, &show_error_dialogs, <span class='macro'>N_(<span class='string_literal'>"Use dialog boxes for errors"</span>)<span class='macro_popup'>("Use dialog boxes for errors")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> <span class='comment'>/* deprecated options */</span></td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> {<span class='string_literal'>"session-name"</span>, 's', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &session_name, <span class='macro'>N_(<span class='string_literal'>"Set the current session name"</span>)<span class='macro_popup'>("Set the current session name")</span></span>, <span class='macro'>N_(<span class='string_literal'>"NAME"</span>)<span class='macro_popup'>("NAME")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> {<span class='string_literal'>"kill"</span>, '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &kill_session, <span class='macro'>N_(<span class='string_literal'>"Kill session"</span>)<span class='macro_popup'>("Kill session")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> {<span class='string_literal'>"silent"</span>, '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &no_interaction, <span class='macro'>N_(<span class='string_literal'>"Do not require confirmation"</span>)<span class='macro_popup'>("Do not require confirmation")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> {<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, 0, G_OPTION_ARG_NONE, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>}</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> display_error(<span class='keyword'>const</span> <span class='keyword'>char</span>* message)</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> <span class='keyword'>if</span> (show_error_dialogs && !no_interaction)</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> GtkWidget* dialog = gtk_message_dialog_new(<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, <span class='string_literal'>"%s"</span>, message);</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> gtk_window_set_default_icon_name (<span class='string_literal'>"dialog-error"</span>);</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> gtk_dialog_run(<span class='macro'>GTK_DIALOG(dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> gtk_widget_destroy(dialog);</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> g_printerr(<span class='string_literal'>"%s\n"</span>, message);</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"><span class='keyword'>static</span> GDBusProxy* get_sm_proxy(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> GDBusProxy *sm_proxy = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> sm_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> G_DBUS_PROXY_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> <span class='macro'>GSM_SERVICE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> <span class='macro'>GSM_PATH_DBUS<span class='macro_popup'>"/org/gnome/SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='macro'>GSM_INTERFACE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> g_warning (<span class='string_literal'>"Couldn't create DBus proxy: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> <span class='comment'>/* Try the old name - for the case when we've just upgraded from 1.10</span></td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> <span class='comment'>* so the old m-s-m is currently running */</span></td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> sm_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> G_DBUS_PROXY_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> <span class='macro'>GSM_SERVICE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='macro'>GSM_PATH_DBUS_OLD<span class='macro_popup'>"/org/mate/SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> <span class='macro'>GSM_INTERFACE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> <span class='comment'>/* Okay, it wasn't the upgrade case, so now we can give up. */</span></td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> display_error (<span class='macro'>_(<span class='string_literal'>"Could not connect to the session manager"</span>)<span class='macro_popup'>gettext ("Could not connect to the session manager")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> do_logout(<span class='keyword'>unsigned</span> <span class='keyword'>int</span> mode)</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> GDBusProxy* sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> GVariant *ret;</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> sm_proxy = get_sm_proxy ();</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> ret = g_dbus_proxy_call_sync (sm_proxy, <span class='string_literal'>"Logout"</span>,</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> g_variant_new (<span class='string_literal'>"(u)"</span>, mode),</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> G_DBUS_CALL_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> <span class='keyword'>if</span> (ret == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> g_warning (<span class='string_literal'>"Failed to call logout: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> g_variant_unref (ret);</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> <span class='keyword'>if</span> (sm_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> g_object_unref (sm_proxy);</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> do_shutdown_dialog(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> GDBusProxy* sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> GVariant *ret;</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> sm_proxy = get_sm_proxy ();</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> ret = g_dbus_proxy_call_sync (sm_proxy, <span class='string_literal'>"Shutdown"</span>,</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> g_variant_new (<span class='string_literal'>"()"</span>),</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> G_DBUS_CALL_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='keyword'>if</span> (ret == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> g_warning (<span class='string_literal'>"Failed to call shutdown: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> g_variant_unref (ret);</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='keyword'>if</span> (sm_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> g_object_unref (sm_proxy);</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"><span class='keyword'>int</span> main(<span class='keyword'>int</span> argc, <span class='keyword'>char</span>* argv[])</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='keyword'>int</span> conflicting_options;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> <span class='comment'>/* Initialize the i18n stuff */</span></td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"><span class='directive'>#ifdef <span class='macro'>ENABLE_NLS<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> bindtextdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='macro'>LOCALE_DIR<span class='macro_popup'>"/usr/local/share/locale"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> bind_textdomain_codeset(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='string_literal'>"UTF-8"</span>);</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> textdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"><span class='directive'>#endif /* ENABLE_NLS */</span></td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='keyword'>if</span> (!gtk_init_with_args(&argc, &argv, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, options, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &error))</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> g_warning(<span class='string_literal'>"Unable to start: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> g_error_free(error);</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> exit(1);</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> conflicting_options = 0;</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (kill_session)</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> <span class="mrange">conflicting_options</span>++;</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:17ex">This statement is never executed</div></td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> <span class='keyword'>if</span> (logout)</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='keyword'>if</span> (force_logout)</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> <span class='keyword'>if</span> (logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>if</span> (shutdown_dialog)</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> <span class='keyword'>if</span> (conflicting_options > 1)</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> display_error(<span class='macro'>_(<span class='string_literal'>"Program called with conflicting options"</span>)<span class='macro_popup'>gettext ("Program called with conflicting options")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> <span class='keyword'>if</span> (kill_session)</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>if</span> (no_interaction)</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> force_logout = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> logout_dialog = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> <span class='keyword'>if</span> (logout)</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> do_logout(GSM_LOGOUT_MODE_NO_CONFIRMATION);</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (force_logout)</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> do_logout(GSM_LOGOUT_MODE_FORCE);</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> do_logout(GSM_LOGOUT_MODE_NORMAL);</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (shutdown_dialog)</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> do_shutdown_dialog();</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> <span class='keyword'>return</span> 0;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-1f1edf.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-1f1edf.html new file mode 100644 index 0000000..e5992aa --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-1f1edf.html @@ -0,0 +1,1756 @@ +<!doctype html> +<html> +<head> +<title>gsm-consolekit.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Value stored to 'res' is never read --> + +<!-- BUGTYPE Dead assignment --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/mate-session/gsm-consolekit.c --> + +<!-- FILENAME gsm-consolekit.c --> + +<!-- FUNCTIONNAME get_current_seat_id --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 1f1edf596d4f8ad3c669f78ab3f8ba96 --> + +<!-- BUGLINE 675 --> + +<!-- BUGCOLUMN 17 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>mate-session/gsm-consolekit.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 675, column 17</a><br />Value stored to 'res' is never read</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name gsm-consolekit.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/mate-session -fcoverage-compilation-dir=/rootdir/mate-session -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -I /usr/include/uuid -I ../mate-submodules/libegg -D LOCALE_DIR="/usr/local/share/locale" -D DATA_DIR="/usr/local/share/mate-session" -D LIBEXECDIR="/usr/local/libexec" -D GTKBUILDER_DIR="/usr/local/share/mate-session-manager" -D I_KNOW_THE_DEVICEKIT_POWER_API_IS_SUBJECT_TO_CHANGE -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c gsm-consolekit.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"675": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2008 Jon McCann <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This program is free software; you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* it under the terms of the GNU General Public License as published by</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* the Free Software Foundation; either version 2, or (at your option)</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>* 02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"><span class='directive'>#include "config.h"</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <<span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span>.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <glib.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <glib-object.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include <dbus/dbus-glib.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"><span class='directive'>#include <dbus/dbus-glib-lowlevel.h></span></td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#include "gsm-marshal.h"</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#include "gsm-consolekit.h"</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"><span class='directive'>#define <span class='macro'>CK_NAME<span class='macro_popup'>"org.freedesktop.ConsoleKit"</span></span> "org.freedesktop.ConsoleKit"</span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#define <span class='macro'>CK_PATH<span class='macro_popup'>"/org/freedesktop/ConsoleKit"</span></span> "/org/freedesktop/ConsoleKit"</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>CK_INTERFACE<span class='macro_popup'>"org.freedesktop.ConsoleKit"</span></span> "org.freedesktop.ConsoleKit"</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='directive'>#define <span class='macro'>CK_MANAGER_PATH<span class='macro_popup'>"/org/freedesktop/ConsoleKit/Manager"</span></span> "/org/freedesktop/ConsoleKit/Manager"</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"><span class='directive'>#define <span class='macro'>CK_MANAGER_INTERFACE<span class='macro_popup'>"org.freedesktop.ConsoleKit.Manager"</span></span> "org.freedesktop.ConsoleKit.Manager"</span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"><span class='directive'>#define <span class='macro'>CK_SEAT_INTERFACE<span class='macro_popup'>"org.freedesktop.ConsoleKit.Seat"</span></span> "org.freedesktop.ConsoleKit.Seat"</span></td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"><span class='directive'>#define <span class='macro'>CK_SESSION_INTERFACE<span class='macro_popup'>"org.freedesktop.ConsoleKit.Session"</span></span> "org.freedesktop.ConsoleKit.Session"</span></td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span></td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> DBusGConnection *dbus_connection;</td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> DBusGProxy *bus_proxy;</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> DBusGProxy *ck_proxy;</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> guint32 is_connected : 1;</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line">} GsmConsolekitPrivate;</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> PROP_0,</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> PROP_IS_CONNECTED</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> REQUEST_COMPLETED = 0,</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> PRIVILEGES_COMPLETED,</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> LAST_SIGNAL</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"><span class='keyword'>static</span> guint signals[LAST_SIGNAL] = { 0 };</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> gsm_consolekit_finalize (GObject *object);</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> gsm_consolekit_free_dbus (GsmConsolekit *manager);</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"><span class='keyword'>static</span> DBusHandlerResult gsm_consolekit_dbus_filter (DBusConnection *connection,</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> DBusMessage *message,</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> <span class='keyword'>void</span> *user_data);</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> gsm_consolekit_on_name_owner_changed (DBusGProxy *bus_proxy,</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *name,</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *prev_owner,</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *new_owner,</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> GsmConsolekit *manager);</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"><span class='macro'>G_DEFINE_TYPE_WITH_PRIVATE (GsmConsolekit, gsm_consolekit, G_TYPE_OBJECT)<span class='macro_popup'>static void gsm_consolekit_init (GsmConsolekit *self); static<br> void gsm_consolekit_class_init (GsmConsolekitClass *klass); static<br> GType gsm_consolekit_get_type_once (void); static gpointer gsm_consolekit_parent_class<br> = ((void*)0); static gint GsmConsolekit_private_offset; static<br> void gsm_consolekit_class_intern_init (gpointer klass) { gsm_consolekit_parent_class<br> = g_type_class_peek_parent (klass); if (GsmConsolekit_private_offset<br> != 0) g_type_class_adjust_private_offset (klass, &GsmConsolekit_private_offset<br>); gsm_consolekit_class_init ((GsmConsolekitClass*) klass); }<br> __attribute__ ((__unused__)) static inline gpointer gsm_consolekit_get_instance_private<br> (GsmConsolekit *self) { return (((gpointer) ((guint8*) (self<br>) + (glong) (GsmConsolekit_private_offset)))); } GType gsm_consolekit_get_type<br> (void) { static GType static_g_define_type_id = 0; if ((__extension__<br> ({ _Static_assert (sizeof *(&static_g_define_type_id) ==<br> sizeof (gpointer), "Expression evaluates to false"); (void) (<br>0 ? (gpointer) * (&static_g_define_type_id) : ((void*)0))<br>; (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); __typeof__<br> (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__<br> ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id<br>); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)<br>; gapg_temp_newval; })) && g_once_init_enter_pointer (<br>&static_g_define_type_id)); })) ) { GType g_define_type_id<br> = gsm_consolekit_get_type_once (); (__extension__ ({ _Static_assert<br> (sizeof *(&static_g_define_type_id) == sizeof (gpointer)<br>, "Expression evaluates to false"); 0 ? (void) (*(&static_g_define_type_id<br>) = (g_define_type_id)) : (void) 0; g_once_init_leave_pointer<br> ((&static_g_define_type_id), (gpointer) (guintptr) (g_define_type_id<br>)); })) ; } return static_g_define_type_id; } __attribute__ (<br>(__noinline__)) static GType gsm_consolekit_get_type_once (void<br>) { GType g_define_type_id = g_type_register_static_simple ((<br>(GType) ((20) << (2))), g_intern_static_string ("GsmConsolekit"<br>), sizeof (GsmConsolekitClass), (GClassInitFunc)(void (*)(void<br>)) gsm_consolekit_class_intern_init, sizeof (GsmConsolekit), (<br>GInstanceInitFunc)(void (*)(void)) gsm_consolekit_init, (GTypeFlags<br>) 0); { {{ GsmConsolekit_private_offset = g_type_add_instance_private<br> (g_define_type_id, sizeof (GsmConsolekitPrivate)); };} } return<br> g_define_type_id; }</span></span>;</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line">gsm_consolekit_get_property (GObject *object,</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> GsmConsolekit *manager = GSM_CONSOLEKIT (object);</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> GsmConsolekitPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> priv = gsm_consolekit_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> <span class='keyword'>case</span> PROP_IS_CONNECTED:</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> g_value_set_boolean (value,</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> priv->is_connected);</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID (object,<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "gsm-consolekit.c", 104, ("property"), _glib__property_id, _glib__pspec<br>->name, g_type_name ((((((GTypeClass*) (((GTypeInstance*) (<br>_glib__pspec))->g_class))->g_type)))), (g_type_name (((<br>(((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span></td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> <span class='macro'>prop_id,<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "gsm-consolekit.c", 104, ("property"), _glib__property_id, _glib__pspec<br>->name, g_type_name ((((((GTypeClass*) (((GTypeInstance*) (<br>_glib__pspec))->g_class))->g_type)))), (g_type_name (((<br>(((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span></td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> <span class='macro'>pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "gsm-consolekit.c", 104, ("property"), _glib__property_id, _glib__pspec<br>->name, g_type_name ((((((GTypeClass*) (((GTypeInstance*) (<br>_glib__pspec))->g_class))->g_type)))), (g_type_name (((<br>(((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line">gsm_consolekit_class_init (GsmConsolekitClass *manager_class)</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> GObjectClass *object_class;</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> GParamSpec *param_spec;</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> object_class = <span class='macro'>G_OBJECT_CLASS (manager_class)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((manager_class)), (((GType) ((20) << (2))))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> object_class->finalize = gsm_consolekit_finalize;</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> object_class->get_property = gsm_consolekit_get_property;</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> param_spec = g_param_spec_boolean (<span class='string_literal'>"is-connected"</span>,</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='string_literal'>"Is connected"</span>,</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> <span class='string_literal'>"Whether the session is connected to ConsoleKit"</span>,</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> G_PARAM_READABLE);</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> g_object_class_install_property (object_class, PROP_IS_CONNECTED,</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> param_spec);</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> signals [REQUEST_COMPLETED] =</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> g_signal_new (<span class='string_literal'>"request-completed"</span>,</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> <span class='macro'>G_OBJECT_CLASS_TYPE (object_class)<span class='macro_popup'>((((GTypeClass*) (object_class))->g_type))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='macro'>G_STRUCT_OFFSET (GsmConsolekitClass, request_completed)<span class='macro_popup'>((glong) __builtin_offsetof(GsmConsolekitClass, request_completed<br>))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> g_cclosure_marshal_VOID__POINTER,</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> 1, <span class='macro'>G_TYPE_POINTER<span class='macro_popup'>((GType) ((17) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> signals [PRIVILEGES_COMPLETED] =</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> g_signal_new (<span class='string_literal'>"privileges-completed"</span>,</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> <span class='macro'>G_OBJECT_CLASS_TYPE (object_class)<span class='macro_popup'>((((GTypeClass*) (object_class))->g_type))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='macro'>G_STRUCT_OFFSET (GsmConsolekitClass, privileges_completed)<span class='macro_popup'>((glong) __builtin_offsetof(GsmConsolekitClass, privileges_completed<br>))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> gsm_marshal_VOID__BOOLEAN_BOOLEAN_POINTER,</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> 3, <span class='macro'>G_TYPE_BOOLEAN<span class='macro_popup'>((GType) ((5) << (2)))</span></span>, <span class='macro'>G_TYPE_BOOLEAN<span class='macro_popup'>((GType) ((5) << (2)))</span></span>, <span class='macro'>G_TYPE_POINTER<span class='macro_popup'>((GType) ((17) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"><span class='keyword'>static</span> DBusHandlerResult</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line">gsm_consolekit_dbus_filter (DBusConnection *connection,</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> DBusMessage *message,</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> <span class='keyword'>void</span> *user_data)</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> GsmConsolekit *manager;</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> manager = GSM_CONSOLEKIT (user_data);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> <span class='keyword'>if</span> (dbus_message_is_signal (message,</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> <span class='macro'>DBUS_INTERFACE_LOCAL<span class='macro_popup'>"org.freedesktop.DBus.Local"</span></span>, <span class='string_literal'>"Disconnected"</span>) &&</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> strcmp (dbus_message_get_path (message), <span class='macro'>DBUS_PATH_LOCAL<span class='macro_popup'>"/org/freedesktop/DBus/Local"</span></span>) == 0) {</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> gsm_consolekit_free_dbus (manager);</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> <span class='comment'>/* let other filters get this disconnected signal, so that they</span></td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> <span class='comment'>* can handle it too */</span></td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>return</span> DBUS_HANDLER_RESULT_NOT_YET_HANDLED;</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line">gsm_consolekit_ensure_ck_connection (GsmConsolekit *manager,</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> GError *connection_error;</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> gboolean is_connected;</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> GsmConsolekitPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> connection_error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> priv = gsm_consolekit_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> <span class='keyword'>if</span> (priv->dbus_connection == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> DBusConnection *connection;</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> priv->dbus_connection = dbus_g_bus_get (DBUS_BUS_SYSTEM,</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> &connection_error);</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='keyword'>if</span> (priv->dbus_connection == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> g_propagate_error (error, connection_error);</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> is_connected = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> connection = dbus_g_connection_get_connection (priv->dbus_connection);</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> dbus_connection_set_exit_on_disconnect (connection, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> dbus_connection_add_filter (connection,</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> gsm_consolekit_dbus_filter,</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> manager, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> <span class='keyword'>if</span> (priv->bus_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> priv->bus_proxy =</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> dbus_g_proxy_new_for_name_owner (priv->dbus_connection,</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> <span class='macro'>DBUS_SERVICE_DBUS<span class='macro_popup'>"org.freedesktop.DBus"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> <span class='macro'>DBUS_PATH_DBUS<span class='macro_popup'>"/org/freedesktop/DBus"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='macro'>DBUS_INTERFACE_DBUS<span class='macro_popup'>"org.freedesktop.DBus"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> &connection_error);</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> <span class='keyword'>if</span> (priv->bus_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> g_propagate_error (error, connection_error);</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> is_connected = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> dbus_g_proxy_add_signal (priv->bus_proxy,</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> <span class='string_literal'>"NameOwnerChanged"</span>,</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> dbus_g_proxy_connect_signal (priv->bus_proxy,</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> <span class='string_literal'>"NameOwnerChanged"</span>,</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='macro'>G_CALLBACK (gsm_consolekit_on_name_owner_changed)<span class='macro_popup'>((GCallback) (gsm_consolekit_on_name_owner_changed))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> manager, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> <span class='keyword'>if</span> (priv->ck_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> priv->ck_proxy =</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> dbus_g_proxy_new_for_name_owner (priv->dbus_connection,</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> <span class='string_literal'>"org.freedesktop.ConsoleKit"</span>,</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> <span class='string_literal'>"/org/freedesktop/ConsoleKit/Manager"</span>,</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> <span class='string_literal'>"org.freedesktop.ConsoleKit.Manager"</span>,</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> &connection_error);</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='keyword'>if</span> (priv->ck_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> g_propagate_error (error, connection_error);</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> is_connected = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> is_connected = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>if</span> (priv->is_connected != is_connected) {</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> priv->is_connected = (is_connected != <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> g_object_notify (<span class='macro'>G_OBJECT (manager)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((manager)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"is-connected"</span>);</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> <span class='keyword'>if</span> (!is_connected) {</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>if</span> (priv->dbus_connection == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> <span class='keyword'>if</span> (priv->bus_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> g_object_unref (priv->bus_proxy);</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> priv->bus_proxy = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>if</span> (priv->ck_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> g_object_unref (priv->ck_proxy);</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> priv->ck_proxy = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (priv->bus_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> <span class='keyword'>if</span> (priv->ck_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> g_object_unref (priv->ck_proxy);</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> priv->ck_proxy = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>return</span> is_connected;</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line">gsm_consolekit_on_name_owner_changed (DBusGProxy *bus_proxy,</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *name,</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *prev_owner,</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *new_owner,</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> GsmConsolekit *manager)</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> GsmConsolekitPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='keyword'>if</span> (name != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> && strcmp (name, <span class='string_literal'>"org.freedesktop.ConsoleKit"</span>) != 0) {</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> priv = gsm_consolekit_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>if</span> (priv->ck_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> g_object_unref (priv->ck_proxy);</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> priv->ck_proxy = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> gsm_consolekit_ensure_ck_connection (manager, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line">gsm_consolekit_init (GsmConsolekit *manager)</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> <span class='keyword'>if</span> (!gsm_consolekit_ensure_ck_connection (manager, &error)) {</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> g_warning (<span class='string_literal'>"Could not connect to ConsoleKit: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line">gsm_consolekit_free_dbus (GsmConsolekit *manager)</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> GsmConsolekitPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> priv = gsm_consolekit_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> <span class='keyword'>if</span> (priv->bus_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> g_object_unref (priv->bus_proxy);</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> priv->bus_proxy = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> <span class='keyword'>if</span> (priv->ck_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> g_object_unref (priv->ck_proxy);</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> priv->ck_proxy = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> <span class='keyword'>if</span> (priv->dbus_connection != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> DBusConnection *connection;</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> connection = dbus_g_connection_get_connection (priv->dbus_connection);</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> dbus_connection_remove_filter (connection,</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> gsm_consolekit_dbus_filter,</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> manager);</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> dbus_g_connection_unref (priv->dbus_connection);</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> priv->dbus_connection = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line">gsm_consolekit_finalize (GObject *object)</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> GsmConsolekit *manager;</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> GObjectClass *parent_class;</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> manager = GSM_CONSOLEKIT (object);</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> parent_class = <span class='macro'>G_OBJECT_CLASS (gsm_consolekit_parent_class)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((gsm_consolekit_parent_class)), (((GType) ((20) << (<br>2))))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> gsm_consolekit_free_dbus (manager);</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='keyword'>if</span> (parent_class->finalize != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> parent_class->finalize (object);</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line">GQuark</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line">gsm_consolekit_error_quark (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='keyword'>static</span> GQuark error_quark = 0;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>if</span> (error_quark == 0) {</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> error_quark = g_quark_from_static_string (<span class='string_literal'>"gsm-consolekit-error"</span>);</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> <span class='keyword'>return</span> error_quark;</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line">GsmConsolekit *</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line">gsm_consolekit_new (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> GsmConsolekit *manager;</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> manager = g_object_new (<span class='macro'>GSM_TYPE_CONSOLEKIT<span class='macro_popup'>(gsm_consolekit_get_type ())</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>return</span> manager;</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line">emit_restart_complete (GsmConsolekit *manager,</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> GError *error)</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> GError *call_error;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> call_error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> call_error = g_error_new_literal (<span class='macro'>GSM_CONSOLEKIT_ERROR<span class='macro_popup'>(gsm_consolekit_error_quark ())</span></span>,</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> GSM_CONSOLEKIT_ERROR_RESTARTING,</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> g_signal_emit (<span class='macro'>G_OBJECT (manager)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((manager)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> signals [REQUEST_COMPLETED],</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> 0, call_error);</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> <span class='keyword'>if</span> (call_error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> g_error_free (call_error);</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line">emit_stop_complete (GsmConsolekit *manager,</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> GError *error)</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> GError *call_error;</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> call_error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> call_error = g_error_new_literal (<span class='macro'>GSM_CONSOLEKIT_ERROR<span class='macro_popup'>(gsm_consolekit_error_quark ())</span></span>,</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> GSM_CONSOLEKIT_ERROR_STOPPING,</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> g_signal_emit (<span class='macro'>G_OBJECT (manager)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((manager)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> signals [REQUEST_COMPLETED],</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> 0, call_error);</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> <span class='keyword'>if</span> (call_error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> g_error_free (call_error);</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line">gsm_consolekit_attempt_restart (GsmConsolekit *manager)</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> GsmConsolekitPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> priv = gsm_consolekit_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> <span class='keyword'>if</span> (!gsm_consolekit_ensure_ck_connection (manager, &error)) {</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> g_warning (<span class='string_literal'>"Could not connect to ConsoleKit: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> emit_restart_complete (manager, error);</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> res = dbus_g_proxy_call_with_timeout (priv->ck_proxy,</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> <span class='string_literal'>"Restart"</span>,</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> <span class='macro'>INT_MAX<span class='macro_popup'>2147483647</span></span>,</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> &error,</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> <span class='keyword'>if</span> (!res) {</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> g_warning (<span class='string_literal'>"Unable to restart system: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> emit_restart_complete (manager, error);</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> emit_restart_complete (manager, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line">gsm_consolekit_attempt_stop (GsmConsolekit *manager)</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> GsmConsolekitPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> priv = gsm_consolekit_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='keyword'>if</span> (!gsm_consolekit_ensure_ck_connection (manager, &error)) {</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> g_warning (<span class='string_literal'>"Could not connect to ConsoleKit: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> emit_stop_complete (manager, error);</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> res = dbus_g_proxy_call_with_timeout (priv->ck_proxy,</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> <span class='string_literal'>"Stop"</span>,</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> <span class='macro'>INT_MAX<span class='macro_popup'>2147483647</span></span>,</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> &error,</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> <span class='keyword'>if</span> (!res) {</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> g_warning (<span class='string_literal'>"Unable to stop system: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> emit_stop_complete (manager, error);</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> emit_stop_complete (manager, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line">gsm_consolekit_attempt_suspend (GsmConsolekit *manager)</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> GsmConsolekitPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> priv = gsm_consolekit_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> <span class='keyword'>if</span> (!gsm_consolekit_ensure_ck_connection (manager, &error)) {</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> g_warning (<span class='string_literal'>"Could not connect to ConsoleKit: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> res = dbus_g_proxy_call_with_timeout (priv->ck_proxy,</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> <span class='string_literal'>"Suspend"</span>,</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='macro'>INT_MAX<span class='macro_popup'>2147483647</span></span>,</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> &error,</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> <span class='macro'>G_TYPE_BOOLEAN<span class='macro_popup'>((GType) ((5) << (2)))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='comment'>/* interactive */</span></td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> <span class='keyword'>if</span> (!res) {</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> g_warning (<span class='string_literal'>"Unable to suspend system: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line">gsm_consolekit_attempt_hibernate (GsmConsolekit *manager)</td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> GsmConsolekitPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> priv = gsm_consolekit_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> <span class='keyword'>if</span> (!gsm_consolekit_ensure_ck_connection (manager, &error)) {</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> g_warning (<span class='string_literal'>"Could not connect to ConsoleKit: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"> res = dbus_g_proxy_call_with_timeout (priv->ck_proxy,</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> <span class='string_literal'>"Hibernate"</span>,</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"> <span class='macro'>INT_MAX<span class='macro_popup'>2147483647</span></span>,</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> &error,</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> <span class='macro'>G_TYPE_BOOLEAN<span class='macro_popup'>((GType) ((5) << (2)))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='comment'>/* interactive */</span></td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> <span class='keyword'>if</span> (!res) {</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> g_warning (<span class='string_literal'>"Unable to hibernate system: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line">get_current_session_id (DBusConnection *connection,</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> <span class='keyword'>char</span> **session_id)</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> DBusError local_error;</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> DBusMessage *message;</td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> DBusMessage *reply;</td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> DBusMessageIter iter;</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *value;</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> reply = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> dbus_error_init (&local_error);</td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> message = dbus_message_new_method_call (<span class='macro'>CK_NAME<span class='macro_popup'>"org.freedesktop.ConsoleKit"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> <span class='macro'>CK_MANAGER_PATH<span class='macro_popup'>"/org/freedesktop/ConsoleKit/Manager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> <span class='macro'>CK_MANAGER_INTERFACE<span class='macro_popup'>"org.freedesktop.ConsoleKit.Manager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> <span class='string_literal'>"GetCurrentSession"</span>);</td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> <span class='keyword'>if</span> (message == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> dbus_error_init (&local_error);</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> reply = dbus_connection_send_with_reply_and_block (connection,</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> message,</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> &local_error);</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> <span class='keyword'>if</span> (reply == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> <span class='keyword'>if</span> (dbus_error_is_set (&local_error)) {</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> g_warning (<span class='string_literal'>"Unable to determine session: %s"</span>, local_error.message);</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> dbus_error_free (&local_error);</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> dbus_message_iter_init (reply, &iter);</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> dbus_message_iter_get_basic (&iter, &value);</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> <span class='keyword'>if</span> (session_id != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> *session_id = <span class='macro'>g_strdup (value)<span class='macro_popup'>g_strdup_inline (value)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> <span class='keyword'>if</span> (message != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> dbus_message_unref (message);</td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> <span class='keyword'>if</span> (reply != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> dbus_message_unref (reply);</td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line">get_seat_id_for_session (DBusConnection *connection,</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *session_id,</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> <span class='keyword'>char</span> **seat_id)</td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> DBusError local_error;</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> DBusMessage *message;</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> DBusMessage *reply;</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> DBusMessageIter iter;</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *value;</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> reply = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line"> dbus_error_init (&local_error);</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> message = dbus_message_new_method_call (<span class='macro'>CK_NAME<span class='macro_popup'>"org.freedesktop.ConsoleKit"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"> session_id,</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line"> <span class='macro'>CK_SESSION_INTERFACE<span class='macro_popup'>"org.freedesktop.ConsoleKit.Session"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line"> <span class='string_literal'>"GetSeatId"</span>);</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> <span class='keyword'>if</span> (message == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> dbus_error_init (&local_error);</td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> reply = dbus_connection_send_with_reply_and_block (connection,</td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> message,</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> &local_error);</td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> <span class='keyword'>if</span> (reply == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> <span class='keyword'>if</span> (dbus_error_is_set (&local_error)) {</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> g_warning (<span class='string_literal'>"Unable to determine seat: %s"</span>, local_error.message);</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> dbus_error_free (&local_error);</td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> dbus_message_iter_init (reply, &iter);</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> dbus_message_iter_get_basic (&iter, &value);</td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> <span class='keyword'>if</span> (seat_id != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> *seat_id = <span class='macro'>g_strdup (value)<span class='macro_popup'>g_strdup_inline (value)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> <span class='keyword'>if</span> (message != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> dbus_message_unref (message);</td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line"> <span class='keyword'>if</span> (reply != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="657"><td class="num" id="LN657">657</td><td class="line"> dbus_message_unref (reply);</td></tr> +<tr class="codeline" data-linenumber="658"><td class="num" id="LN658">658</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="659"><td class="num" id="LN659">659</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="660"><td class="num" id="LN660">660</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="661"><td class="num" id="LN661">661</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="662"><td class="num" id="LN662">662</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="663"><td class="num" id="LN663">663</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>char</span> *</td></tr> +<tr class="codeline" data-linenumber="664"><td class="num" id="LN664">664</td><td class="line">get_current_seat_id (DBusConnection *connection)</td></tr> +<tr class="codeline" data-linenumber="665"><td class="num" id="LN665">665</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="666"><td class="num" id="LN666">666</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="667"><td class="num" id="LN667">667</td><td class="line"> <span class='keyword'>char</span> *session_id;</td></tr> +<tr class="codeline" data-linenumber="668"><td class="num" id="LN668">668</td><td class="line"> <span class='keyword'>char</span> *seat_id;</td></tr> +<tr class="codeline" data-linenumber="669"><td class="num" id="LN669">669</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="670"><td class="num" id="LN670">670</td><td class="line"> session_id = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="671"><td class="num" id="LN671">671</td><td class="line"> seat_id = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="672"><td class="num" id="LN672">672</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="673"><td class="num" id="LN673">673</td><td class="line"> res = get_current_session_id (connection, &session_id);</td></tr> +<tr class="codeline" data-linenumber="674"><td class="num" id="LN674">674</td><td class="line"> <span class='keyword'>if</span> (res) {</td></tr> +<tr class="codeline" data-linenumber="675"><td class="num" id="LN675">675</td><td class="line"> res = <span class="mrange">get_seat_id_for_session (connection, session_id, &seat_id)</span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:17ex">Value stored to 'res' is never read</div></td></tr> +<tr class="codeline" data-linenumber="676"><td class="num" id="LN676">676</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="677"><td class="num" id="LN677">677</td><td class="line"> g_free (session_id);</td></tr> +<tr class="codeline" data-linenumber="678"><td class="num" id="LN678">678</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="679"><td class="num" id="LN679">679</td><td class="line"> <span class='keyword'>return</span> seat_id;</td></tr> +<tr class="codeline" data-linenumber="680"><td class="num" id="LN680">680</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="681"><td class="num" id="LN681">681</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="682"><td class="num" id="LN682">682</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="683"><td class="num" id="LN683">683</td><td class="line">gsm_consolekit_set_session_idle (GsmConsolekit *manager,</td></tr> +<tr class="codeline" data-linenumber="684"><td class="num" id="LN684">684</td><td class="line"> gboolean is_idle)</td></tr> +<tr class="codeline" data-linenumber="685"><td class="num" id="LN685">685</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="686"><td class="num" id="LN686">686</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="687"><td class="num" id="LN687">687</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="688"><td class="num" id="LN688">688</td><td class="line"> <span class='keyword'>char</span> *session_id;</td></tr> +<tr class="codeline" data-linenumber="689"><td class="num" id="LN689">689</td><td class="line"> DBusMessage *message;</td></tr> +<tr class="codeline" data-linenumber="690"><td class="num" id="LN690">690</td><td class="line"> DBusMessage *reply;</td></tr> +<tr class="codeline" data-linenumber="691"><td class="num" id="LN691">691</td><td class="line"> DBusError dbus_error;</td></tr> +<tr class="codeline" data-linenumber="692"><td class="num" id="LN692">692</td><td class="line"> DBusMessageIter iter;</td></tr> +<tr class="codeline" data-linenumber="693"><td class="num" id="LN693">693</td><td class="line"> GsmConsolekitPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="694"><td class="num" id="LN694">694</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="695"><td class="num" id="LN695">695</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="696"><td class="num" id="LN696">696</td><td class="line"> priv = gsm_consolekit_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="697"><td class="num" id="LN697">697</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="698"><td class="num" id="LN698">698</td><td class="line"> <span class='keyword'>if</span> (!gsm_consolekit_ensure_ck_connection (manager, &error)) {</td></tr> +<tr class="codeline" data-linenumber="699"><td class="num" id="LN699">699</td><td class="line"> g_warning (<span class='string_literal'>"Could not connect to ConsoleKit: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="700"><td class="num" id="LN700">700</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="701"><td class="num" id="LN701">701</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="702"><td class="num" id="LN702">702</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="703"><td class="num" id="LN703">703</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="704"><td class="num" id="LN704">704</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="705"><td class="num" id="LN705">705</td><td class="line"> session_id = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="706"><td class="num" id="LN706">706</td><td class="line"> res = get_current_session_id (dbus_g_connection_get_connection (priv->dbus_connection),</td></tr> +<tr class="codeline" data-linenumber="707"><td class="num" id="LN707">707</td><td class="line"> &session_id);</td></tr> +<tr class="codeline" data-linenumber="708"><td class="num" id="LN708">708</td><td class="line"> <span class='keyword'>if</span> (!res) {</td></tr> +<tr class="codeline" data-linenumber="709"><td class="num" id="LN709">709</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="710"><td class="num" id="LN710">710</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="711"><td class="num" id="LN711">711</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="712"><td class="num" id="LN712">712</td><td class="line"> g_debug (<span class='string_literal'>"Updating ConsoleKit idle status: %d"</span>, is_idle);</td></tr> +<tr class="codeline" data-linenumber="713"><td class="num" id="LN713">713</td><td class="line"> message = dbus_message_new_method_call (<span class='macro'>CK_NAME<span class='macro_popup'>"org.freedesktop.ConsoleKit"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="714"><td class="num" id="LN714">714</td><td class="line"> session_id,</td></tr> +<tr class="codeline" data-linenumber="715"><td class="num" id="LN715">715</td><td class="line"> <span class='macro'>CK_SESSION_INTERFACE<span class='macro_popup'>"org.freedesktop.ConsoleKit.Session"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="716"><td class="num" id="LN716">716</td><td class="line"> <span class='string_literal'>"SetIdleHint"</span>);</td></tr> +<tr class="codeline" data-linenumber="717"><td class="num" id="LN717">717</td><td class="line"> <span class='keyword'>if</span> (message == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="718"><td class="num" id="LN718">718</td><td class="line"> g_debug (<span class='string_literal'>"Couldn't allocate the D-Bus message"</span>);</td></tr> +<tr class="codeline" data-linenumber="719"><td class="num" id="LN719">719</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="720"><td class="num" id="LN720">720</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="721"><td class="num" id="LN721">721</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="722"><td class="num" id="LN722">722</td><td class="line"> dbus_message_iter_init_append (message, &iter);</td></tr> +<tr class="codeline" data-linenumber="723"><td class="num" id="LN723">723</td><td class="line"> dbus_message_iter_append_basic (&iter, <span class='macro'>DBUS_TYPE_BOOLEAN<span class='macro_popup'>((int) 'b')</span></span>, &is_idle);</td></tr> +<tr class="codeline" data-linenumber="724"><td class="num" id="LN724">724</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="725"><td class="num" id="LN725">725</td><td class="line"> <span class='comment'>/* FIXME: use async? */</span></td></tr> +<tr class="codeline" data-linenumber="726"><td class="num" id="LN726">726</td><td class="line"> dbus_error_init (&dbus_error);</td></tr> +<tr class="codeline" data-linenumber="727"><td class="num" id="LN727">727</td><td class="line"> reply = dbus_connection_send_with_reply_and_block (dbus_g_connection_get_connection (priv->dbus_connection),</td></tr> +<tr class="codeline" data-linenumber="728"><td class="num" id="LN728">728</td><td class="line"> message,</td></tr> +<tr class="codeline" data-linenumber="729"><td class="num" id="LN729">729</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="730"><td class="num" id="LN730">730</td><td class="line"> &dbus_error);</td></tr> +<tr class="codeline" data-linenumber="731"><td class="num" id="LN731">731</td><td class="line"> dbus_message_unref (message);</td></tr> +<tr class="codeline" data-linenumber="732"><td class="num" id="LN732">732</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="733"><td class="num" id="LN733">733</td><td class="line"> <span class='keyword'>if</span> (reply != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="734"><td class="num" id="LN734">734</td><td class="line"> dbus_message_unref (reply);</td></tr> +<tr class="codeline" data-linenumber="735"><td class="num" id="LN735">735</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="736"><td class="num" id="LN736">736</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="737"><td class="num" id="LN737">737</td><td class="line"> <span class='keyword'>if</span> (dbus_error_is_set (&dbus_error)) {</td></tr> +<tr class="codeline" data-linenumber="738"><td class="num" id="LN738">738</td><td class="line"> g_debug (<span class='string_literal'>"%s raised:\n %s\n\n"</span>, dbus_error.name, dbus_error.message);</td></tr> +<tr class="codeline" data-linenumber="739"><td class="num" id="LN739">739</td><td class="line"> dbus_error_free (&dbus_error);</td></tr> +<tr class="codeline" data-linenumber="740"><td class="num" id="LN740">740</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="741"><td class="num" id="LN741">741</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="742"><td class="num" id="LN742">742</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="743"><td class="num" id="LN743">743</td><td class="line"> g_free (session_id);</td></tr> +<tr class="codeline" data-linenumber="744"><td class="num" id="LN744">744</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="745"><td class="num" id="LN745">745</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="746"><td class="num" id="LN746">746</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="747"><td class="num" id="LN747">747</td><td class="line">seat_can_activate_sessions (DBusConnection *connection,</td></tr> +<tr class="codeline" data-linenumber="748"><td class="num" id="LN748">748</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *seat_id)</td></tr> +<tr class="codeline" data-linenumber="749"><td class="num" id="LN749">749</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="750"><td class="num" id="LN750">750</td><td class="line"> DBusError local_error;</td></tr> +<tr class="codeline" data-linenumber="751"><td class="num" id="LN751">751</td><td class="line"> DBusMessage *message;</td></tr> +<tr class="codeline" data-linenumber="752"><td class="num" id="LN752">752</td><td class="line"> DBusMessage *reply;</td></tr> +<tr class="codeline" data-linenumber="753"><td class="num" id="LN753">753</td><td class="line"> DBusMessageIter iter;</td></tr> +<tr class="codeline" data-linenumber="754"><td class="num" id="LN754">754</td><td class="line"> gboolean can_activate;</td></tr> +<tr class="codeline" data-linenumber="755"><td class="num" id="LN755">755</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="756"><td class="num" id="LN756">756</td><td class="line"> can_activate = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="757"><td class="num" id="LN757">757</td><td class="line"> reply = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="758"><td class="num" id="LN758">758</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="759"><td class="num" id="LN759">759</td><td class="line"> dbus_error_init (&local_error);</td></tr> +<tr class="codeline" data-linenumber="760"><td class="num" id="LN760">760</td><td class="line"> message = dbus_message_new_method_call (<span class='macro'>CK_NAME<span class='macro_popup'>"org.freedesktop.ConsoleKit"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="761"><td class="num" id="LN761">761</td><td class="line"> seat_id,</td></tr> +<tr class="codeline" data-linenumber="762"><td class="num" id="LN762">762</td><td class="line"> <span class='macro'>CK_SEAT_INTERFACE<span class='macro_popup'>"org.freedesktop.ConsoleKit.Seat"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="763"><td class="num" id="LN763">763</td><td class="line"> <span class='string_literal'>"CanActivateSessions"</span>);</td></tr> +<tr class="codeline" data-linenumber="764"><td class="num" id="LN764">764</td><td class="line"> <span class='keyword'>if</span> (message == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="765"><td class="num" id="LN765">765</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="766"><td class="num" id="LN766">766</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="767"><td class="num" id="LN767">767</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="768"><td class="num" id="LN768">768</td><td class="line"> dbus_error_init (&local_error);</td></tr> +<tr class="codeline" data-linenumber="769"><td class="num" id="LN769">769</td><td class="line"> reply = dbus_connection_send_with_reply_and_block (connection,</td></tr> +<tr class="codeline" data-linenumber="770"><td class="num" id="LN770">770</td><td class="line"> message,</td></tr> +<tr class="codeline" data-linenumber="771"><td class="num" id="LN771">771</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="772"><td class="num" id="LN772">772</td><td class="line"> &local_error);</td></tr> +<tr class="codeline" data-linenumber="773"><td class="num" id="LN773">773</td><td class="line"> <span class='keyword'>if</span> (reply == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="774"><td class="num" id="LN774">774</td><td class="line"> <span class='keyword'>if</span> (dbus_error_is_set (&local_error)) {</td></tr> +<tr class="codeline" data-linenumber="775"><td class="num" id="LN775">775</td><td class="line"> g_warning (<span class='string_literal'>"Unable to activate session: %s"</span>, local_error.message);</td></tr> +<tr class="codeline" data-linenumber="776"><td class="num" id="LN776">776</td><td class="line"> dbus_error_free (&local_error);</td></tr> +<tr class="codeline" data-linenumber="777"><td class="num" id="LN777">777</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="778"><td class="num" id="LN778">778</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="779"><td class="num" id="LN779">779</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="780"><td class="num" id="LN780">780</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="781"><td class="num" id="LN781">781</td><td class="line"> dbus_message_iter_init (reply, &iter);</td></tr> +<tr class="codeline" data-linenumber="782"><td class="num" id="LN782">782</td><td class="line"> dbus_message_iter_get_basic (&iter, &can_activate);</td></tr> +<tr class="codeline" data-linenumber="783"><td class="num" id="LN783">783</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="784"><td class="num" id="LN784">784</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="785"><td class="num" id="LN785">785</td><td class="line"> <span class='keyword'>if</span> (message != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="786"><td class="num" id="LN786">786</td><td class="line"> dbus_message_unref (message);</td></tr> +<tr class="codeline" data-linenumber="787"><td class="num" id="LN787">787</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="788"><td class="num" id="LN788">788</td><td class="line"> <span class='keyword'>if</span> (reply != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="789"><td class="num" id="LN789">789</td><td class="line"> dbus_message_unref (reply);</td></tr> +<tr class="codeline" data-linenumber="790"><td class="num" id="LN790">790</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="791"><td class="num" id="LN791">791</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="792"><td class="num" id="LN792">792</td><td class="line"> <span class='keyword'>return</span> can_activate;</td></tr> +<tr class="codeline" data-linenumber="793"><td class="num" id="LN793">793</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="794"><td class="num" id="LN794">794</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="795"><td class="num" id="LN795">795</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="796"><td class="num" id="LN796">796</td><td class="line">gsm_consolekit_can_switch_user (GsmConsolekit *manager)</td></tr> +<tr class="codeline" data-linenumber="797"><td class="num" id="LN797">797</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="798"><td class="num" id="LN798">798</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="799"><td class="num" id="LN799">799</td><td class="line"> <span class='keyword'>char</span> *seat_id;</td></tr> +<tr class="codeline" data-linenumber="800"><td class="num" id="LN800">800</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="801"><td class="num" id="LN801">801</td><td class="line"> GsmConsolekitPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="802"><td class="num" id="LN802">802</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="803"><td class="num" id="LN803">803</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="804"><td class="num" id="LN804">804</td><td class="line"> priv = gsm_consolekit_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="805"><td class="num" id="LN805">805</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="806"><td class="num" id="LN806">806</td><td class="line"> <span class='keyword'>if</span> (!gsm_consolekit_ensure_ck_connection (manager, &error)) {</td></tr> +<tr class="codeline" data-linenumber="807"><td class="num" id="LN807">807</td><td class="line"> g_warning (<span class='string_literal'>"Could not connect to ConsoleKit: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="808"><td class="num" id="LN808">808</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="809"><td class="num" id="LN809">809</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="810"><td class="num" id="LN810">810</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="811"><td class="num" id="LN811">811</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="812"><td class="num" id="LN812">812</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="813"><td class="num" id="LN813">813</td><td class="line"> seat_id = get_current_seat_id (dbus_g_connection_get_connection (priv->dbus_connection));</td></tr> +<tr class="codeline" data-linenumber="814"><td class="num" id="LN814">814</td><td class="line"> <span class='keyword'>if</span> (seat_id == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> || seat_id[0] == '\0') {</td></tr> +<tr class="codeline" data-linenumber="815"><td class="num" id="LN815">815</td><td class="line"> g_debug (<span class='string_literal'>"seat id is not set; can't switch sessions"</span>);</td></tr> +<tr class="codeline" data-linenumber="816"><td class="num" id="LN816">816</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="817"><td class="num" id="LN817">817</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="818"><td class="num" id="LN818">818</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="819"><td class="num" id="LN819">819</td><td class="line"> ret = seat_can_activate_sessions (dbus_g_connection_get_connection (priv->dbus_connection),</td></tr> +<tr class="codeline" data-linenumber="820"><td class="num" id="LN820">820</td><td class="line"> seat_id);</td></tr> +<tr class="codeline" data-linenumber="821"><td class="num" id="LN821">821</td><td class="line"> g_free (seat_id);</td></tr> +<tr class="codeline" data-linenumber="822"><td class="num" id="LN822">822</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="823"><td class="num" id="LN823">823</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="824"><td class="num" id="LN824">824</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="825"><td class="num" id="LN825">825</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="826"><td class="num" id="LN826">826</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="827"><td class="num" id="LN827">827</td><td class="line">gsm_consolekit_get_restart_privileges (GsmConsolekit *manager)</td></tr> +<tr class="codeline" data-linenumber="828"><td class="num" id="LN828">828</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="829"><td class="num" id="LN829">829</td><td class="line"> g_signal_emit (<span class='macro'>G_OBJECT (manager)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((manager)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="830"><td class="num" id="LN830">830</td><td class="line"> signals [PRIVILEGES_COMPLETED],</td></tr> +<tr class="codeline" data-linenumber="831"><td class="num" id="LN831">831</td><td class="line"> 0, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="832"><td class="num" id="LN832">832</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="833"><td class="num" id="LN833">833</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="834"><td class="num" id="LN834">834</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="835"><td class="num" id="LN835">835</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="836"><td class="num" id="LN836">836</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="837"><td class="num" id="LN837">837</td><td class="line">gsm_consolekit_get_stop_privileges (GsmConsolekit *manager)</td></tr> +<tr class="codeline" data-linenumber="838"><td class="num" id="LN838">838</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="839"><td class="num" id="LN839">839</td><td class="line"> g_signal_emit (<span class='macro'>G_OBJECT (manager)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((manager)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="840"><td class="num" id="LN840">840</td><td class="line"> signals [PRIVILEGES_COMPLETED],</td></tr> +<tr class="codeline" data-linenumber="841"><td class="num" id="LN841">841</td><td class="line"> 0, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="842"><td class="num" id="LN842">842</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="843"><td class="num" id="LN843">843</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="844"><td class="num" id="LN844">844</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="845"><td class="num" id="LN845">845</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="846"><td class="num" id="LN846">846</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="847"><td class="num" id="LN847">847</td><td class="line">gsm_consolekit_can_restart (GsmConsolekit *manager)</td></tr> +<tr class="codeline" data-linenumber="848"><td class="num" id="LN848">848</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="849"><td class="num" id="LN849">849</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="850"><td class="num" id="LN850">850</td><td class="line"> gboolean can_restart;</td></tr> +<tr class="codeline" data-linenumber="851"><td class="num" id="LN851">851</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="852"><td class="num" id="LN852">852</td><td class="line"> GsmConsolekitPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="853"><td class="num" id="LN853">853</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="854"><td class="num" id="LN854">854</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="855"><td class="num" id="LN855">855</td><td class="line"> priv = gsm_consolekit_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="856"><td class="num" id="LN856">856</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="857"><td class="num" id="LN857">857</td><td class="line"> <span class='keyword'>if</span> (!gsm_consolekit_ensure_ck_connection (manager, &error)) {</td></tr> +<tr class="codeline" data-linenumber="858"><td class="num" id="LN858">858</td><td class="line"> g_warning (<span class='string_literal'>"Could not connect to ConsoleKit: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="859"><td class="num" id="LN859">859</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="860"><td class="num" id="LN860">860</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="861"><td class="num" id="LN861">861</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="862"><td class="num" id="LN862">862</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="863"><td class="num" id="LN863">863</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="864"><td class="num" id="LN864">864</td><td class="line"> res = dbus_g_proxy_call_with_timeout (priv->ck_proxy,</td></tr> +<tr class="codeline" data-linenumber="865"><td class="num" id="LN865">865</td><td class="line"> <span class='string_literal'>"CanRestart"</span>,</td></tr> +<tr class="codeline" data-linenumber="866"><td class="num" id="LN866">866</td><td class="line"> <span class='macro'>INT_MAX<span class='macro_popup'>2147483647</span></span>,</td></tr> +<tr class="codeline" data-linenumber="867"><td class="num" id="LN867">867</td><td class="line"> &error,</td></tr> +<tr class="codeline" data-linenumber="868"><td class="num" id="LN868">868</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="869"><td class="num" id="LN869">869</td><td class="line"> <span class='macro'>G_TYPE_BOOLEAN<span class='macro_popup'>((GType) ((5) << (2)))</span></span>, &can_restart,</td></tr> +<tr class="codeline" data-linenumber="870"><td class="num" id="LN870">870</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="871"><td class="num" id="LN871">871</td><td class="line"> <span class='keyword'>if</span> (res == <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="872"><td class="num" id="LN872">872</td><td class="line"> g_warning (<span class='string_literal'>"Could not make DBUS call: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="873"><td class="num" id="LN873">873</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="874"><td class="num" id="LN874">874</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="875"><td class="num" id="LN875">875</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="876"><td class="num" id="LN876">876</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="877"><td class="num" id="LN877">877</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="878"><td class="num" id="LN878">878</td><td class="line"> <span class='keyword'>return</span> can_restart;</td></tr> +<tr class="codeline" data-linenumber="879"><td class="num" id="LN879">879</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="880"><td class="num" id="LN880">880</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="881"><td class="num" id="LN881">881</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="882"><td class="num" id="LN882">882</td><td class="line">gsm_consolekit_can_stop (GsmConsolekit *manager)</td></tr> +<tr class="codeline" data-linenumber="883"><td class="num" id="LN883">883</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="884"><td class="num" id="LN884">884</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="885"><td class="num" id="LN885">885</td><td class="line"> gboolean can_stop;</td></tr> +<tr class="codeline" data-linenumber="886"><td class="num" id="LN886">886</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="887"><td class="num" id="LN887">887</td><td class="line"> GsmConsolekitPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="888"><td class="num" id="LN888">888</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="889"><td class="num" id="LN889">889</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="890"><td class="num" id="LN890">890</td><td class="line"> priv = gsm_consolekit_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="891"><td class="num" id="LN891">891</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="892"><td class="num" id="LN892">892</td><td class="line"> <span class='keyword'>if</span> (!gsm_consolekit_ensure_ck_connection (manager, &error)) {</td></tr> +<tr class="codeline" data-linenumber="893"><td class="num" id="LN893">893</td><td class="line"> g_warning (<span class='string_literal'>"Could not connect to ConsoleKit: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="894"><td class="num" id="LN894">894</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="895"><td class="num" id="LN895">895</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="896"><td class="num" id="LN896">896</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="897"><td class="num" id="LN897">897</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="898"><td class="num" id="LN898">898</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="899"><td class="num" id="LN899">899</td><td class="line"> res = dbus_g_proxy_call_with_timeout (priv->ck_proxy,</td></tr> +<tr class="codeline" data-linenumber="900"><td class="num" id="LN900">900</td><td class="line"> <span class='string_literal'>"CanStop"</span>,</td></tr> +<tr class="codeline" data-linenumber="901"><td class="num" id="LN901">901</td><td class="line"> <span class='macro'>INT_MAX<span class='macro_popup'>2147483647</span></span>,</td></tr> +<tr class="codeline" data-linenumber="902"><td class="num" id="LN902">902</td><td class="line"> &error,</td></tr> +<tr class="codeline" data-linenumber="903"><td class="num" id="LN903">903</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="904"><td class="num" id="LN904">904</td><td class="line"> <span class='macro'>G_TYPE_BOOLEAN<span class='macro_popup'>((GType) ((5) << (2)))</span></span>, &can_stop,</td></tr> +<tr class="codeline" data-linenumber="905"><td class="num" id="LN905">905</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="906"><td class="num" id="LN906">906</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="907"><td class="num" id="LN907">907</td><td class="line"> <span class='keyword'>if</span> (res == <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="908"><td class="num" id="LN908">908</td><td class="line"> g_warning (<span class='string_literal'>"Could not make DBUS call: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="909"><td class="num" id="LN909">909</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="910"><td class="num" id="LN910">910</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="911"><td class="num" id="LN911">911</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="912"><td class="num" id="LN912">912</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="913"><td class="num" id="LN913">913</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="914"><td class="num" id="LN914">914</td><td class="line"> <span class='keyword'>return</span> can_stop;</td></tr> +<tr class="codeline" data-linenumber="915"><td class="num" id="LN915">915</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="916"><td class="num" id="LN916">916</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="917"><td class="num" id="LN917">917</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="918"><td class="num" id="LN918">918</td><td class="line">gsm_consolekit_can_suspend (GsmConsolekit *manager)</td></tr> +<tr class="codeline" data-linenumber="919"><td class="num" id="LN919">919</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="920"><td class="num" id="LN920">920</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="921"><td class="num" id="LN921">921</td><td class="line"> gboolean can_suspend;</td></tr> +<tr class="codeline" data-linenumber="922"><td class="num" id="LN922">922</td><td class="line"> gchar *retval;</td></tr> +<tr class="codeline" data-linenumber="923"><td class="num" id="LN923">923</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="924"><td class="num" id="LN924">924</td><td class="line"> GsmConsolekitPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="925"><td class="num" id="LN925">925</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="926"><td class="num" id="LN926">926</td><td class="line"> priv = gsm_consolekit_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="927"><td class="num" id="LN927">927</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="928"><td class="num" id="LN928">928</td><td class="line"> <span class='keyword'>if</span> (!gsm_consolekit_ensure_ck_connection (manager, &error)) {</td></tr> +<tr class="codeline" data-linenumber="929"><td class="num" id="LN929">929</td><td class="line"> g_warning (<span class='string_literal'>"Could not connect to ConsoleKit: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="930"><td class="num" id="LN930">930</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="931"><td class="num" id="LN931">931</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="932"><td class="num" id="LN932">932</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="933"><td class="num" id="LN933">933</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="934"><td class="num" id="LN934">934</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="935"><td class="num" id="LN935">935</td><td class="line"> res = dbus_g_proxy_call_with_timeout (priv->ck_proxy,</td></tr> +<tr class="codeline" data-linenumber="936"><td class="num" id="LN936">936</td><td class="line"> <span class='string_literal'>"CanSuspend"</span>,</td></tr> +<tr class="codeline" data-linenumber="937"><td class="num" id="LN937">937</td><td class="line"> <span class='macro'>INT_MAX<span class='macro_popup'>2147483647</span></span>,</td></tr> +<tr class="codeline" data-linenumber="938"><td class="num" id="LN938">938</td><td class="line"> &error,</td></tr> +<tr class="codeline" data-linenumber="939"><td class="num" id="LN939">939</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="940"><td class="num" id="LN940">940</td><td class="line"> <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>, &retval,</td></tr> +<tr class="codeline" data-linenumber="941"><td class="num" id="LN941">941</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="942"><td class="num" id="LN942">942</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="943"><td class="num" id="LN943">943</td><td class="line"> <span class='keyword'>if</span> (res == <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="944"><td class="num" id="LN944">944</td><td class="line"> g_warning (<span class='string_literal'>"Could not make DBUS call: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="945"><td class="num" id="LN945">945</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="946"><td class="num" id="LN946">946</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="947"><td class="num" id="LN947">947</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="948"><td class="num" id="LN948">948</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="949"><td class="num" id="LN949">949</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="950"><td class="num" id="LN950">950</td><td class="line"> can_suspend = g_strcmp0 (retval, <span class='string_literal'>"yes"</span>) == 0 ||</td></tr> +<tr class="codeline" data-linenumber="951"><td class="num" id="LN951">951</td><td class="line"> g_strcmp0 (retval, <span class='string_literal'>"challenge"</span>) == 0;</td></tr> +<tr class="codeline" data-linenumber="952"><td class="num" id="LN952">952</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="953"><td class="num" id="LN953">953</td><td class="line"> g_free (retval);</td></tr> +<tr class="codeline" data-linenumber="954"><td class="num" id="LN954">954</td><td class="line"> <span class='keyword'>return</span> can_suspend;</td></tr> +<tr class="codeline" data-linenumber="955"><td class="num" id="LN955">955</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="956"><td class="num" id="LN956">956</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="957"><td class="num" id="LN957">957</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="958"><td class="num" id="LN958">958</td><td class="line">gsm_consolekit_can_hibernate (GsmConsolekit *manager)</td></tr> +<tr class="codeline" data-linenumber="959"><td class="num" id="LN959">959</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="960"><td class="num" id="LN960">960</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="961"><td class="num" id="LN961">961</td><td class="line"> gboolean can_hibernate;</td></tr> +<tr class="codeline" data-linenumber="962"><td class="num" id="LN962">962</td><td class="line"> gchar *retval;</td></tr> +<tr class="codeline" data-linenumber="963"><td class="num" id="LN963">963</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="964"><td class="num" id="LN964">964</td><td class="line"> GsmConsolekitPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="965"><td class="num" id="LN965">965</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="966"><td class="num" id="LN966">966</td><td class="line"> priv = gsm_consolekit_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="967"><td class="num" id="LN967">967</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="968"><td class="num" id="LN968">968</td><td class="line"> <span class='keyword'>if</span> (!gsm_consolekit_ensure_ck_connection (manager, &error)) {</td></tr> +<tr class="codeline" data-linenumber="969"><td class="num" id="LN969">969</td><td class="line"> g_warning (<span class='string_literal'>"Could not connect to ConsoleKit: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="970"><td class="num" id="LN970">970</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="971"><td class="num" id="LN971">971</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="972"><td class="num" id="LN972">972</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="973"><td class="num" id="LN973">973</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="974"><td class="num" id="LN974">974</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="975"><td class="num" id="LN975">975</td><td class="line"> res = dbus_g_proxy_call_with_timeout (priv->ck_proxy,</td></tr> +<tr class="codeline" data-linenumber="976"><td class="num" id="LN976">976</td><td class="line"> <span class='string_literal'>"CanHibernate"</span>,</td></tr> +<tr class="codeline" data-linenumber="977"><td class="num" id="LN977">977</td><td class="line"> <span class='macro'>INT_MAX<span class='macro_popup'>2147483647</span></span>,</td></tr> +<tr class="codeline" data-linenumber="978"><td class="num" id="LN978">978</td><td class="line"> &error,</td></tr> +<tr class="codeline" data-linenumber="979"><td class="num" id="LN979">979</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="980"><td class="num" id="LN980">980</td><td class="line"> <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>, &retval,</td></tr> +<tr class="codeline" data-linenumber="981"><td class="num" id="LN981">981</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="982"><td class="num" id="LN982">982</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="983"><td class="num" id="LN983">983</td><td class="line"> <span class='keyword'>if</span> (res == <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="984"><td class="num" id="LN984">984</td><td class="line"> g_warning (<span class='string_literal'>"Could not make DBUS call: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="985"><td class="num" id="LN985">985</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="986"><td class="num" id="LN986">986</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="987"><td class="num" id="LN987">987</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="988"><td class="num" id="LN988">988</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="989"><td class="num" id="LN989">989</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="990"><td class="num" id="LN990">990</td><td class="line"> can_hibernate = g_strcmp0 (retval, <span class='string_literal'>"yes"</span>) == 0 ||</td></tr> +<tr class="codeline" data-linenumber="991"><td class="num" id="LN991">991</td><td class="line"> g_strcmp0 (retval, <span class='string_literal'>"challenge"</span>) == 0;</td></tr> +<tr class="codeline" data-linenumber="992"><td class="num" id="LN992">992</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="993"><td class="num" id="LN993">993</td><td class="line"> g_free (retval);</td></tr> +<tr class="codeline" data-linenumber="994"><td class="num" id="LN994">994</td><td class="line"> <span class='keyword'>return</span> can_hibernate;</td></tr> +<tr class="codeline" data-linenumber="995"><td class="num" id="LN995">995</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="996"><td class="num" id="LN996">996</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="997"><td class="num" id="LN997">997</td><td class="line">gchar *</td></tr> +<tr class="codeline" data-linenumber="998"><td class="num" id="LN998">998</td><td class="line">gsm_consolekit_get_current_session_type (GsmConsolekit *manager)</td></tr> +<tr class="codeline" data-linenumber="999"><td class="num" id="LN999">999</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1000"><td class="num" id="LN1000">1000</td><td class="line"> GError *gerror;</td></tr> +<tr class="codeline" data-linenumber="1001"><td class="num" id="LN1001">1001</td><td class="line"> DBusConnection *connection;</td></tr> +<tr class="codeline" data-linenumber="1002"><td class="num" id="LN1002">1002</td><td class="line"> DBusError error;</td></tr> +<tr class="codeline" data-linenumber="1003"><td class="num" id="LN1003">1003</td><td class="line"> DBusMessage *message = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1004"><td class="num" id="LN1004">1004</td><td class="line"> DBusMessage *reply = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1005"><td class="num" id="LN1005">1005</td><td class="line"> gchar *session_id;</td></tr> +<tr class="codeline" data-linenumber="1006"><td class="num" id="LN1006">1006</td><td class="line"> gchar *ret;</td></tr> +<tr class="codeline" data-linenumber="1007"><td class="num" id="LN1007">1007</td><td class="line"> DBusMessageIter iter;</td></tr> +<tr class="codeline" data-linenumber="1008"><td class="num" id="LN1008">1008</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *value;</td></tr> +<tr class="codeline" data-linenumber="1009"><td class="num" id="LN1009">1009</td><td class="line"> GsmConsolekitPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1010"><td class="num" id="LN1010">1010</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1011"><td class="num" id="LN1011">1011</td><td class="line"> session_id = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1012"><td class="num" id="LN1012">1012</td><td class="line"> ret = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1013"><td class="num" id="LN1013">1013</td><td class="line"> gerror = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1014"><td class="num" id="LN1014">1014</td><td class="line"> priv = gsm_consolekit_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1015"><td class="num" id="LN1015">1015</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1016"><td class="num" id="LN1016">1016</td><td class="line"> <span class='keyword'>if</span> (!gsm_consolekit_ensure_ck_connection (manager, &gerror)) {</td></tr> +<tr class="codeline" data-linenumber="1017"><td class="num" id="LN1017">1017</td><td class="line"> g_warning (<span class='string_literal'>"Could not connect to ConsoleKit: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="1018"><td class="num" id="LN1018">1018</td><td class="line"> gerror->message);</td></tr> +<tr class="codeline" data-linenumber="1019"><td class="num" id="LN1019">1019</td><td class="line"> g_error_free (gerror);</td></tr> +<tr class="codeline" data-linenumber="1020"><td class="num" id="LN1020">1020</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1021"><td class="num" id="LN1021">1021</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1022"><td class="num" id="LN1022">1022</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1023"><td class="num" id="LN1023">1023</td><td class="line"> connection = dbus_g_connection_get_connection (priv->dbus_connection);</td></tr> +<tr class="codeline" data-linenumber="1024"><td class="num" id="LN1024">1024</td><td class="line"> <span class='keyword'>if</span> (!get_current_session_id (connection, &session_id)) {</td></tr> +<tr class="codeline" data-linenumber="1025"><td class="num" id="LN1025">1025</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1026"><td class="num" id="LN1026">1026</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1027"><td class="num" id="LN1027">1027</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1028"><td class="num" id="LN1028">1028</td><td class="line"> dbus_error_init (&error);</td></tr> +<tr class="codeline" data-linenumber="1029"><td class="num" id="LN1029">1029</td><td class="line"> message = dbus_message_new_method_call (<span class='macro'>CK_NAME<span class='macro_popup'>"org.freedesktop.ConsoleKit"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1030"><td class="num" id="LN1030">1030</td><td class="line"> session_id,</td></tr> +<tr class="codeline" data-linenumber="1031"><td class="num" id="LN1031">1031</td><td class="line"> <span class='macro'>CK_SESSION_INTERFACE<span class='macro_popup'>"org.freedesktop.ConsoleKit.Session"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1032"><td class="num" id="LN1032">1032</td><td class="line"> <span class='string_literal'>"GetSessionType"</span>);</td></tr> +<tr class="codeline" data-linenumber="1033"><td class="num" id="LN1033">1033</td><td class="line"> <span class='keyword'>if</span> (message == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1034"><td class="num" id="LN1034">1034</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1035"><td class="num" id="LN1035">1035</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1036"><td class="num" id="LN1036">1036</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1037"><td class="num" id="LN1037">1037</td><td class="line"> reply = dbus_connection_send_with_reply_and_block (connection,</td></tr> +<tr class="codeline" data-linenumber="1038"><td class="num" id="LN1038">1038</td><td class="line"> message,</td></tr> +<tr class="codeline" data-linenumber="1039"><td class="num" id="LN1039">1039</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="1040"><td class="num" id="LN1040">1040</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="1041"><td class="num" id="LN1041">1041</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1042"><td class="num" id="LN1042">1042</td><td class="line"> <span class='keyword'>if</span> (reply == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1043"><td class="num" id="LN1043">1043</td><td class="line"> <span class='keyword'>if</span> (dbus_error_is_set (&error)) {</td></tr> +<tr class="codeline" data-linenumber="1044"><td class="num" id="LN1044">1044</td><td class="line"> g_warning (<span class='string_literal'>"Unable to determine session type: %s"</span>, error.message);</td></tr> +<tr class="codeline" data-linenumber="1045"><td class="num" id="LN1045">1045</td><td class="line"> dbus_error_free (&error);</td></tr> +<tr class="codeline" data-linenumber="1046"><td class="num" id="LN1046">1046</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1047"><td class="num" id="LN1047">1047</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1048"><td class="num" id="LN1048">1048</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1049"><td class="num" id="LN1049">1049</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1050"><td class="num" id="LN1050">1050</td><td class="line"> dbus_message_iter_init (reply, &iter);</td></tr> +<tr class="codeline" data-linenumber="1051"><td class="num" id="LN1051">1051</td><td class="line"> dbus_message_iter_get_basic (&iter, &value);</td></tr> +<tr class="codeline" data-linenumber="1052"><td class="num" id="LN1052">1052</td><td class="line"> ret = <span class='macro'>g_strdup (value)<span class='macro_popup'>g_strdup_inline (value)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1053"><td class="num" id="LN1053">1053</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1054"><td class="num" id="LN1054">1054</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="1055"><td class="num" id="LN1055">1055</td><td class="line"> <span class='keyword'>if</span> (message != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1056"><td class="num" id="LN1056">1056</td><td class="line"> dbus_message_unref (message);</td></tr> +<tr class="codeline" data-linenumber="1057"><td class="num" id="LN1057">1057</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1058"><td class="num" id="LN1058">1058</td><td class="line"> <span class='keyword'>if</span> (reply != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1059"><td class="num" id="LN1059">1059</td><td class="line"> dbus_message_unref (reply);</td></tr> +<tr class="codeline" data-linenumber="1060"><td class="num" id="LN1060">1060</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1061"><td class="num" id="LN1061">1061</td><td class="line"> g_free (session_id);</td></tr> +<tr class="codeline" data-linenumber="1062"><td class="num" id="LN1062">1062</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1063"><td class="num" id="LN1063">1063</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="1064"><td class="num" id="LN1064">1064</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1065"><td class="num" id="LN1065">1065</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1066"><td class="num" id="LN1066">1066</td><td class="line">GsmConsolekit *</td></tr> +<tr class="codeline" data-linenumber="1067"><td class="num" id="LN1067">1067</td><td class="line">gsm_get_consolekit (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="1068"><td class="num" id="LN1068">1068</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1069"><td class="num" id="LN1069">1069</td><td class="line"> <span class='keyword'>static</span> GsmConsolekit *manager = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1070"><td class="num" id="LN1070">1070</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1071"><td class="num" id="LN1071">1071</td><td class="line"> <span class='keyword'>if</span> (manager == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1072"><td class="num" id="LN1072">1072</td><td class="line"> manager = gsm_consolekit_new ();</td></tr> +<tr class="codeline" data-linenumber="1073"><td class="num" id="LN1073">1073</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1074"><td class="num" id="LN1074">1074</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1075"><td class="num" id="LN1075">1075</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>g_object_ref (manager)<span class='macro_popup'>((__typeof__ (manager)) (g_object_ref) (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1076"><td class="num" id="LN1076">1076</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-1f463e.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-1f463e.html new file mode 100644 index 0000000..a1a16e4 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-1f463e.html @@ -0,0 +1,967 @@ +<!doctype html> +<html> +<head> +<title>mate-session-save.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC This statement is never executed --> + +<!-- BUGTYPE Unreachable code --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/tools/mate-session-save.c --> + +<!-- FILENAME mate-session-save.c --> + +<!-- FUNCTIONNAME main --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 1f463eec4870c6e88e9bf984c665b594 --> + +<!-- BUGLINE 254 --> + +<!-- BUGCOLUMN 3 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>tools/mate-session-save.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 254, column 3</a><br />This statement is never executed</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mate-session-save.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/tools -fcoverage-compilation-dir=/rootdir/tools -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -D LOCALE_DIR="/usr/local/share/locale" -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c mate-session-save.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"254": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* save-session.c - Small program to talk to session manager.</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>Copyright (C) 1998 Tom Tromey</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>Copyright (C) 2008 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>This program is free software; you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>it under the terms of the GNU General Public License as published by</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>the Free Software Foundation; either version 2, or (at your option)</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>any later version.</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"><span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <config.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_SERVICE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_PATH_DBUS<span class='macro_popup'>"/org/gnome/SessionManager"</span></span> "/org/gnome/SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_INTERFACE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_SERVICE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span> "org.mate.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_PATH_DBUS_OLD<span class='macro_popup'>"/org/mate/SessionManager"</span></span> "/org/mate/SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_INTERFACE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span> "org.mate.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> GSM_LOGOUT_MODE_NORMAL = 0,</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> GSM_LOGOUT_MODE_NO_CONFIRMATION,</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> GSM_LOGOUT_MODE_FORCE</td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='comment'>/* True if killing. This is deprecated, but we keep it for compatibility</span></td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> <span class='comment'>* reasons. */</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> gboolean kill_session = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"><span class='comment'>/* The real options that should be used now. They are not ambiguous. */</span></td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='keyword'>static</span> gboolean logout = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"><span class='keyword'>static</span> gboolean force_logout = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"><span class='keyword'>static</span> gboolean logout_dialog = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"><span class='keyword'>static</span> gboolean shutdown_dialog = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"><span class='comment'>/* True if we should use dialog boxes */</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"><span class='keyword'>static</span> gboolean show_error_dialogs = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"><span class='comment'>/* True if we should do the requested action without confirmation */</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"><span class='keyword'>static</span> gboolean no_interaction = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>char</span>* session_name = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"><span class='keyword'>static</span> GOptionEntry options[] = {</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> {<span class='string_literal'>"logout"</span>, '\0', 0, G_OPTION_ARG_NONE, &logout, <span class='macro'>N_(<span class='string_literal'>"Log out"</span>)<span class='macro_popup'>("Log out")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> {<span class='string_literal'>"force-logout"</span>, '\0', 0, G_OPTION_ARG_NONE, &force_logout, <span class='macro'>N_(<span class='string_literal'>"Log out, ignoring any existing inhibitors"</span>)<span class='macro_popup'>("Log out, ignoring any existing inhibitors")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> {<span class='string_literal'>"logout-dialog"</span>, '\0', 0, G_OPTION_ARG_NONE, &logout_dialog, <span class='macro'>N_(<span class='string_literal'>"Show logout dialog"</span>)<span class='macro_popup'>("Show logout dialog")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> {<span class='string_literal'>"shutdown-dialog"</span>, '\0', 0, G_OPTION_ARG_NONE, &shutdown_dialog, <span class='macro'>N_(<span class='string_literal'>"Show shutdown dialog"</span>)<span class='macro_popup'>("Show shutdown dialog")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> {<span class='string_literal'>"gui"</span>, '\0', 0, G_OPTION_ARG_NONE, &show_error_dialogs, <span class='macro'>N_(<span class='string_literal'>"Use dialog boxes for errors"</span>)<span class='macro_popup'>("Use dialog boxes for errors")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> <span class='comment'>/* deprecated options */</span></td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> {<span class='string_literal'>"session-name"</span>, 's', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &session_name, <span class='macro'>N_(<span class='string_literal'>"Set the current session name"</span>)<span class='macro_popup'>("Set the current session name")</span></span>, <span class='macro'>N_(<span class='string_literal'>"NAME"</span>)<span class='macro_popup'>("NAME")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> {<span class='string_literal'>"kill"</span>, '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &kill_session, <span class='macro'>N_(<span class='string_literal'>"Kill session"</span>)<span class='macro_popup'>("Kill session")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> {<span class='string_literal'>"silent"</span>, '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &no_interaction, <span class='macro'>N_(<span class='string_literal'>"Do not require confirmation"</span>)<span class='macro_popup'>("Do not require confirmation")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> {<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, 0, G_OPTION_ARG_NONE, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>}</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> display_error(<span class='keyword'>const</span> <span class='keyword'>char</span>* message)</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> <span class='keyword'>if</span> (show_error_dialogs && !no_interaction)</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> GtkWidget* dialog = gtk_message_dialog_new(<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, <span class='string_literal'>"%s"</span>, message);</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> gtk_window_set_default_icon_name (<span class='string_literal'>"dialog-error"</span>);</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> gtk_dialog_run(<span class='macro'>GTK_DIALOG(dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> gtk_widget_destroy(dialog);</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> g_printerr(<span class='string_literal'>"%s\n"</span>, message);</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"><span class='keyword'>static</span> GDBusProxy* get_sm_proxy(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> GDBusProxy *sm_proxy = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> sm_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> G_DBUS_PROXY_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> <span class='macro'>GSM_SERVICE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> <span class='macro'>GSM_PATH_DBUS<span class='macro_popup'>"/org/gnome/SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='macro'>GSM_INTERFACE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> g_warning (<span class='string_literal'>"Couldn't create DBus proxy: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> <span class='comment'>/* Try the old name - for the case when we've just upgraded from 1.10</span></td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> <span class='comment'>* so the old m-s-m is currently running */</span></td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> sm_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> G_DBUS_PROXY_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> <span class='macro'>GSM_SERVICE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='macro'>GSM_PATH_DBUS_OLD<span class='macro_popup'>"/org/mate/SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> <span class='macro'>GSM_INTERFACE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> <span class='comment'>/* Okay, it wasn't the upgrade case, so now we can give up. */</span></td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> display_error (<span class='macro'>_(<span class='string_literal'>"Could not connect to the session manager"</span>)<span class='macro_popup'>gettext ("Could not connect to the session manager")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> do_logout(<span class='keyword'>unsigned</span> <span class='keyword'>int</span> mode)</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> GDBusProxy* sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> GVariant *ret;</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> sm_proxy = get_sm_proxy ();</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> ret = g_dbus_proxy_call_sync (sm_proxy, <span class='string_literal'>"Logout"</span>,</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> g_variant_new (<span class='string_literal'>"(u)"</span>, mode),</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> G_DBUS_CALL_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> <span class='keyword'>if</span> (ret == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> g_warning (<span class='string_literal'>"Failed to call logout: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> g_variant_unref (ret);</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> <span class='keyword'>if</span> (sm_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> g_object_unref (sm_proxy);</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> do_shutdown_dialog(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> GDBusProxy* sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> GVariant *ret;</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> sm_proxy = get_sm_proxy ();</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> ret = g_dbus_proxy_call_sync (sm_proxy, <span class='string_literal'>"Shutdown"</span>,</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> g_variant_new (<span class='string_literal'>"()"</span>),</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> G_DBUS_CALL_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='keyword'>if</span> (ret == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> g_warning (<span class='string_literal'>"Failed to call shutdown: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> g_variant_unref (ret);</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='keyword'>if</span> (sm_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> g_object_unref (sm_proxy);</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"><span class='keyword'>int</span> main(<span class='keyword'>int</span> argc, <span class='keyword'>char</span>* argv[])</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='keyword'>int</span> conflicting_options;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> <span class='comment'>/* Initialize the i18n stuff */</span></td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"><span class='directive'>#ifdef <span class='macro'>ENABLE_NLS<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> bindtextdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='macro'>LOCALE_DIR<span class='macro_popup'>"/usr/local/share/locale"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> bind_textdomain_codeset(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='string_literal'>"UTF-8"</span>);</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> textdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"><span class='directive'>#endif /* ENABLE_NLS */</span></td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='keyword'>if</span> (!gtk_init_with_args(&argc, &argv, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, options, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &error))</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> g_warning(<span class='string_literal'>"Unable to start: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> g_error_free(error);</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> exit(1);</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> conflicting_options = 0;</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (kill_session)</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> <span class='keyword'>if</span> (logout)</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='keyword'>if</span> (force_logout)</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> <span class='keyword'>if</span> (logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>if</span> (shutdown_dialog)</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> <span class='keyword'>if</span> (conflicting_options > 1)</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> <span class="mrange">display_error</span>(<span class='macro'>_(<span class='string_literal'>"Program called with conflicting options"</span>)<span class='macro_popup'>gettext ("Program called with conflicting options")</span></span>);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:17ex">This statement is never executed</div></td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> <span class='keyword'>if</span> (kill_session)</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>if</span> (no_interaction)</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> force_logout = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> logout_dialog = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> <span class='keyword'>if</span> (logout)</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> do_logout(GSM_LOGOUT_MODE_NO_CONFIRMATION);</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (force_logout)</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> do_logout(GSM_LOGOUT_MODE_FORCE);</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> do_logout(GSM_LOGOUT_MODE_NORMAL);</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (shutdown_dialog)</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> do_shutdown_dialog();</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> <span class='keyword'>return</span> 0;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-27b446.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-27b446.html new file mode 100644 index 0000000..71fb473 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-27b446.html @@ -0,0 +1,1314 @@ +<!doctype html> +<html> +<head> +<title>gsm-app-dialog.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC 1st function call argument is an uninitialized value --> + +<!-- BUGTYPE Uninitialized argument value --> + +<!-- BUGCATEGORY Logic error --> + +<!-- BUGFILE /rootdir/capplet/gsm-app-dialog.c --> + +<!-- FILENAME gsm-app-dialog.c --> + +<!-- FUNCTIONNAME gsm_app_dialog_run --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 27b446f7075eb480970e78499a53886c --> + +<!-- BUGLINE 583 --> + +<!-- BUGCOLUMN 17 --> + +<!-- BUGPATHLENGTH 12 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>capplet/gsm-app-dialog.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 583, column 17</a><br />1st function call argument is an uninitialized value</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name gsm-app-dialog.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/capplet -fcoverage-compilation-dir=/rootdir/capplet -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/freetype2 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/harfbuzz -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -I ../mate-session -D LOCALE_DIR="/usr/local/share/locale" -D GTKBUILDER_DIR="/usr/local/share/mate-session-manager" -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c gsm-app-dialog.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"68": 1, "366": 1, "367": 1, "368": 1, "369": 1, "370": 1, "373": 1, "374": 1, "375": 1, "376": 1, "377": 1, "380": 1, "381": 1, "382": 1, "383": 1, "384": 1, "387": 1, "388": 1, "389": 1, "390": 1, "391": 1, "514": 1, "515": 1, "516": 1, "517": 1, "518": 1, "519": 1, "520": 1, "521": 1, "523": 1, "525": 1, "526": 1, "527": 1, "528": 1, "529": 1, "530": 1, "531": 1, "532": 1, "533": 1, "535": 1, "536": 1, "537": 1, "538": 1, "540": 1, "541": 1, "543": 1, "544": 1, "555": 1, "575": 1, "579": 1, "583": 1}, "77693": {"31": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + <path class="arrow" id="arrow0"/> + <path class="arrow" id="arrow1"/> + <path class="arrow" id="arrow2"/> + <path class="arrow" id="arrow3"/> + <path class="arrow" id="arrow4"/> + <path class="arrow" id="arrow5"/> + <path class="arrow" id="arrow6"/> + <path class="arrow" id="arrow7"/> + <path class="arrow" id="arrow8"/> + <path class="arrow" id="arrow9"/> + <path class="arrow" id="arrow10"/> + <path class="arrow" id="arrow11"/> + <path class="arrow" id="arrow12"/> + <path class="arrow" id="arrow13"/> + <path class="arrow" id="arrow14"/> + <path class="arrow" id="arrow15"/> + <path class="arrow" id="arrow16"/> + <path class="arrow" id="arrow17"/> + <path class="arrow" id="arrow18"/> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 19,17,16,15,13,11,8,6,5,3,3,1,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2008 William Jon McCann <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This program is free software; you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* it under the terms of the GNU General Public License as published by</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* the Free Software Foundation; either version 2 of the License, or</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"><span class='directive'>#include "config.h"</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <glib.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include "gsm-util.h"</span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='directive'>#include "gsm-app-dialog.h"</span></td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#define <span class='macro'>GTKBUILDER_FILE<span class='macro_popup'>"session-properties.ui"</span></span> "session-properties.ui"</span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#define <span class='macro'>CAPPLET_NAME_ENTRY_WIDGET_NAME<span class='macro_popup'>"session_properties_name_entry"</span></span> "session_properties_name_entry"</span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#define <span class='macro'>CAPPLET_COMMAND_ENTRY_WIDGET_NAME<span class='macro_popup'>"session_properties_command_entry"</span></span> "session_properties_command_entry"</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#define <span class='macro'>CAPPLET_COMMENT_ENTRY_WIDGET_NAME<span class='macro_popup'>"session_properties_comment_entry"</span></span> "session_properties_comment_entry"</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"><span class='directive'>#define <span class='macro'>CAPPLET_DELAY_SPIN_WIDGET_NAME<span class='macro_popup'>"session_properties_delay_spin"</span></span> "session_properties_delay_spin"</span></td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"><span class='directive'>#define <span class='macro'>CAPPLET_BROWSE_WIDGET_NAME<span class='macro_popup'>"session_properties_browse_button"</span></span> "session_properties_browse_button"</span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#ifdef <span class='macro'>__GNUC__<span class='macro_popup'>4</span></span></span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"><span class='directive'>#define <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> __attribute__ ((unused))</span></td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='directive'>#else</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"><span class='directive'>#define <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span></span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"><span class='keyword'>struct</span> _GsmAppDialog</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"> GtkDialog parent;</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> GtkWidget *name_entry;</td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> GtkWidget *command_entry;</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> GtkWidget *comment_entry;</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> GtkWidget *delay_spin;</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> GtkWidget *browse_button;</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> <span class='keyword'>char</span> *name;</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> <span class='keyword'>char</span> *command;</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> <span class='keyword'>char</span> *comment;</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> guint delay;</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> PROP_0,</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> PROP_NAME,</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> PROP_COMMAND,</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> PROP_COMMENT,</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> PROP_DELAY</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"><span class='macro'>G_DEFINE_TYPE (GsmAppDialog, gsm_app_dialog, GTK_TYPE_DIALOG)<span class='macro_popup'>static void gsm_app_dialog_init (GsmAppDialog *self); static void<br> gsm_app_dialog_class_init (GsmAppDialogClass *klass); static<br> GType gsm_app_dialog_get_type_once (void); static gpointer gsm_app_dialog_parent_class<br> = ((void*)0); static gint GsmAppDialog_private_offset; static<br> void gsm_app_dialog_class_intern_init (gpointer klass) { gsm_app_dialog_parent_class<br> = g_type_class_peek_parent (klass); if (GsmAppDialog_private_offset<br> != 0) g_type_class_adjust_private_offset (klass, &GsmAppDialog_private_offset<br>); gsm_app_dialog_class_init ((GsmAppDialogClass*) klass); } __attribute__<br> ((__unused__)) static inline gpointer gsm_app_dialog_get_instance_private<br> (GsmAppDialog *self) { return (((gpointer) ((guint8*) (self)<br> + (glong) (GsmAppDialog_private_offset)))); } GType gsm_app_dialog_get_type<br> (void) { static GType static_g_define_type_id = 0; if ((__extension__<br> ({ _Static_assert (sizeof *(&static_g_define_type_id) ==<br> sizeof (gpointer), "Expression evaluates to false"); (void) (<br>0 ? (gpointer) * (&static_g_define_type_id) : ((void*)0))<br>; (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); __typeof__<br> (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__<br> ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id<br>); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)<br>; gapg_temp_newval; })) && g_once_init_enter_pointer (<br>&static_g_define_type_id)); })) ) { GType g_define_type_id<br> = gsm_app_dialog_get_type_once (); (__extension__ ({ _Static_assert<br> (sizeof *(&static_g_define_type_id) == sizeof (gpointer)<br>, "Expression evaluates to false"); 0 ? (void) (*(&static_g_define_type_id<br>) = (g_define_type_id)) : (void) 0; g_once_init_leave_pointer<br> ((&static_g_define_type_id), (gpointer) (guintptr) (g_define_type_id<br>)); })) ; } return static_g_define_type_id; } __attribute__ (<br>(__noinline__)) static GType gsm_app_dialog_get_type_once (void<br>) { GType g_define_type_id = g_type_register_static_simple ((<br>gtk_dialog_get_type ()), g_intern_static_string ("GsmAppDialog"<br>), sizeof (GsmAppDialogClass), (GClassInitFunc)(void (*)(void<br>)) gsm_app_dialog_class_intern_init, sizeof (GsmAppDialog), (<br>GInstanceInitFunc)(void (*)(void)) gsm_app_dialog_init, (GTypeFlags<br>) 0); { {{};} } return g_define_type_id; }</span></span></td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>char</span> *</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">make_exec_uri (<span class='keyword'>const</span> <span class='keyword'>char</span> *exec)</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> GString *str;</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *c;</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> <span class='keyword'>if</span> (exec == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>g_strdup (<span class='string_literal'>""</span>)<span class='macro_popup'>g_strdup_inline ("")</span></span>;</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> <span class='keyword'>if</span> (strchr (exec, ' ') == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>g_strdup (exec)<span class='macro_popup'>g_strdup_inline (exec)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> str = g_string_new_len (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, strlen (exec));</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> str = <span class='macro'>g_string_append_c (str, '"')<span class='macro_popup'>g_string_append_c_inline (str, '"')</span></span>;</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> <span class='keyword'>for</span> (c = exec; *c != '\0'; c++) {</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> <span class='comment'>/* FIXME: GKeyFile will add an additional backslach so we'll</span></td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> <span class='comment'>* end up with toto\\" instead of toto\"</span></td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> <span class='comment'>* We could use g_key_file_set_value(), but then we don't</span></td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> <span class='comment'>* benefit from the other escaping that glib is doing...</span></td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> <span class='keyword'>if</span> (*c == '"') {</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> str = <span class='macro'>g_string_append (str, <span class='string_literal'>"\\\""</span>)<span class='macro_popup'>(__builtin_constant_p ("\\\"") ? __extension__ ({ const char *<br> const __val = ("\\\""); g_string_append_len_inline (str, __val<br>, (__val != ((void*)0)) ? (gssize) strlen (((__val) + !(__val<br>))) : (gssize) -1); }) : g_string_append_len_inline (str, "\\\""<br>, (gssize) -1))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> str = <span class='macro'>g_string_append_c (str, *c)<span class='macro_popup'>g_string_append_c_inline (str, *c)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> str = <span class='macro'>g_string_append_c (str, '"')<span class='macro_popup'>g_string_append_c_inline (str, '"')</span></span>;</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>g_string_free (str, FALSE)<span class='macro_popup'>(__builtin_constant_p ((0)) ? (((0)) ? (g_string_free) ((str)<br>, ((0))) : g_string_free_and_steal (str)) : (g_string_free) (<br>(str), ((0))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line">on_browse_button_clicked (GtkWidget *widget,</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> GtkWidget *chooser;</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='keyword'>int</span> response;</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> chooser = gtk_file_chooser_dialog_new (<span class='string_literal'>""</span>,</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> <span class='macro'>GTK_WINDOW (dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> GTK_FILE_CHOOSER_ACTION_OPEN,</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> <span class='string_literal'>"gtk-cancel"</span>,</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> GTK_RESPONSE_CANCEL,</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> <span class='string_literal'>"gtk-open"</span>,</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> GTK_RESPONSE_ACCEPT,</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> gtk_window_set_transient_for (<span class='macro'>GTK_WINDOW (chooser)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((chooser)), ((gtk_window_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> <span class='macro'>GTK_WINDOW (dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> gtk_window_set_destroy_with_parent (<span class='macro'>GTK_WINDOW (chooser)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((chooser)), ((gtk_window_get_type ()))))))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> gtk_window_set_title (<span class='macro'>GTK_WINDOW (chooser)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((chooser)), ((gtk_window_get_type ()))))))</span></span>, <span class='macro'>_(<span class='string_literal'>"Select Command"</span>)<span class='macro_popup'>gettext ("Select Command")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> gtk_widget_show (chooser);</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> response = gtk_dialog_run (<span class='macro'>GTK_DIALOG (chooser)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((chooser)), ((gtk_dialog_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> <span class='keyword'>if</span> (response == GTK_RESPONSE_ACCEPT) {</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>char</span> *text;</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> <span class='keyword'>char</span> *uri;</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> text = gtk_file_chooser_get_filename (<span class='macro'>GTK_FILE_CHOOSER (chooser)<span class='macro_popup'>((((GtkFileChooser*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((chooser)), ((gtk_file_chooser_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> uri = make_exec_uri (text);</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> g_free (text);</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> gtk_entry_set_text (<span class='macro'>GTK_ENTRY (dialog->command_entry)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog->command_entry)), ((gtk_entry_get_type ())))))<br>)</span></span>, uri);</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> g_free (uri);</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> gtk_widget_destroy (chooser);</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line">on_entry_activate (GtkEntry *entry,</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> gtk_dialog_response (<span class='macro'>GTK_DIALOG (dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>, GTK_RESPONSE_OK);</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line">on_spin_output (GtkSpinButton *spin, GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> GtkAdjustment *adjustment;</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> gchar *text;</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> <span class='keyword'>int</span> value;</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> adjustment = gtk_spin_button_get_adjustment (spin);</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> value = gtk_adjustment_get_value (adjustment);</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> dialog->delay = value;</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> <span class='keyword'>if</span> (value == 1)</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> text = g_strdup_printf (<span class='string_literal'>"%d %s"</span>, value, <span class='macro'>_(<span class='string_literal'>"second"</span>)<span class='macro_popup'>gettext ("second")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (value > 1)</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> text = g_strdup_printf (<span class='string_literal'>"%d %s"</span>, value, <span class='macro'>_(<span class='string_literal'>"seconds"</span>)<span class='macro_popup'>gettext ("seconds")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> text = g_strdup_printf (<span class='string_literal'>"%d"</span>, value);</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> gtk_entry_set_text (<span class='macro'>GTK_ENTRY (spin)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((spin)), ((gtk_entry_get_type ()))))))</span></span>, text);</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> g_free (text);</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line">setup_dialog (GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> GtkWidget *content_area;</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> GtkWidget *widget;</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> GtkBuilder *xml;</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> xml = gtk_builder_new ();</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"><span class='directive'>#ifdef <span class='macro'>ENABLE_NLS<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> gtk_builder_set_translation_domain (xml, <span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"><span class='directive'>#endif /* ENABLE_NLS */</span></td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='keyword'>if</span> (!gtk_builder_add_from_file (xml,</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='macro'>GTKBUILDER_DIR<span class='macro_popup'>"/usr/local/share/mate-session-manager"</span></span> <span class='string_literal'>"/"</span> <span class='macro'>GTKBUILDER_FILE<span class='macro_popup'>"session-properties.ui"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> &error)) {</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='keyword'>if</span> (error) {</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> g_warning (<span class='string_literal'>"Could not load capplet UI file: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> g_warning (<span class='string_literal'>"Could not load capplet UI file."</span>);</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> content_area = gtk_dialog_get_content_area (<span class='macro'>GTK_DIALOG (dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> widget = <span class='macro'>GTK_WIDGET (gtk_builder_get_object (xml, <span class='string_literal'>"main-table"</span>))<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object (xml, "main-table"))), ((gtk_widget_get_type<br> ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> gtk_container_add (<span class='macro'>GTK_CONTAINER (content_area)<span class='macro_popup'>((((GtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((content_area)), ((gtk_container_get_type ()))))))</span></span>, widget);</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> gtk_container_set_border_width (<span class='macro'>GTK_CONTAINER (dialog)<span class='macro_popup'>((((GtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_container_get_type ()))))))</span></span>, 6);</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> gtk_window_set_icon_name (<span class='macro'>GTK_WINDOW (dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>, <span class='string_literal'>"mate-session-properties"</span>);</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> g_object_set (dialog,</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> <span class='string_literal'>"resizable"</span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Cancel"</span>)<span class='macro_popup'>gettext ("_Cancel")</span></span>, <span class='string_literal'>"process-stop"</span>,</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> GTK_RESPONSE_CANCEL);</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='keyword'>if</span> (dialog->name == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span></td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> && dialog->command == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span></td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> && dialog->comment == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> gtk_window_set_title (<span class='macro'>GTK_WINDOW (dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>, <span class='macro'>_(<span class='string_literal'>"Add Startup Program"</span>)<span class='macro_popup'>gettext ("Add Startup Program")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Add"</span>)<span class='macro_popup'>gettext ("_Add")</span></span>, <span class='string_literal'>"list-add"</span>,</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> GTK_RESPONSE_OK);</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> gtk_window_set_title (<span class='macro'>GTK_WINDOW (dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>, <span class='macro'>_(<span class='string_literal'>"Edit Startup Program"</span>)<span class='macro_popup'>gettext ("Edit Startup Program")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Save"</span>)<span class='macro_popup'>gettext ("_Save")</span></span>, <span class='string_literal'>"document-save"</span>,</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> GTK_RESPONSE_OK);</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> dialog->name_entry = <span class='macro'>GTK_WIDGET (gtk_builder_get_object (xml, CAPPLET_NAME_ENTRY_WIDGET_NAME))<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object (xml, "session_properties_name_entry"<br>))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> <span class='macro'>g_signal_connect (dialog->name_entry,<span class='macro_popup'>g_signal_connect_data ((dialog->name_entry), ("activate"),<br> (((GCallback) (on_entry_activate))), (dialog), ((void*)0), (<br>GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='string_literal'><span class='macro'>"activate"</span>,<span class='macro_popup'>g_signal_connect_data ((dialog->name_entry), ("activate"),<br> (((GCallback) (on_entry_activate))), (dialog), ((void*)0), (<br>GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> <span class='macro'>G_CALLBACK (on_entry_activate),<span class='macro_popup'>g_signal_connect_data ((dialog->name_entry), ("activate"),<br> (((GCallback) (on_entry_activate))), (dialog), ((void*)0), (<br>GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> <span class='macro'>dialog)<span class='macro_popup'>g_signal_connect_data ((dialog->name_entry), ("activate"),<br> (((GCallback) (on_entry_activate))), (dialog), ((void*)0), (<br>GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> <span class='keyword'>if</span> (dialog->name != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> gtk_entry_set_text (<span class='macro'>GTK_ENTRY (dialog->name_entry)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog->name_entry)), ((gtk_entry_get_type ()))))))</span></span>, dialog->name);</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> dialog->browse_button = <span class='macro'>GTK_WIDGET (gtk_builder_get_object (xml, CAPPLET_BROWSE_WIDGET_NAME))<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object (xml, "session_properties_browse_button"<br>))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> <span class='macro'>g_signal_connect (dialog->browse_button,<span class='macro_popup'>g_signal_connect_data ((dialog->browse_button), ("clicked"<br>), (((GCallback) (on_browse_button_clicked))), (dialog), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> <span class='string_literal'><span class='macro'>"clicked"</span>,<span class='macro_popup'>g_signal_connect_data ((dialog->browse_button), ("clicked"<br>), (((GCallback) (on_browse_button_clicked))), (dialog), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='macro'>G_CALLBACK (on_browse_button_clicked),<span class='macro_popup'>g_signal_connect_data ((dialog->browse_button), ("clicked"<br>), (((GCallback) (on_browse_button_clicked))), (dialog), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> <span class='macro'>dialog)<span class='macro_popup'>g_signal_connect_data ((dialog->browse_button), ("clicked"<br>), (((GCallback) (on_browse_button_clicked))), (dialog), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> dialog->command_entry = <span class='macro'>GTK_WIDGET (gtk_builder_get_object (xml, CAPPLET_COMMAND_ENTRY_WIDGET_NAME))<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object (xml, "session_properties_command_entry"<br>))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> <span class='macro'>g_signal_connect (dialog->command_entry,<span class='macro_popup'>g_signal_connect_data ((dialog->command_entry), ("activate"<br>), (((GCallback) (on_entry_activate))), (dialog), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> <span class='string_literal'><span class='macro'>"activate"</span>,<span class='macro_popup'>g_signal_connect_data ((dialog->command_entry), ("activate"<br>), (((GCallback) (on_entry_activate))), (dialog), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='macro'>G_CALLBACK (on_entry_activate),<span class='macro_popup'>g_signal_connect_data ((dialog->command_entry), ("activate"<br>), (((GCallback) (on_entry_activate))), (dialog), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> <span class='macro'>dialog)<span class='macro_popup'>g_signal_connect_data ((dialog->command_entry), ("activate"<br>), (((GCallback) (on_entry_activate))), (dialog), ((void*)0),<br> (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> <span class='keyword'>if</span> (dialog->command != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> gtk_entry_set_text (<span class='macro'>GTK_ENTRY (dialog->command_entry)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog->command_entry)), ((gtk_entry_get_type ())))))<br>)</span></span>, dialog->command);</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> dialog->comment_entry = <span class='macro'>GTK_WIDGET (gtk_builder_get_object (xml, CAPPLET_COMMENT_ENTRY_WIDGET_NAME))<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object (xml, "session_properties_comment_entry"<br>))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> <span class='macro'>g_signal_connect (dialog->comment_entry,<span class='macro_popup'>g_signal_connect_data ((dialog->comment_entry), ("activate"<br>), (((GCallback) (on_entry_activate))), (dialog), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='string_literal'><span class='macro'>"activate"</span>,<span class='macro_popup'>g_signal_connect_data ((dialog->comment_entry), ("activate"<br>), (((GCallback) (on_entry_activate))), (dialog), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> <span class='macro'>G_CALLBACK (on_entry_activate),<span class='macro_popup'>g_signal_connect_data ((dialog->comment_entry), ("activate"<br>), (((GCallback) (on_entry_activate))), (dialog), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> <span class='macro'>dialog)<span class='macro_popup'>g_signal_connect_data ((dialog->comment_entry), ("activate"<br>), (((GCallback) (on_entry_activate))), (dialog), ((void*)0),<br> (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> <span class='keyword'>if</span> (dialog->comment != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> gtk_entry_set_text (<span class='macro'>GTK_ENTRY (dialog->comment_entry)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog->comment_entry)), ((gtk_entry_get_type ())))))<br>)</span></span>, dialog->comment);</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> dialog->delay_spin = <span class='macro'>GTK_WIDGET(gtk_builder_get_object (xml, CAPPLET_DELAY_SPIN_WIDGET_NAME))<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object (xml, "session_properties_delay_spin"<br>))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> <span class='macro'>g_signal_connect (dialog->delay_spin,<span class='macro_popup'>g_signal_connect_data ((dialog->delay_spin), ("output"), (<br>((GCallback) (on_spin_output))), (dialog), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> <span class='string_literal'><span class='macro'>"output"</span>,<span class='macro_popup'>g_signal_connect_data ((dialog->delay_spin), ("output"), (<br>((GCallback) (on_spin_output))), (dialog), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='macro'>G_CALLBACK (on_spin_output),<span class='macro_popup'>g_signal_connect_data ((dialog->delay_spin), ("output"), (<br>((GCallback) (on_spin_output))), (dialog), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> <span class='macro'>dialog)<span class='macro_popup'>g_signal_connect_data ((dialog->delay_spin), ("output"), (<br>((GCallback) (on_spin_output))), (dialog), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> <span class='keyword'>if</span> (dialog->delay > 0) {</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> GtkAdjustment *adjustment;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> adjustment = gtk_spin_button_get_adjustment (<span class='macro'>GTK_SPIN_BUTTON(dialog->delay_spin)<span class='macro_popup'>((((GtkSpinButton*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog->delay_spin)), ((gtk_spin_button_get_type ()))<br>))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> gtk_adjustment_set_value (adjustment, (gdouble) dialog->delay);</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> <span class='keyword'>if</span> (xml != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> g_object_unref (xml);</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"><span class='keyword'>static</span> GObject *</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line">gsm_app_dialog_constructor (GType type,</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> guint n_construct_app,</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> GObjectConstructParam *construct_app)</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> GsmAppDialog *dialog;</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> dialog = GSM_APP_DIALOG (<span class='macro'>G_OBJECT_CLASS (gsm_app_dialog_parent_class)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((gsm_app_dialog_parent_class)), (((GType) ((20) << (<br>2))))))))</span></span>->constructor (type,</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> n_construct_app,</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> construct_app));</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> setup_dialog (dialog);</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>G_OBJECT (dialog)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), (((GType) ((20) << (2))))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line">gsm_app_dialog_dispose (GObject *object)</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> GsmAppDialog *dialog;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> <span class='macro'>g_return_if_fail (object != NULL)<span class='macro_popup'>do { if ((object != ((void*)0))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "object != NULL")<br>; return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_APP_DIALOG (object))<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (object))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (object)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> dialog = GSM_APP_DIALOG (object);</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> g_free (dialog->name);</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> dialog->name = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> g_free (dialog->command);</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> dialog->command = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> g_free (dialog->comment);</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> dialog->comment = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> <span class='macro'>G_OBJECT_CLASS (gsm_app_dialog_parent_class)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((gsm_app_dialog_parent_class)), (((GType) ((20) << (<br>2))))))))</span></span>->dispose (object);</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line">gsm_app_dialog_set_name (GsmAppDialog *dialog,</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *name)</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_APP_DIALOG (dialog))<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (dialog))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (dialog)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> g_free (dialog->name);</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> dialog->name = <span class='macro'>g_strdup (name)<span class='macro_popup'>g_strdup_inline (name)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> g_object_notify (<span class='macro'>G_OBJECT (dialog)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"name"</span>);</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line">gsm_app_dialog_set_command (GsmAppDialog *dialog,</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *name)</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_APP_DIALOG (dialog))<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (dialog))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (dialog)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> g_free (dialog->command);</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> dialog->command = <span class='macro'>g_strdup (name)<span class='macro_popup'>g_strdup_inline (name)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> g_object_notify (<span class='macro'>G_OBJECT (dialog)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"command"</span>);</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line">gsm_app_dialog_set_comment (GsmAppDialog *dialog,</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *name)</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_APP_DIALOG (dialog))<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (dialog))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (dialog)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> g_free (dialog->comment);</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> dialog->comment = <span class='macro'>g_strdup (name)<span class='macro_popup'>g_strdup_inline (name)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> g_object_notify (<span class='macro'>G_OBJECT (dialog)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"comment"</span>);</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line">gsm_app_dialog_set_delay (GsmAppDialog *dialog,</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> guint delay)</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_APP_DIALOG (dialog))<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (dialog))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (dialog)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> dialog->delay = delay;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> g_object_notify (<span class='macro'>G_OBJECT (dialog)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"delay"</span>);</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"><span class='keyword'>const</span> <span class='keyword'>char</span> *</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line">gsm_app_dialog_get_name (GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_APP_DIALOG (dialog), NULL)<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (dialog))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (dialog)"<br>); return (((void*)0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> <span class='keyword'>return</span> gtk_entry_get_text (<span class='macro'>GTK_ENTRY (dialog->name_entry)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog->name_entry)), ((gtk_entry_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"><span class='keyword'>const</span> <span class='keyword'>char</span> *</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line">gsm_app_dialog_get_command (GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_APP_DIALOG (dialog), NULL)<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (dialog))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (dialog)"<br>); return (((void*)0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>return</span> gtk_entry_get_text (<span class='macro'>GTK_ENTRY (dialog->command_entry)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog->command_entry)), ((gtk_entry_get_type ())))))<br>)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"><span class='keyword'>const</span> <span class='keyword'>char</span> *</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line">gsm_app_dialog_get_comment (GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_APP_DIALOG (dialog), NULL)<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (dialog))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (dialog)"<br>); return (((void*)0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> <span class='keyword'>return</span> gtk_entry_get_text (<span class='macro'>GTK_ENTRY (dialog->comment_entry)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog->comment_entry)), ((gtk_entry_get_type ())))))<br>)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line">guint</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line">gsm_app_dialog_get_delay (GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_APP_DIALOG (dialog), 0)<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (dialog))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (dialog)"<br>); return (0); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>return</span> dialog->delay;</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line">gsm_app_dialog_set_property (GObject *object,</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> <span class='keyword'>const</span> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> GsmAppDialog *dialog = GSM_APP_DIALOG (object);</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> <span class='keyword'>case</span> PROP_NAME:</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> gsm_app_dialog_set_name (dialog, g_value_get_string (value));</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>case</span> PROP_COMMAND:</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> gsm_app_dialog_set_command (dialog, g_value_get_string (value));</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> <span class='keyword'>case</span> PROP_COMMENT:</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> gsm_app_dialog_set_comment (dialog, g_value_get_string (value));</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> <span class='keyword'>case</span> PROP_DELAY:</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> gsm_app_dialog_set_delay (dialog, g_value_get_uint (value));</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "gsm-app-dialog.c", 416, ("property"), _glib__property_id, _glib__pspec<br>->name, g_type_name ((((((GTypeClass*) (((GTypeInstance*) (<br>_glib__pspec))->g_class))->g_type)))), (g_type_name (((<br>(((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line">gsm_app_dialog_get_property (GObject *object,</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> GsmAppDialog *dialog = GSM_APP_DIALOG (object);</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> <span class='keyword'>case</span> PROP_NAME:</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> g_value_set_string (value, dialog->name);</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> <span class='keyword'>case</span> PROP_COMMAND:</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> g_value_set_string (value, dialog->command);</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> <span class='keyword'>case</span> PROP_COMMENT:</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> g_value_set_string (value, dialog->comment);</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> <span class='keyword'>case</span> PROP_DELAY:</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> g_value_set_uint (value, dialog->delay);</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "gsm-app-dialog.c", 443, ("property"), _glib__property_id, _glib__pspec<br>->name, g_type_name ((((((GTypeClass*) (((GTypeInstance*) (<br>_glib__pspec))->g_class))->g_type)))), (g_type_name (((<br>(((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line">gsm_app_dialog_class_init (GsmAppDialogClass *klass)</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> GObjectClass *object_class = <span class='macro'>G_OBJECT_CLASS (klass)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((klass)), (((GType) ((20) << (2))))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> object_class->get_property = gsm_app_dialog_get_property;</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> object_class->set_property = gsm_app_dialog_set_property;</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> object_class->constructor = gsm_app_dialog_constructor;</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> object_class->dispose = gsm_app_dialog_dispose;</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> g_object_class_install_property (object_class,</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> PROP_NAME,</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> g_param_spec_string (<span class='string_literal'>"name"</span>,</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> <span class='string_literal'>"name"</span>,</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> <span class='string_literal'>"name"</span>,</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> G_PARAM_READWRITE | G_PARAM_CONSTRUCT));</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> g_object_class_install_property (object_class,</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> PROP_COMMAND,</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> g_param_spec_string (<span class='string_literal'>"command"</span>,</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='string_literal'>"command"</span>,</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='string_literal'>"command"</span>,</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> G_PARAM_READWRITE | G_PARAM_CONSTRUCT));</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> g_object_class_install_property (object_class,</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> PROP_COMMENT,</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> g_param_spec_string (<span class='string_literal'>"comment"</span>,</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> <span class='string_literal'>"comment"</span>,</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> <span class='string_literal'>"comment"</span>,</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> G_PARAM_READWRITE | G_PARAM_CONSTRUCT));</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> g_object_class_install_property (object_class,</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> PROP_DELAY,</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> g_param_spec_uint (<span class='string_literal'>"delay"</span>,</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='string_literal'>"delay"</span>,</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> <span class='string_literal'>"delay"</span>,</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> 0,</td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> 100,</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> 0,</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> G_PARAM_READWRITE | G_PARAM_CONSTRUCT));</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line">gsm_app_dialog_init (GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line">GtkWidget *</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line">gsm_app_dialog_new (<span class='keyword'>const</span> <span class='keyword'>char</span> *name,</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *command,</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *comment,</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> guint delay)</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> GObject *object;</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> object = g_object_new (<span class='macro'>GSM_TYPE_APP_DIALOG<span class='macro_popup'>(gsm_app_dialog_get_type ())</span></span>,</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='string_literal'>"name"</span>, name,</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> <span class='string_literal'>"command"</span>, command,</td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> <span class='string_literal'>"comment"</span>, comment,</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> <span class='string_literal'>"delay"</span>, delay,</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>GTK_WIDGET (object)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((object)), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line">gsm_app_dialog_run (GsmAppDialog *dialog,</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> <span class='keyword'>char</span> **name_p,</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> <span class='keyword'>char</span> **command_p,</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> <span class='keyword'>char</span> **comment_p,</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> guint *delay_p)</td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> <span id="start18">gboolean</span> retval;</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> retval = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> <span id="start17"><span id="end18"><span class='keyword'>while</span></span></span> (<span id="start16"><span class="mrange"><span id="end17">gtk_dialog_run</span></span> (<span class='macro'>GTK_DIALOG (dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>) == GTK_RESPONSE_OK</span>) {</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path1" class="msg msgEvent" style="margin-left:16ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">1</div></td><td>Assuming the condition is true</td><td><div class="PathNav"><a href="#Path2" title="Next event (2)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path2" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">2</div></td><td><div class="PathNav"><a href="#Path1" title="Previous event (1)">←</a></div></td><td>Loop condition is true. Entering loop body</td><td><div class="PathNav"><a href="#Path3" title="Next event (3)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> <span id="start15"><span id="end16"><span class='keyword'>const</span></span></span> <span class='keyword'>char</span> *name;</td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *exec;</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *comment;</td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> guint delay;</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *error_msg;</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> <span id="start14"><span class="mrange"><span id="end15"><span class='keyword'>char</span></span></span> **argv</span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path3" class="msg msgEvent" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">3</div></td><td><div class="PathNav"><a href="#Path2" title="Previous event (2)">←</a></div></td><td>'argv' declared without an initial value</td><td><div class="PathNav"><a href="#Path4" title="Next event (4)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> <span class='keyword'>int</span> argc;</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> name = gsm_app_dialog_get_name (GSM_APP_DIALOG (dialog));</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> exec = gsm_app_dialog_get_command (GSM_APP_DIALOG (dialog));</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> comment = gsm_app_dialog_get_comment (GSM_APP_DIALOG (dialog));</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> delay = gsm_app_dialog_get_delay (GSM_APP_DIALOG (dialog));</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> error_msg = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> <span id="start13"><span id="end14"><span class='keyword'>if</span></span></span> (<span id="start12"><span class="mrange"><span id="end13">gsm_util_text_is_blank</span></span> (exec)</span>) {</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path4" class="msg msgEvent" style="margin-left:21ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">4</div></td><td><div class="PathNav"><a href="#Path3" title="Previous event (3)">←</a></div></td><td>Assuming the condition is true</td><td><div class="PathNav"><a href="#Path5" title="Next event (5)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path5" class="msg msgControl" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">5</div></td><td><div class="PathNav"><a href="#Path4" title="Previous event (4)">←</a></div></td><td>Taking true branch</td><td><div class="PathNav"><a href="#Path6" title="Next event (6)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> <span id="start9"><span id="end10"><span id="start11"><span id="end12">error_msg</span></span></span></span> = <span id="start10"><span id="end11"><span class='macro'>_</span></span>(<span class='string_literal'>"The startup command cannot be empty"</span>)<span class='macro_popup'>gettext ("The startup command cannot be empty")</span></span>;</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> <span class='keyword'>if</span> (!g_shell_parse_argv (exec, &argc, &argv, &error)) {</td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> error_msg = error->message;</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> error_msg = <span class='macro'>_(<span class='string_literal'>"The startup command is not valid"</span>)<span class='macro_popup'>gettext ("The startup command is not valid")</span></span>;</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> <span id="start8"><span id="end9"><span class='keyword'>if</span></span></span> (<span id="start7"><span class="mrange"><span id="end8">error_msg</span></span> != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span></span>) {</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path6" class="msg msgEvent" style="margin-left:21ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">6</div></td><td><div class="PathNav"><a href="#Path5" title="Previous event (5)">←</a></div></td><td>Assuming 'error_msg' is equal to NULL</td><td><div class="PathNav"><a href="#Path7" title="Next event (7)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path7" class="msg msgControl" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">7</div></td><td><div class="PathNav"><a href="#Path6" title="Previous event (6)">←</a></div></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path8" title="Next event (8)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> GtkWidget *msgbox;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> msgbox = gtk_message_dialog_new (<span class='macro'>GTK_WINDOW (dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> GTK_DIALOG_MODAL,</td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> GTK_MESSAGE_ERROR,</td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> GTK_BUTTONS_CLOSE,</td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='string_literal'>"%s"</span>, error_msg);</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> gtk_dialog_run (<span class='macro'>GTK_DIALOG (msgbox)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((msgbox)), ((gtk_dialog_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> gtk_widget_destroy (msgbox);</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> <span id="start6"><span id="end7"><span class='keyword'>if</span></span></span> (<span id="start4"><span class="mrange"><span id="end5">gsm_util_text_is_blank</span></span> (<span id="start5"><span id="end6">name</span></span>)</span>) {</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path8" class="msg msgEvent" style="margin-left:21ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">8</div></td><td><div class="PathNav"><a href="#Path7" title="Previous event (7)">←</a></div></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path9" title="Next event (9)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path9" class="msg msgControl" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">9</div></td><td><div class="PathNav"><a href="#Path8" title="Previous event (8)">←</a></div></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path10" title="Next event (10)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> name = argv[0];</td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span id="start3"><span id="end4"><span class='keyword'>if</span></span></span> (<span id="start2"><span class="mrange"><span id="end3">name_p</span></span></span>) {</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path10" class="msg msgEvent" style="margin-left:21ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">10</div></td><td><div class="PathNav"><a href="#Path9" title="Previous event (9)">←</a></div></td><td>Assuming 'name_p' is null</td><td><div class="PathNav"><a href="#Path11" title="Next event (11)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path11" class="msg msgControl" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">11</div></td><td><div class="PathNav"><a href="#Path10" title="Previous event (10)">←</a></div></td><td>Taking false branch</td><td><div class="PathNav"><a href="#EndPath" title="Next event (12)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> *name_p = <span class='macro'>g_strdup (name)<span class='macro_popup'>g_strdup_inline (name)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> <span id="end0"><span id="start1"><span id="end2">g_strfreev</span></span></span> (<span class="mrange"><span id="start0"><span id="end1">argv</span></span></span>);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">12</div></td><td><div class="PathNav"><a href="#Path11" title="Previous event (11)">←</a></div></td><td>1st function call argument is an uninitialized value</td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> <span class='keyword'>if</span> (command_p) {</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> *command_p = <span class='macro'>g_strdup (exec)<span class='macro_popup'>g_strdup_inline (exec)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> <span class='keyword'>if</span> (comment_p) {</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> *comment_p = <span class='macro'>g_strdup (comment)<span class='macro_popup'>g_strdup_inline (comment)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> <span class='keyword'>if</span> (delay_p) {</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> *delay_p = delay;</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> retval = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> gtk_widget_destroy (<span class='macro'>GTK_WIDGET (dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_widget_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> <span class='keyword'>return</span> retval;</td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-37d955.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-37d955.html new file mode 100644 index 0000000..a5a0150 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-37d955.html @@ -0,0 +1,1217 @@ +<!doctype html> +<html> +<head> +<title>gsm-logout-dialog.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Value stored to 'ret' is never read --> + +<!-- BUGTYPE Dead assignment --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/mate-session/gsm-logout-dialog.c --> + +<!-- FILENAME gsm-logout-dialog.c --> + +<!-- FUNCTIONNAME gsm_logout_supports_system_suspend --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 37d9556390f91eb5c397d49b548e7b36 --> + +<!-- BUGLINE 197 --> + +<!-- BUGCOLUMN 9 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>mate-session/gsm-logout-dialog.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 197, column 9</a><br />Value stored to 'ret' is never read</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name gsm-logout-dialog.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/mate-session -fcoverage-compilation-dir=/rootdir/mate-session -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -I /usr/include/uuid -I ../mate-submodules/libegg -D LOCALE_DIR="/usr/local/share/locale" -D DATA_DIR="/usr/local/share/mate-session" -D LIBEXECDIR="/usr/local/libexec" -D GTKBUILDER_DIR="/usr/local/share/mate-session-manager" -D I_KNOW_THE_DEVICEKIT_POWER_API_IS_SUBJECT_TO_CHANGE -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c gsm-logout-dialog.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"197": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2006 Vincent Untz</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Copyright (C) 2008 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* This program is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU General Public License as</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* published by the Free Software Foundation; either version 2 of the</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>* License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful, but</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>* General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>* 02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> <span class='comment'>* Authors:</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> <span class='comment'>* Vincent Untz <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <config.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include "gsm-logout-dialog.h"</span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"><span class='directive'>#include "gsm-systemd.h"</span></td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#include "gsm-consolekit.h"</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#include "mdm.h"</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"><span class='directive'>#include "gsm-util.h"</span></td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_ICON_LOGOUT<span class='macro_popup'>"system-log-out"</span></span> "system-log-out"</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_ICON_SHUTDOWN<span class='macro_popup'>"system-shutdown"</span></span> "system-shutdown"</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='directive'>#define <span class='macro'>SESSION_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span> "org.mate.session"</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_LOGOUT_TIMEOUT<span class='macro_popup'>"logout-timeout"</span></span> "logout-timeout"</span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"><span class='directive'>#define <span class='macro'>LOCKDOWN_SCHEMA<span class='macro_popup'>"org.mate.lockdown"</span></span> "org.mate.lockdown"</span></td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_USER_SWITCHING_DISABLE<span class='macro_popup'>"disable-user-switching"</span></span> "disable-user-switching"</span></td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> GSM_DIALOG_LOGOUT_TYPE_LOGOUT,</td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> GSM_DIALOG_LOGOUT_TYPE_SHUTDOWN</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line">} GsmDialogLogoutType;</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='keyword'>struct</span> _GsmLogoutDialog</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> GtkMessageDialog parent;</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> GsmDialogLogoutType type;</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> GtkWidget *progressbar;</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> <span class='keyword'>int</span> timeout;</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>int</span> timeout_id;</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>int</span> default_response;</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> GsmLogoutDialog *current_dialog = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> gsm_logout_dialog_set_timeout (GsmLogoutDialog *logout_dialog);</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> gsm_logout_dialog_destroy (GsmLogoutDialog *logout_dialog,</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> gpointer data);</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> gsm_logout_dialog_show (GsmLogoutDialog *logout_dialog,</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> gpointer data);</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> PROP_0,</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> PROP_MESSAGE_TYPE</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"><span class='macro'>G_DEFINE_TYPE (GsmLogoutDialog, gsm_logout_dialog, GTK_TYPE_MESSAGE_DIALOG)<span class='macro_popup'>static void gsm_logout_dialog_init (GsmLogoutDialog *self); static<br> void gsm_logout_dialog_class_init (GsmLogoutDialogClass *klass<br>); static GType gsm_logout_dialog_get_type_once (void); static<br> gpointer gsm_logout_dialog_parent_class = ((void*)0); static<br> gint GsmLogoutDialog_private_offset; static void gsm_logout_dialog_class_intern_init<br> (gpointer klass) { gsm_logout_dialog_parent_class = g_type_class_peek_parent<br> (klass); if (GsmLogoutDialog_private_offset != 0) g_type_class_adjust_private_offset<br> (klass, &GsmLogoutDialog_private_offset); gsm_logout_dialog_class_init<br> ((GsmLogoutDialogClass*) klass); } __attribute__ ((__unused__<br>)) static inline gpointer gsm_logout_dialog_get_instance_private<br> (GsmLogoutDialog *self) { return (((gpointer) ((guint8*) (self<br>) + (glong) (GsmLogoutDialog_private_offset)))); } GType gsm_logout_dialog_get_type<br> (void) { static GType static_g_define_type_id = 0; if ((__extension__<br> ({ _Static_assert (sizeof *(&static_g_define_type_id) ==<br> sizeof (gpointer), "Expression evaluates to false"); (void) (<br>0 ? (gpointer) * (&static_g_define_type_id) : ((void*)0))<br>; (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); __typeof__<br> (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__<br> ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id<br>); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)<br>; gapg_temp_newval; })) && g_once_init_enter_pointer (<br>&static_g_define_type_id)); })) ) { GType g_define_type_id<br> = gsm_logout_dialog_get_type_once (); (__extension__ ({ _Static_assert<br> (sizeof *(&static_g_define_type_id) == sizeof (gpointer)<br>, "Expression evaluates to false"); 0 ? (void) (*(&static_g_define_type_id<br>) = (g_define_type_id)) : (void) 0; g_once_init_leave_pointer<br> ((&static_g_define_type_id), (gpointer) (guintptr) (g_define_type_id<br>)); })) ; } return static_g_define_type_id; } __attribute__ (<br>(__noinline__)) static GType gsm_logout_dialog_get_type_once (<br>void) { GType g_define_type_id = g_type_register_static_simple<br> ((gtk_message_dialog_get_type ()), g_intern_static_string ("GsmLogoutDialog"<br>), sizeof (GsmLogoutDialogClass), (GClassInitFunc)(void (*)(void<br>)) gsm_logout_dialog_class_intern_init, sizeof (GsmLogoutDialog<br>), (GInstanceInitFunc)(void (*)(void)) gsm_logout_dialog_init<br>, (GTypeFlags) 0); { {{};} } return g_define_type_id; }</span></span>;</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line">gsm_logout_dialog_set_property (GObject *object,</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> <span class='keyword'>const</span> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> <span class='keyword'>case</span> PROP_MESSAGE_TYPE:</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "gsm-logout-dialog.c", 97, ("property"), _glib__property_id<br>, _glib__pspec->name, g_type_name ((((((GTypeClass*) (((GTypeInstance<br>*) (_glib__pspec))->g_class))->g_type)))), (g_type_name<br> ((((((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line">gsm_logout_dialog_get_property (GObject *object,</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='keyword'>case</span> PROP_MESSAGE_TYPE:</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> g_value_set_enum (value, GTK_MESSAGE_WARNING);</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "gsm-logout-dialog.c", 113, ("property"), _glib__property_id<br>, _glib__pspec->name, g_type_name ((((((GTypeClass*) (((GTypeInstance<br>*) (_glib__pspec))->g_class))->g_type)))), (g_type_name<br> ((((((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line">gsm_logout_dialog_class_init (GsmLogoutDialogClass *klass)</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> GObjectClass *gobject_class;</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> gobject_class = <span class='macro'>G_OBJECT_CLASS (klass)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((klass)), (((GType) ((20) << (2))))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> <span class='comment'>/* This is a workaround to avoid a stupid crash: libmateui</span></td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> <span class='comment'>* listens for the "show" signal on all GtkMessageDialog and</span></td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> <span class='comment'>* gets the "message-type" of the dialogs. We will crash when</span></td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> <span class='comment'>* it accesses this property if we don't override it since we</span></td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> <span class='comment'>* didn't define it. */</span></td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> gobject_class->set_property = gsm_logout_dialog_set_property;</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> gobject_class->get_property = gsm_logout_dialog_get_property;</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> g_object_class_override_property (gobject_class,</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> PROP_MESSAGE_TYPE,</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> <span class='string_literal'>"message-type"</span>);</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line">gsm_logout_dialog_init (GsmLogoutDialog *logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> logout_dialog->timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> logout_dialog->timeout = 0;</td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> logout_dialog->default_response = GTK_RESPONSE_CANCEL;</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> GtkStyleContext *context;</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> context = gtk_widget_get_style_context (<span class='macro'>GTK_WIDGET (logout_dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_widget_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> gtk_style_context_add_class (context, <span class='string_literal'>"logout-dialog"</span>);</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> gtk_window_set_skip_taskbar_hint (<span class='macro'>GTK_WINDOW (logout_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_window_get_type ()))))))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> gtk_window_set_keep_above (<span class='macro'>GTK_WINDOW (logout_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_window_get_type ()))))))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> gtk_window_stick (<span class='macro'>GTK_WINDOW (logout_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_window_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> logout_dialog->systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> logout_dialog->consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> <span class='macro'>g_signal_connect (logout_dialog,<span class='macro_popup'>g_signal_connect_data ((logout_dialog), ("destroy"), (((GCallback<br>) (gsm_logout_dialog_destroy))), (((void*)0)), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> <span class='string_literal'><span class='macro'>"destroy"</span>,<span class='macro_popup'>g_signal_connect_data ((logout_dialog), ("destroy"), (((GCallback<br>) (gsm_logout_dialog_destroy))), (((void*)0)), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> <span class='macro'>G_CALLBACK (gsm_logout_dialog_destroy),<span class='macro_popup'>g_signal_connect_data ((logout_dialog), ("destroy"), (((GCallback<br>) (gsm_logout_dialog_destroy))), (((void*)0)), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> <span class='macro'>NULL)<span class='macro_popup'>g_signal_connect_data ((logout_dialog), ("destroy"), (((GCallback<br>) (gsm_logout_dialog_destroy))), (((void*)0)), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> <span class='macro'>g_signal_connect (logout_dialog,<span class='macro_popup'>g_signal_connect_data ((logout_dialog), ("show"), (((GCallback<br>) (gsm_logout_dialog_show))), (((void*)0)), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> <span class='string_literal'><span class='macro'>"show"</span>,<span class='macro_popup'>g_signal_connect_data ((logout_dialog), ("show"), (((GCallback<br>) (gsm_logout_dialog_show))), (((void*)0)), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> <span class='macro'>G_CALLBACK (gsm_logout_dialog_show),<span class='macro_popup'>g_signal_connect_data ((logout_dialog), ("show"), (((GCallback<br>) (gsm_logout_dialog_show))), (((void*)0)), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> <span class='macro'>NULL)<span class='macro_popup'>g_signal_connect_data ((logout_dialog), ("show"), (((GCallback<br>) (gsm_logout_dialog_show))), (((void*)0)), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line">gsm_logout_dialog_destroy (GsmLogoutDialog *logout_dialog,</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> gpointer data)</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> <span class='keyword'>if</span> (logout_dialog->timeout_id != 0) {</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> g_source_remove (logout_dialog->timeout_id);</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> logout_dialog->timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='keyword'>if</span> (logout_dialog->systemd) {</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> g_object_unref (logout_dialog->systemd);</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> logout_dialog->systemd = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='keyword'>if</span> (logout_dialog->consolekit) {</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> g_object_unref (logout_dialog->consolekit);</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> logout_dialog->consolekit = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> current_dialog = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line">gsm_logout_supports_system_suspend (GsmLogoutDialog *logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> ret = <span class="mrange"><span class='macro'>FALSE<span class='macro_popup'>(0)</span></span></span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:9ex">Value stored to 'ret' is never read</div></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> ret = gsm_systemd_can_suspend (logout_dialog->systemd);</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> ret = gsm_consolekit_can_suspend (logout_dialog->consolekit);</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line">gsm_logout_supports_system_hibernate (GsmLogoutDialog *logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> ret = gsm_systemd_can_hibernate (logout_dialog->systemd);</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> ret = gsm_consolekit_can_hibernate (logout_dialog->consolekit);</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line">gsm_logout_supports_switch_user (GsmLogoutDialog *logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> GSettings *settings;</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> gboolean ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> gboolean locked;</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> settings = g_settings_new (<span class='macro'>LOCKDOWN_SCHEMA<span class='macro_popup'>"org.mate.lockdown"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> locked = g_settings_get_boolean (settings, <span class='macro'>KEY_USER_SWITCHING_DISABLE<span class='macro_popup'>"disable-user-switching"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> g_object_unref (settings);</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> <span class='keyword'>if</span> (!locked) {</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> ret = gsm_systemd_can_switch_user (logout_dialog->systemd);</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> ret = gsm_consolekit_can_switch_user (logout_dialog->consolekit);</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line">gsm_logout_supports_reboot (GsmLogoutDialog *logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> ret = gsm_systemd_can_restart (logout_dialog->systemd);</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> ret = gsm_consolekit_can_restart (logout_dialog->consolekit);</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> <span class='keyword'>if</span> (!ret) {</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> ret = mdm_supports_logout_action (MDM_LOGOUT_ACTION_REBOOT);</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line">gsm_logout_supports_shutdown (GsmLogoutDialog *logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> ret = gsm_systemd_can_stop (logout_dialog->systemd);</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> ret = gsm_consolekit_can_stop (logout_dialog->consolekit);</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> <span class='keyword'>if</span> (!ret) {</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> ret = mdm_supports_logout_action (MDM_LOGOUT_ACTION_SHUTDOWN);</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line">gsm_logout_dialog_show (GsmLogoutDialog *logout_dialog, gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> gsm_logout_dialog_set_timeout (logout_dialog);</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line">gsm_logout_dialog_timeout (gpointer data)</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> GsmLogoutDialog *logout_dialog;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> <span class='keyword'>char</span> *seconds_warning;</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> <span class='keyword'>char</span> *secondary_text;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>char</span> *session_type = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>static</span> gboolean is_not_login;</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> logout_dialog = (GsmLogoutDialog *) data;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> <span class='keyword'>if</span> (!logout_dialog->timeout) {</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> gtk_dialog_response (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> logout_dialog->default_response);</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='keyword'>switch</span> (logout_dialog->type) {</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> <span class='keyword'>case</span> GSM_DIALOG_LOGOUT_TYPE_LOGOUT:</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> seconds_warning = ngettext (<span class='string_literal'>"You will be automatically logged "</span></td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> <span class='string_literal'>"out in %d second"</span>,</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> <span class='string_literal'>"You will be automatically logged "</span></td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> <span class='string_literal'>"out in %d seconds"</span>,</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> logout_dialog->timeout);</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> <span class='keyword'>case</span> GSM_DIALOG_LOGOUT_TYPE_SHUTDOWN:</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> seconds_warning = ngettext (<span class='string_literal'>"This system will be automatically "</span></td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> <span class='string_literal'>"shut down in %d second"</span>,</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> <span class='string_literal'>"This system will be automatically "</span></td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> <span class='string_literal'>"shut down in %d seconds"</span>,</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> logout_dialog->timeout);</td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-logout-dialog.c"<br>, 324, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> seconds_warning = g_strdup_printf (seconds_warning, logout_dialog->timeout);</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (session_type == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> session_type = gsm_systemd_get_current_session_type (systemd);</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> g_object_unref (systemd);</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> is_not_login = (g_strcmp0 (session_type, <span class='macro'>GSM_SYSTEMD_SESSION_TYPE_LOGIN_WINDOW<span class='macro_popup'>"greeter"</span></span>) != 0);</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> session_type = gsm_consolekit_get_current_session_type (consolekit);</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> g_object_unref (consolekit);</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> is_not_login = (g_strcmp0 (session_type, <span class='macro'>GSM_CONSOLEKIT_SESSION_TYPE_LOGIN_WINDOW<span class='macro_popup'>"LoginWindow"</span></span>) != 0);</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> <span class='keyword'>if</span> (is_not_login) {</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> <span class='keyword'>char</span> *name;</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> name = g_locale_to_utf8 (g_get_real_name (), -1, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='keyword'>if</span> (!name || name[0] == '\0' || strcmp (name, <span class='string_literal'>"Unknown"</span>) == 0) {</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> name = g_locale_to_utf8 (g_get_user_name (), -1 , <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='keyword'>if</span> (!name) {</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> name = <span class='macro'>g_strdup (g_get_user_name ())<span class='macro_popup'>g_strdup_inline (g_get_user_name ())</span></span>;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> secondary_text = g_strdup_printf (<span class='macro'>_(<span class='string_literal'>"You are currently logged in as \"%s\"."</span>)<span class='macro_popup'>gettext ("You are currently logged in as \"%s\".")</span></span>, name);</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> g_free (name);</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> secondary_text = <span class='macro'>g_strdup (seconds_warning)<span class='macro_popup'>g_strdup_inline (seconds_warning)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> gtk_progress_bar_set_fraction (<span class='macro'>GTK_PROGRESS_BAR (logout_dialog->progressbar)<span class='macro_popup'>((((GtkProgressBar*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog->progressbar)), ((gtk_progress_bar_get_type<br> ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> logout_dialog->timeout / 60.0);</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> gtk_progress_bar_set_text (<span class='macro'>GTK_PROGRESS_BAR (logout_dialog->progressbar)<span class='macro_popup'>((((GtkProgressBar*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog->progressbar)), ((gtk_progress_bar_get_type<br> ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> seconds_warning);</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> gtk_message_dialog_format_secondary_text (<span class='macro'>GTK_MESSAGE_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkMessageDialog*) (void *) g_type_check_instance_cast ((<br>GTypeInstance*) ((logout_dialog)), ((gtk_message_dialog_get_type<br> ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> secondary_text,</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> logout_dialog->timeout--;</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> g_free (secondary_text);</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> g_free (seconds_warning);</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line">gsm_logout_dialog_set_timeout (GsmLogoutDialog *logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> GSettings *settings;</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> settings = g_settings_new (<span class='macro'>SESSION_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> logout_dialog->timeout = g_settings_get_int (settings, <span class='macro'>KEY_LOGOUT_TIMEOUT<span class='macro_popup'>"logout-timeout"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> <span class='keyword'>if</span> (logout_dialog->timeout > 0) {</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> <span class='comment'>/* Sets the secondary text */</span></td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> gsm_logout_dialog_timeout (logout_dialog);</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> <span class='keyword'>if</span> (logout_dialog->timeout_id != 0) {</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> g_source_remove (logout_dialog->timeout_id);</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> logout_dialog->timeout_id = g_timeout_add (1000,</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> gsm_logout_dialog_timeout,</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> logout_dialog);</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> gtk_widget_hide (logout_dialog->progressbar);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> g_object_unref (settings);</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"><span class='keyword'>static</span> GtkWidget *</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line">gsm_get_dialog (GsmDialogLogoutType type,</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> GdkScreen *screen,</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> guint32 activate_time)</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> GsmLogoutDialog *logout_dialog;</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> GtkWidget *hbox;</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *primary_text;</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *icon_name;</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> <span class='keyword'>if</span> (current_dialog != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> gtk_widget_destroy (<span class='macro'>GTK_WIDGET (current_dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((current_dialog)), ((gtk_widget_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> logout_dialog = g_object_new (<span class='macro'>GSM_TYPE_LOGOUT_DIALOG<span class='macro_popup'>(gsm_logout_dialog_get_type ())</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> current_dialog = logout_dialog;</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> gtk_window_set_title (<span class='macro'>GTK_WINDOW (logout_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_window_get_type ()))))))</span></span>, <span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> logout_dialog->type = type;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> icon_name = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> primary_text = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> <span class='keyword'>switch</span> (type) {</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> <span class='keyword'>case</span> GSM_DIALOG_LOGOUT_TYPE_LOGOUT:</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> icon_name = <span class='macro'>GSM_ICON_LOGOUT<span class='macro_popup'>"system-log-out"</span></span>;</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> primary_text = <span class='macro'>_(<span class='string_literal'>"Log out of this system now?"</span>)<span class='macro_popup'>gettext ("Log out of this system now?")</span></span>;</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> logout_dialog->default_response = GSM_LOGOUT_RESPONSE_LOGOUT;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> <span class='keyword'>if</span> (gsm_logout_supports_switch_user (logout_dialog)) {</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Switch User"</span>)<span class='macro_popup'>gettext ("_Switch User")</span></span>, <span class='string_literal'>"system-users"</span>,</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> GSM_LOGOUT_RESPONSE_SWITCH_USER);</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Cancel"</span>)<span class='macro_popup'>gettext ("_Cancel")</span></span>, <span class='string_literal'>"process-stop"</span>,</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> GTK_RESPONSE_CANCEL);</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Log Out"</span>)<span class='macro_popup'>gettext ("_Log Out")</span></span>, <span class='string_literal'>"system-log-out"</span>,</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> GSM_LOGOUT_RESPONSE_LOGOUT);</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> <span class='keyword'>case</span> GSM_DIALOG_LOGOUT_TYPE_SHUTDOWN:</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> icon_name = <span class='macro'>GSM_ICON_SHUTDOWN<span class='macro_popup'>"system-shutdown"</span></span>;</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> primary_text = <span class='macro'>_(<span class='string_literal'>"Shut down this system now?"</span>)<span class='macro_popup'>gettext ("Shut down this system now?")</span></span>;</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> logout_dialog->default_response = GSM_LOGOUT_RESPONSE_SHUTDOWN;</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> <span class='keyword'>if</span> (gsm_logout_supports_system_suspend (logout_dialog)) {</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"S_uspend"</span>)<span class='macro_popup'>gettext ("S_uspend")</span></span>, <span class='string_literal'>"battery"</span>,</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> GSM_LOGOUT_RESPONSE_SLEEP);</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> <span class='keyword'>if</span> (gsm_logout_supports_system_hibernate (logout_dialog)) {</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Hibernate"</span>)<span class='macro_popup'>gettext ("_Hibernate")</span></span>, <span class='string_literal'>"drive-harddisk"</span>,</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> GSM_LOGOUT_RESPONSE_HIBERNATE);</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> <span class='keyword'>if</span> (gsm_logout_supports_reboot (logout_dialog)) {</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Restart"</span>)<span class='macro_popup'>gettext ("_Restart")</span></span>, <span class='string_literal'>"view-refresh"</span>,</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> GSM_LOGOUT_RESPONSE_REBOOT);</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Cancel"</span>)<span class='macro_popup'>gettext ("_Cancel")</span></span>, <span class='string_literal'>"process-stop"</span>,</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> GTK_RESPONSE_CANCEL);</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> <span class='keyword'>if</span> (gsm_logout_supports_shutdown (logout_dialog)) {</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Shut Down"</span>)<span class='macro_popup'>gettext ("_Shut Down")</span></span>, <span class='string_literal'>"system-shutdown"</span>,</td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> GSM_LOGOUT_RESPONSE_SHUTDOWN);</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-logout-dialog.c"<br>, 496, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> logout_dialog->progressbar = gtk_progress_bar_new ();</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> gtk_progress_bar_set_show_text (<span class='macro'>GTK_PROGRESS_BAR (logout_dialog->progressbar)<span class='macro_popup'>((((GtkProgressBar*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog->progressbar)), ((gtk_progress_bar_get_type<br> ()))))))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> gtk_progress_bar_set_fraction (<span class='macro'>GTK_PROGRESS_BAR (logout_dialog->progressbar)<span class='macro_popup'>((((GtkProgressBar*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog->progressbar)), ((gtk_progress_bar_get_type<br> ()))))))</span></span>, 1.0);</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> gtk_box_pack_start (<span class='macro'>GTK_BOX (hbox)<span class='macro_popup'>((((GtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((hbox)), ((gtk_box_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> logout_dialog->progressbar,</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, 12);</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> gtk_widget_show_all (hbox);</td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> gtk_container_add (<span class='macro'>GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (logout_dialog)))<span class='macro_popup'>((((GtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_dialog_get_content_area (((((GtkDialog*) (void *) g_type_check_instance_cast<br> ((GTypeInstance*) ((logout_dialog)), ((gtk_dialog_get_type (<br>)))))))))), ((gtk_container_get_type ()))))))</span></span>, hbox);</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> gtk_window_set_icon_name (<span class='macro'>GTK_WINDOW (logout_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_window_get_type ()))))))</span></span>, icon_name);</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> gtk_window_set_position (<span class='macro'>GTK_WINDOW (logout_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_window_get_type ()))))))</span></span>, GTK_WIN_POS_CENTER_ALWAYS);</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> gtk_message_dialog_set_markup (<span class='macro'>GTK_MESSAGE_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkMessageDialog*) (void *) g_type_check_instance_cast ((<br>GTypeInstance*) ((logout_dialog)), ((gtk_message_dialog_get_type<br> ()))))))</span></span>, primary_text);</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> gtk_dialog_set_default_response (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> logout_dialog->default_response);</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> gtk_window_set_screen (<span class='macro'>GTK_WINDOW (logout_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_window_get_type ()))))))</span></span>, screen);</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>GTK_WIDGET (logout_dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line">GtkWidget *</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line">gsm_get_shutdown_dialog (GdkScreen *screen,</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> guint32 activate_time)</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> <span class='keyword'>return</span> gsm_get_dialog (GSM_DIALOG_LOGOUT_TYPE_SHUTDOWN,</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> screen,</td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> activate_time);</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line">GtkWidget *</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line">gsm_get_logout_dialog (GdkScreen *screen,</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> guint32 activate_time)</td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> <span class='keyword'>return</span> gsm_get_dialog (GSM_DIALOG_LOGOUT_TYPE_LOGOUT,</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> screen,</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> activate_time);</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-4cf1eb.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-4cf1eb.html new file mode 100644 index 0000000..123c997 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-4cf1eb.html @@ -0,0 +1,967 @@ +<!doctype html> +<html> +<head> +<title>mate-session-save.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC This statement is never executed --> + +<!-- BUGTYPE Unreachable code --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/tools/mate-session-save.c --> + +<!-- FILENAME mate-session-save.c --> + +<!-- FUNCTIONNAME main --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 4cf1eb0ef15c277f4ecfef4ee923dc7b --> + +<!-- BUGLINE 259 --> + +<!-- BUGCOLUMN 7 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>tools/mate-session-save.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 259, column 7</a><br />This statement is never executed</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mate-session-save.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/tools -fcoverage-compilation-dir=/rootdir/tools -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -D LOCALE_DIR="/usr/local/share/locale" -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c mate-session-save.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"259": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* save-session.c - Small program to talk to session manager.</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>Copyright (C) 1998 Tom Tromey</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>Copyright (C) 2008 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>This program is free software; you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>it under the terms of the GNU General Public License as published by</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>the Free Software Foundation; either version 2, or (at your option)</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>any later version.</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"><span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <config.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_SERVICE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_PATH_DBUS<span class='macro_popup'>"/org/gnome/SessionManager"</span></span> "/org/gnome/SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_INTERFACE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_SERVICE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span> "org.mate.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_PATH_DBUS_OLD<span class='macro_popup'>"/org/mate/SessionManager"</span></span> "/org/mate/SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_INTERFACE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span> "org.mate.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> GSM_LOGOUT_MODE_NORMAL = 0,</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> GSM_LOGOUT_MODE_NO_CONFIRMATION,</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> GSM_LOGOUT_MODE_FORCE</td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='comment'>/* True if killing. This is deprecated, but we keep it for compatibility</span></td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> <span class='comment'>* reasons. */</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> gboolean kill_session = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"><span class='comment'>/* The real options that should be used now. They are not ambiguous. */</span></td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='keyword'>static</span> gboolean logout = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"><span class='keyword'>static</span> gboolean force_logout = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"><span class='keyword'>static</span> gboolean logout_dialog = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"><span class='keyword'>static</span> gboolean shutdown_dialog = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"><span class='comment'>/* True if we should use dialog boxes */</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"><span class='keyword'>static</span> gboolean show_error_dialogs = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"><span class='comment'>/* True if we should do the requested action without confirmation */</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"><span class='keyword'>static</span> gboolean no_interaction = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>char</span>* session_name = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"><span class='keyword'>static</span> GOptionEntry options[] = {</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> {<span class='string_literal'>"logout"</span>, '\0', 0, G_OPTION_ARG_NONE, &logout, <span class='macro'>N_(<span class='string_literal'>"Log out"</span>)<span class='macro_popup'>("Log out")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> {<span class='string_literal'>"force-logout"</span>, '\0', 0, G_OPTION_ARG_NONE, &force_logout, <span class='macro'>N_(<span class='string_literal'>"Log out, ignoring any existing inhibitors"</span>)<span class='macro_popup'>("Log out, ignoring any existing inhibitors")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> {<span class='string_literal'>"logout-dialog"</span>, '\0', 0, G_OPTION_ARG_NONE, &logout_dialog, <span class='macro'>N_(<span class='string_literal'>"Show logout dialog"</span>)<span class='macro_popup'>("Show logout dialog")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> {<span class='string_literal'>"shutdown-dialog"</span>, '\0', 0, G_OPTION_ARG_NONE, &shutdown_dialog, <span class='macro'>N_(<span class='string_literal'>"Show shutdown dialog"</span>)<span class='macro_popup'>("Show shutdown dialog")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> {<span class='string_literal'>"gui"</span>, '\0', 0, G_OPTION_ARG_NONE, &show_error_dialogs, <span class='macro'>N_(<span class='string_literal'>"Use dialog boxes for errors"</span>)<span class='macro_popup'>("Use dialog boxes for errors")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> <span class='comment'>/* deprecated options */</span></td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> {<span class='string_literal'>"session-name"</span>, 's', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &session_name, <span class='macro'>N_(<span class='string_literal'>"Set the current session name"</span>)<span class='macro_popup'>("Set the current session name")</span></span>, <span class='macro'>N_(<span class='string_literal'>"NAME"</span>)<span class='macro_popup'>("NAME")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> {<span class='string_literal'>"kill"</span>, '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &kill_session, <span class='macro'>N_(<span class='string_literal'>"Kill session"</span>)<span class='macro_popup'>("Kill session")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> {<span class='string_literal'>"silent"</span>, '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &no_interaction, <span class='macro'>N_(<span class='string_literal'>"Do not require confirmation"</span>)<span class='macro_popup'>("Do not require confirmation")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> {<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, 0, G_OPTION_ARG_NONE, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>}</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> display_error(<span class='keyword'>const</span> <span class='keyword'>char</span>* message)</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> <span class='keyword'>if</span> (show_error_dialogs && !no_interaction)</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> GtkWidget* dialog = gtk_message_dialog_new(<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, <span class='string_literal'>"%s"</span>, message);</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> gtk_window_set_default_icon_name (<span class='string_literal'>"dialog-error"</span>);</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> gtk_dialog_run(<span class='macro'>GTK_DIALOG(dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> gtk_widget_destroy(dialog);</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> g_printerr(<span class='string_literal'>"%s\n"</span>, message);</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"><span class='keyword'>static</span> GDBusProxy* get_sm_proxy(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> GDBusProxy *sm_proxy = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> sm_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> G_DBUS_PROXY_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> <span class='macro'>GSM_SERVICE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> <span class='macro'>GSM_PATH_DBUS<span class='macro_popup'>"/org/gnome/SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='macro'>GSM_INTERFACE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> g_warning (<span class='string_literal'>"Couldn't create DBus proxy: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> <span class='comment'>/* Try the old name - for the case when we've just upgraded from 1.10</span></td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> <span class='comment'>* so the old m-s-m is currently running */</span></td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> sm_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> G_DBUS_PROXY_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> <span class='macro'>GSM_SERVICE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='macro'>GSM_PATH_DBUS_OLD<span class='macro_popup'>"/org/mate/SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> <span class='macro'>GSM_INTERFACE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> <span class='comment'>/* Okay, it wasn't the upgrade case, so now we can give up. */</span></td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> display_error (<span class='macro'>_(<span class='string_literal'>"Could not connect to the session manager"</span>)<span class='macro_popup'>gettext ("Could not connect to the session manager")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> do_logout(<span class='keyword'>unsigned</span> <span class='keyword'>int</span> mode)</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> GDBusProxy* sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> GVariant *ret;</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> sm_proxy = get_sm_proxy ();</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> ret = g_dbus_proxy_call_sync (sm_proxy, <span class='string_literal'>"Logout"</span>,</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> g_variant_new (<span class='string_literal'>"(u)"</span>, mode),</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> G_DBUS_CALL_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> <span class='keyword'>if</span> (ret == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> g_warning (<span class='string_literal'>"Failed to call logout: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> g_variant_unref (ret);</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> <span class='keyword'>if</span> (sm_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> g_object_unref (sm_proxy);</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> do_shutdown_dialog(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> GDBusProxy* sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> GVariant *ret;</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> sm_proxy = get_sm_proxy ();</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> ret = g_dbus_proxy_call_sync (sm_proxy, <span class='string_literal'>"Shutdown"</span>,</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> g_variant_new (<span class='string_literal'>"()"</span>),</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> G_DBUS_CALL_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='keyword'>if</span> (ret == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> g_warning (<span class='string_literal'>"Failed to call shutdown: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> g_variant_unref (ret);</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='keyword'>if</span> (sm_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> g_object_unref (sm_proxy);</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"><span class='keyword'>int</span> main(<span class='keyword'>int</span> argc, <span class='keyword'>char</span>* argv[])</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='keyword'>int</span> conflicting_options;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> <span class='comment'>/* Initialize the i18n stuff */</span></td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"><span class='directive'>#ifdef <span class='macro'>ENABLE_NLS<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> bindtextdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='macro'>LOCALE_DIR<span class='macro_popup'>"/usr/local/share/locale"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> bind_textdomain_codeset(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='string_literal'>"UTF-8"</span>);</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> textdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"><span class='directive'>#endif /* ENABLE_NLS */</span></td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='keyword'>if</span> (!gtk_init_with_args(&argc, &argv, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, options, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &error))</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> g_warning(<span class='string_literal'>"Unable to start: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> g_error_free(error);</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> exit(1);</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> conflicting_options = 0;</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (kill_session)</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> <span class='keyword'>if</span> (logout)</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='keyword'>if</span> (force_logout)</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> <span class='keyword'>if</span> (logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>if</span> (shutdown_dialog)</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> <span class='keyword'>if</span> (conflicting_options > 1)</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> display_error(<span class='macro'>_(<span class='string_literal'>"Program called with conflicting options"</span>)<span class='macro_popup'>gettext ("Program called with conflicting options")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> <span class='keyword'>if</span> (kill_session)</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>if</span> (<span class="mrange">no_interaction</span>)</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:21ex">This statement is never executed</div></td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> force_logout = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> logout_dialog = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> <span class='keyword'>if</span> (logout)</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> do_logout(GSM_LOGOUT_MODE_NO_CONFIRMATION);</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (force_logout)</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> do_logout(GSM_LOGOUT_MODE_FORCE);</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> do_logout(GSM_LOGOUT_MODE_NORMAL);</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (shutdown_dialog)</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> do_shutdown_dialog();</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> <span class='keyword'>return</span> 0;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-5a3b3a.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-5a3b3a.html new file mode 100644 index 0000000..9750075 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-5a3b3a.html @@ -0,0 +1,1521 @@ +<!doctype html> +<html> +<head> +<title>main.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Access of 'char *' element in the heap area at index 4 --> + +<!-- BUGTYPE Out-of-bound access --> + +<!-- BUGCATEGORY Logic error --> + +<!-- BUGFILE /rootdir/mate-session/main.c --> + +<!-- FILENAME main.c --> + +<!-- FUNCTIONNAME require_dbus_session --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 5a3b3a7a5baaca76f3fb351db55bb115 --> + +<!-- BUGLINE 518 --> + +<!-- BUGCOLUMN 2 --> + +<!-- BUGPATHLENGTH 15 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>mate-session/main.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 518, column 2</a><br />Access of 'char *' element in the heap area at index 4</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/mate-session -fcoverage-compilation-dir=/rootdir/mate-session -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -I /usr/include/uuid -I ../mate-submodules/libegg -D LOCALE_DIR="/usr/local/share/locale" -D DATA_DIR="/usr/local/share/mate-session" -D LIBEXECDIR="/usr/local/libexec" -D GTKBUILDER_DIR="/usr/local/share/mate-session-manager" -D I_KNOW_THE_DEVICEKIT_POWER_API_IS_SUBJECT_TO_CHANGE -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c main.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"492": 1, "493": 1, "494": 1, "495": 1, "497": 1, "505": 1, "508": 1, "510": 1, "511": 1, "513": 1, "515": 1, "516": 1, "518": 1, "592": 1, "593": 1, "594": 1, "595": 1, "596": 1, "597": 1, "598": 1, "599": 1, "600": 1, "601": 1, "602": 1, "603": 1, "604": 1, "605": 1, "607": 1, "608": 1, "609": 1, "610": 1, "611": 1, "612": 1, "617": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + <path class="arrow" id="arrow0"/> + <path class="arrow" id="arrow1"/> + <path class="arrow" id="arrow2"/> + <path class="arrow" id="arrow3"/> + <path class="arrow" id="arrow4"/> + <path class="arrow" id="arrow5"/> + <path class="arrow" id="arrow6"/> + <path class="arrow" id="arrow7"/> + <path class="arrow" id="arrow8"/> + <path class="arrow" id="arrow9"/> + <path class="arrow" id="arrow10"/> + <path class="arrow" id="arrow11"/> + <path class="arrow" id="arrow12"/> + <path class="arrow" id="arrow13"/> + <path class="arrow" id="arrow14"/> + <path class="arrow" id="arrow15"/> + <path class="arrow" id="arrow16"/> + <path class="arrow" id="arrow17"/> + <path class="arrow" id="arrow18"/> + <path class="arrow" id="arrow19"/> + <path class="arrow" id="arrow20"/> + <path class="arrow" id="arrow21"/> + <path class="arrow" id="arrow22"/> + <path class="arrow" id="arrow23"/> + <path class="arrow" id="arrow24"/> + <path class="arrow" id="arrow25"/> + <path class="arrow" id="arrow26"/> + <path class="arrow" id="arrow27"/> + <path class="arrow" id="arrow28"/> + <path class="arrow" id="arrow29"/> + <path class="arrow" id="arrow30"/> + <path class="arrow" id="arrow31"/> + <path class="arrow" id="arrow32"/> + <path class="arrow" id="arrow33"/> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 34,32,29,25,22,19,18,16,16,11,7,5,1,0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2006 Novell, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Copyright (C) 2008 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* This program is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU General Public License as</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* published by the Free Software Foundation; either version 2 of the</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>* License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful, but</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>* Lesser General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>* 02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <config.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <signal.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <<span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span>.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='directive'>#include <time.h></span></td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"><span class='directive'>#include <glib.h></span></td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#include <gio/gio.h></span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"><span class='directive'>#include <dbus/dbus.h></span></td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#include "mdm-signal-handler.h"</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#include "mdm-log.h"</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='directive'>#include "gsm-consolekit.h"</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"><span class='directive'>#include "gsm-systemd.h"</span></td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"><span class='directive'>#include "gsm-util.h"</span></td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"><span class='directive'>#include "gsm-manager.h"</span></td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='directive'>#include "gsm-xsmp-server.h"</span></td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"><span class='directive'>#include "gsm-store.h"</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"><span class='directive'>#include "msm-gnome.h"</span></td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span> "org.mate.session"</span></td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_DEFAULT_SESSION_KEY<span class='macro_popup'>"default-session"</span></span> "default-session"</span></td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_REQUIRED_COMPONENTS_SCHEMA<span class='macro_popup'>"org.mate.session" ".required-components"</span></span> <span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span> ".required-components"</span></td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_REQUIRED_COMPONENTS_LIST_KEY<span class='macro_popup'>"required-components-list"</span></span> "required-components-list"</span></td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"><span class='directive'>#define <span class='macro'>ACCESSIBILITY_KEY<span class='macro_popup'>"accessibility"</span></span> "accessibility"</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"><span class='directive'>#define <span class='macro'>ACCESSIBILITY_SCHEMA<span class='macro_popup'>"org.mate.interface"</span></span> "org.mate.interface"</span></td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"><span class='directive'>#define <span class='macro'>DEBUG_SCHEMA<span class='macro_popup'>"org.mate.debug"</span></span> "org.mate.debug"</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"><span class='directive'>#define <span class='macro'>DEBUG_KEY<span class='macro_popup'>"mate-session"</span></span> "mate-session"</span></td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"><span class='directive'>#define <span class='macro'>VISUAL_SCHEMA<span class='macro_popup'>"org.mate.applications-at-visual"</span></span> "org.mate.applications-at-visual"</span></td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"><span class='directive'>#define <span class='macro'>VISUAL_KEY<span class='macro_popup'>"exec"</span></span> "exec"</span></td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"><span class='directive'>#define <span class='macro'>VISUAL_STARTUP_KEY<span class='macro_popup'>"startup"</span></span> "startup"</span></td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"><span class='directive'>#define <span class='macro'>MOBILITY_SCHEMA<span class='macro_popup'>"org.mate.applications-at-mobility"</span></span> "org.mate.applications-at-mobility"</span></td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"><span class='directive'>#define <span class='macro'>MOBILITY_KEY<span class='macro_popup'>"exec"</span></span> "exec"</span></td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='directive'>#define <span class='macro'>MOBILITY_STARTUP_KEY<span class='macro_popup'>"startup"</span></span> "startup"</span></td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"><span class='directive'>#define <span class='macro'>MATE_INTERFACE_SCHEMA<span class='macro_popup'>"org.mate.interface"</span></span> "org.mate.interface"</span></td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"><span class='directive'>#define <span class='macro'>GTK_OVERLAY_SCROLL<span class='macro_popup'>"gtk-overlay-scrolling"</span></span> "gtk-overlay-scrolling"</span></td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_DBUS_NAME<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_AUTOSAVE<span class='macro_popup'>"auto-save-session"</span></span> "auto-save-session"</span></td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"><span class='keyword'>static</span> gboolean failsafe = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"><span class='keyword'>static</span> gboolean show_version = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='keyword'>static</span> gboolean debug = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"><span class='keyword'>static</span> gboolean disable_acceleration_check = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line">initialize_gsettings (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> GSettings* settings;</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> time_t now = time (0);</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> settings = g_settings_new (<span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> <span class='keyword'>if</span> (!settings)</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> ret = g_settings_set_int (settings, <span class='string_literal'>"session-start"</span>, now);</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> g_settings_sync ();</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> g_object_unref (settings);</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> on_bus_name_lost(DBusGProxy* bus_proxy, <span class='keyword'>const</span> <span class='keyword'>char</span>* name, gpointer data)</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> g_warning(<span class='string_literal'>"Lost name on bus: %s, exiting"</span>, name);</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> exit(1);</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"><span class='keyword'>static</span> gboolean acquire_name_on_proxy(DBusGProxy* bus_proxy, <span class='keyword'>const</span> <span class='keyword'>char</span>* name)</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> guint result;</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='keyword'>if</span> (bus_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> res = dbus_g_proxy_call(bus_proxy, <span class='string_literal'>"RequestName"</span>, &error, <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>, name, <span class='macro'>G_TYPE_UINT<span class='macro_popup'>((GType) ((7) << (2)))</span></span>, 0, <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>, <span class='macro'>G_TYPE_UINT<span class='macro_popup'>((GType) ((7) << (2)))</span></span>, &result, <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> <span class='keyword'>if</span> (! res)</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> g_warning(<span class='string_literal'>"Failed to acquire %s: %s"</span>, name, error->message);</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> g_error_free(error);</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> g_warning (<span class='string_literal'>"Failed to acquire %s"</span>, name);</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER<span class='macro_popup'>1</span></span>)</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> g_warning(<span class='string_literal'>"Failed to acquire %s: %s"</span>, name, error->message);</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> g_error_free(error);</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> g_warning(<span class='string_literal'>"Failed to acquire %s"</span>, name);</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> <span class='comment'>/* register for name lost */</span></td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> dbus_g_proxy_add_signal(bus_proxy, <span class='string_literal'>"NameLost"</span>, <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>, <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> dbus_g_proxy_connect_signal(bus_proxy, <span class='string_literal'>"NameLost"</span>, <span class='macro'>G_CALLBACK(on_bus_name_lost)<span class='macro_popup'>((GCallback) (on_bus_name_lost))</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> out:</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"><span class='keyword'>static</span> gboolean acquire_name(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> DBusGProxy* bus_proxy;</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> DBusGConnection* connection;</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>if</span> (connection == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> gsm_util_init_error(<span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='string_literal'>"Could not connect to session bus: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='comment'>/* not reached */</span></td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> bus_proxy = dbus_g_proxy_new_for_name(connection, <span class='macro'>DBUS_SERVICE_DBUS<span class='macro_popup'>"org.freedesktop.DBus"</span></span>, <span class='macro'>DBUS_PATH_DBUS<span class='macro_popup'>"/org/freedesktop/DBus"</span></span>, <span class='macro'>DBUS_INTERFACE_DBUS<span class='macro_popup'>"org.freedesktop.DBus"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='keyword'>if</span> (!acquire_name_on_proxy(bus_proxy, <span class='macro'>GSM_DBUS_NAME<span class='macro_popup'>"org.gnome.SessionManager"</span></span>))</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> gsm_util_init_error(<span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='string_literal'>"%s"</span>, <span class='string_literal'>"Could not acquire name on session bus"</span>);</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='comment'>/* not reached */</span></td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> g_object_unref(bus_proxy);</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"><span class='comment'>/* This doesn't contain the required components, so we need to always</span></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='comment'>* call append_required_apps() after a call to append_default_apps(). */</span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> append_default_apps(GsmManager* manager, <span class='keyword'>const</span> <span class='keyword'>char</span>* default_session_key, <span class='keyword'>char</span>** autostart_dirs)</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> gint i;</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> gchar** default_apps;</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> GSettings* settings;</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> g_debug(<span class='string_literal'>"main: *** Adding default apps"</span>);</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='macro'>g_assert(default_session_key != NULL)<span class='macro_popup'>do { if (default_session_key != ((void*)0)) ; else g_assertion_message_expr<br> (((gchar*) 0), "main.c", 207, ((const char*) (__func__)), "default_session_key != NULL"<br>); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> <span class='macro'>g_assert(autostart_dirs != NULL)<span class='macro_popup'>do { if (autostart_dirs != ((void*)0)) ; else g_assertion_message_expr<br> (((gchar*) 0), "main.c", 208, ((const char*) (__func__)), "autostart_dirs != NULL"<br>); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> settings = g_settings_new (<span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> default_apps = g_settings_get_strv (settings, default_session_key);</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> g_object_unref(settings);</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> <span class='keyword'>for</span> (i = 0; default_apps[i]; i++)</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> <span class='keyword'>char</span>* app_path;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY((<span class='keyword'>char</span>*) default_apps[i])<span class='macro_popup'>(((char*) default_apps[i])==((void*)0)||((char*) default_apps<br>[i])[0]=='\0')</span></span>)</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> app_path = gsm_util_find_desktop_file_for_app_name(default_apps[i], autostart_dirs);</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='keyword'>if</span> (app_path != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> gsm_manager_add_autostart_app(manager, app_path, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> g_free(app_path);</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> g_strfreev (default_apps);</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> append_required_apps(GsmManager* manager)</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> gchar** required_components;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> gint i;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> GSettings* settings;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> GSettings* settings_required_components;</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> g_debug(<span class='string_literal'>"main: *** Adding required apps"</span>);</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> settings = g_settings_new (<span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> settings_required_components = g_settings_new (<span class='macro'>GSM_REQUIRED_COMPONENTS_SCHEMA<span class='macro_popup'>"org.mate.session" ".required-components"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> required_components = g_settings_get_strv(settings, <span class='macro'>GSM_REQUIRED_COMPONENTS_LIST_KEY<span class='macro_popup'>"required-components-list"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> <span class='keyword'>if</span> (required_components == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> g_warning(<span class='string_literal'>"No required applications specified"</span>);</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> <span class='keyword'>for</span> (i = 0; required_components[i]; i++)</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> <span class='keyword'>char</span>* default_provider;</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span>* component;</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY((<span class='keyword'>char</span>*) required_components[i])<span class='macro_popup'>(((char*) required_components[i])==((void*)0)||((char*) required_components<br>[i])[0]=='\0')</span></span>)</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> component = required_components[i];</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> default_provider = g_settings_get_string (settings_required_components, component);</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> g_debug (<span class='string_literal'>"main: %s looking for component: '%s'"</span>, component, default_provider);</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>if</span> (default_provider != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> <span class='keyword'>char</span>* app_path;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> app_path = gsm_util_find_desktop_file_for_app_name(default_provider, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>if</span> (app_path != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> gsm_manager_add_autostart_app(manager, app_path, component);</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> g_warning(<span class='string_literal'>"Unable to find provider '%s' of required component '%s'"</span>, default_provider, component);</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> g_free(app_path);</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> g_free(default_provider);</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> g_debug(<span class='string_literal'>"main: *** Done adding required apps"</span>);</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> g_strfreev(required_components);</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> g_object_unref(settings);</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> g_object_unref(settings_required_components);</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> append_accessibility_apps(GsmManager* manager)</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> GSettings* mobility_settings;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> GSettings* visual_settings;</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> g_debug(<span class='string_literal'>"main: *** Adding accesibility apps"</span>);</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> mobility_settings = g_settings_new (<span class='macro'>MOBILITY_SCHEMA<span class='macro_popup'>"org.mate.applications-at-mobility"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> visual_settings = g_settings_new (<span class='macro'>VISUAL_SCHEMA<span class='macro_popup'>"org.mate.applications-at-visual"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> <span class='keyword'>if</span> (g_settings_get_boolean (mobility_settings, <span class='macro'>MOBILITY_STARTUP_KEY<span class='macro_popup'>"startup"</span></span>))</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> gchar *mobility_exec;</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> mobility_exec = g_settings_get_string (mobility_settings, <span class='macro'>MOBILITY_KEY<span class='macro_popup'>"exec"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> <span class='keyword'>if</span> (mobility_exec != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> && mobility_exec[0] != 0)</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> <span class='keyword'>char</span>* app_path;</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> app_path = gsm_util_find_desktop_file_for_app_name(mobility_exec, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> <span class='keyword'>if</span> (app_path != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> gsm_manager_add_autostart_app(manager, app_path, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> g_free (app_path);</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> g_free (mobility_exec);</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (g_settings_get_boolean (visual_settings, <span class='macro'>VISUAL_STARTUP_KEY<span class='macro_popup'>"startup"</span></span>))</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> gchar *visual_exec;</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> visual_exec = g_settings_get_string (visual_settings, <span class='macro'>VISUAL_KEY<span class='macro_popup'>"exec"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> <span class='keyword'>if</span> (visual_exec != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> && visual_exec[0] != 0)</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> <span class='keyword'>char</span>* app_path;</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> app_path = gsm_util_find_desktop_file_for_app_name(visual_exec, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='keyword'>if</span> (app_path != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> gsm_manager_add_autostart_app(manager, app_path, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> g_free (app_path);</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> g_free (visual_exec);</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> g_object_unref (mobility_settings);</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> g_object_unref (visual_settings);</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> maybe_load_saved_session_apps(GsmManager* manager)</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> GsmConsolekit* consolekit = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> GsmSystemd* systemd = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>char</span>* session_type;</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> gboolean is_login;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> systemd = gsm_get_systemd();</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> session_type = gsm_systemd_get_current_session_type(systemd);</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> is_login = g_strcmp0 (session_type, <span class='macro'>GSM_SYSTEMD_SESSION_TYPE_LOGIN_WINDOW<span class='macro_popup'>"greeter"</span></span>) == 0;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> consolekit = gsm_get_consolekit();</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> session_type = gsm_consolekit_get_current_session_type(consolekit);</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> is_login = g_strcmp0 (session_type, <span class='macro'>GSM_CONSOLEKIT_SESSION_TYPE_LOGIN_WINDOW<span class='macro_popup'>"LoginWindow"</span></span>) == 0;</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>if</span> (!is_login)</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> GSettings* settings;</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> gboolean autostart;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> settings = g_settings_new (<span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> autostart = g_settings_get_boolean (settings, <span class='macro'>KEY_AUTOSAVE<span class='macro_popup'>"auto-save-session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> g_object_unref (settings);</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> <span class='keyword'>if</span> (autostart == <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>)</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> gsm_manager_add_autostart_apps_from_dir(manager, gsm_util_get_saved_session_dir());</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> <span class='keyword'>if</span> (consolekit != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> g_object_unref(consolekit);</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='keyword'>if</span> (systemd != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> g_object_unref(systemd);</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> g_free(session_type);</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> load_standard_apps (GsmManager* manager, <span class='keyword'>const</span> <span class='keyword'>char</span>* default_session_key)</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> <span class='keyword'>char</span>** autostart_dirs;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> autostart_dirs = gsm_util_get_autostart_dirs();</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> <span class='keyword'>if</span> (!failsafe)</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> maybe_load_saved_session_apps(manager);</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>for</span> (i = 0; autostart_dirs[i]; i++)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> gsm_manager_add_autostart_apps_from_dir(manager, autostart_dirs[i]);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> <span class='comment'>/* We do this at the end in case a saved session contains an</span></td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> <span class='comment'>* application that already provides one of the components. */</span></td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> append_default_apps(manager, default_session_key, autostart_dirs);</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> append_required_apps(manager);</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> append_accessibility_apps(manager);</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> g_strfreev(autostart_dirs);</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> load_override_apps(GsmManager* manager, <span class='keyword'>char</span>** override_autostart_dirs)</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> <span class='keyword'>for</span> (i = 0; override_autostart_dirs[i]; i++)</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> gsm_manager_add_autostart_apps_from_dir(manager, override_autostart_dirs[i]);</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"><span class='keyword'>static</span> gboolean signal_cb(<span class='keyword'>int</span> signo, gpointer data)</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> <span class='keyword'>int</span> ret;</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> GsmManager* manager;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> g_debug(<span class='string_literal'>"Got callback for signal %d"</span>, signo);</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> <span class='keyword'>switch</span> (signo)</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGFPE<span class='macro_popup'>8</span></span>:</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGPIPE<span class='macro_popup'>13</span></span>:</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> <span class='comment'>/* let the fatal signals interrupt us */</span></td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> g_debug (<span class='string_literal'>"Caught signal %d, shutting down abnormally."</span>, signo);</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGINT<span class='macro_popup'>2</span></span>:</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGTERM<span class='macro_popup'>15</span></span>:</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> manager = (GsmManager*) data;</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> gsm_manager_logout(manager, GSM_MANAGER_LOGOUT_MODE_FORCE, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> <span class='comment'>/* let the fatal signals interrupt us */</span></td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> g_debug(<span class='string_literal'>"Caught signal %d, shutting down normally."</span>, signo);</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGHUP<span class='macro_popup'>1</span></span>:</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> g_debug(<span class='string_literal'>"Got HUP signal"</span>);</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGUSR1<span class='macro_popup'>10</span></span>:</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> g_debug(<span class='string_literal'>"Got USR1 signal"</span>);</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> mdm_log_toggle_debug();</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> g_debug(<span class='string_literal'>"Caught unhandled signal %d"</span>, signo);</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> shutdown_cb(gpointer data)</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> GsmManager* manager = (GsmManager*) data;</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> g_debug(<span class='string_literal'>"Calling shutdown callback function"</span>);</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> <span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='comment'>* When the signal handler gets a shutdown signal, it calls</span></td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> <span class='comment'>* this function to inform GsmManager to not restart</span></td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> <span class='comment'>* applications in the off chance a handler is already queued</span></td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> <span class='comment'>* to dispatch following the below call to gtk_main_quit.</span></td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> gsm_manager_set_phase(manager, GSM_MANAGER_PHASE_EXIT);</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> gtk_main_quit();</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"><span id="start31"><span class='keyword'>static</span></span> gboolean require_dbus_session(<span class='keyword'>int</span> argc, <span class='keyword'>char</span>** argv, GError** error)</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> <span id="start30"><span id="end31"><span class='keyword'>char</span></span></span>** new_argv;</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span id="start25"><span id="start29"><span id="end30"><span class='keyword'>if</span></span></span></span> (<span id="start28"><span class="mrange"><span id="end29">g_getenv</span></span>(<span class='string_literal'>"DBUS_SESSION_BUS_ADDRESS"</span>)</span>)</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path2" class="msg msgEvent" style="margin-left:13ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">2</div></td><td><div class="PathNav"><a href="#Path1" title="Previous event (1)">←</a></div></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path3" title="Next event (3)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> <span class='comment'>/* Just a sanity check to prevent infinite recursion if</span></td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> <span class='comment'>* dbus-launch fails to set DBUS_SESSION_BUS_ADDRESS</span></td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span id="start17"><span class="mrange"><span id="start18"><span id="end18"><span class="mrange"><span id="start19"><span id="end19"><span id="start20"><span id="end20"><span id="start21"><span id="end21"><span id="start22"><span id="end22"><span id="start23"><span id="end23"><span id="start24"><span id="end24"><span id="end25"><span id="start26"><span id="end26"><span id="start27"><span id="end27"><span id="end28"><span class='macro'>g_return_val_if_fail</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>(!g_str_has_prefix(argv[0], <span class='string_literal'>"dbus-launch"</span>), TRUE)<span class='macro_popup'>do { if ((!(__builtin_constant_p ("dbus-launch")? __extension__<br> ({ const char * const __str = (argv[0]); const char * const __prefix<br> = ("dbus-launch"); gboolean __result = (0); if (__str == ((void<br>*)0) || __prefix == ((void*)0)) __result = (g_str_has_prefix)<br> (__str, __prefix); else { const size_t __str_len = strlen ((<br>(__str) + !(__str))); const size_t __prefix_len = strlen (((__prefix<br>) + !(__prefix))); if (__str_len >= __prefix_len) __result<br> = memcmp (((__str) + !(__str)), ((__prefix) + !(__prefix)), __prefix_len<br>) == 0; } __result; }) : (g_str_has_prefix) (argv[0], "dbus-launch"<br>) ))) { } else { g_return_if_fail_warning (((gchar*) 0), ((const<br> char*) (__func__)), "!g_str_has_prefix(argv[0], \"dbus-launch\")"<br>); return ((!(0))); } } while (0)</span></span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path3" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">3</div></td><td><div class="PathNav"><a href="#Path2" title="Previous event (2)">←</a></div></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path4" title="Next event (4)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path4" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">4</div></td><td><div class="PathNav"><a href="#Path3" title="Previous event (3)">←</a></div></td><td>'?' condition is true</td><td><div class="PathNav"><a href="#Path5" title="Next event (5)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path5" class="msg msgEvent" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">5</div></td><td><div class="PathNav"><a href="#Path4" title="Previous event (4)">←</a></div></td><td>Assuming '__str' is equal to null</td><td><div class="PathNav"><a href="#Path6" title="Next event (6)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path6" class="msg msgEvent" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">6</div></td><td><div class="PathNav"><a href="#Path5" title="Previous event (5)">←</a></div></td><td>Assuming the condition is true</td><td><div class="PathNav"><a href="#Path7" title="Next event (7)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path7" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">7</div></td><td><div class="PathNav"><a href="#Path6" title="Previous event (6)">←</a></div></td><td>Taking true branch</td><td><div class="PathNav"><a href="#Path8" title="Next event (8)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path8" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">8</div></td><td><div class="PathNav"><a href="#Path7" title="Previous event (7)">←</a></div></td><td>Loop condition is false. Exiting loop</td><td><div class="PathNav"><a href="#Path9" title="Next event (9)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> <span class='comment'>/* +2 for our new arguments, +1 for NULL */</span></td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> <span id="start14"><span id="end15"><span id="start16"><span id="end17">new_argv</span></span></span></span> = g_malloc(<span id="start15"><span id="end16">argc</span></span> + 3 * <span class='keyword'>sizeof</span> (*argv));</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> new_argv[0] = <span class='string_literal'>"dbus-launch"</span>;</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> new_argv[1] = <span class='string_literal'>"--exit-with-session"</span>;</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> <span id="start1"><span id="end2"><span id="start7"><span id="end8"><span id="start13"><span id="end14"><span class='keyword'>for</span></span></span></span></span></span></span> (i = 0; <span id="start0"><span class="mrange"><span id="end1"><span id="start6"><span class="mrange"><span id="end7"><span id="start12"><span id="end13"><span class='variable'>i<table class='variable_popup'><tbody><tr><td valign='top'><div class='PathIndex PathIndexPopUp'>8.1</div></td><td>'i' is < 'argc'</td></tr></tbody></table></span></span></span></span></span></span></span> < argc</span></span>; i++)</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path9" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">9</div></td><td><div class="PathNav"><a href="#Path8" title="Previous event (8)">←</a></div></td><td>Loop condition is true. Entering loop body</td><td><div class="PathNav"><a href="#Path10" title="Next event (10)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path10" class="msg msgEvent" style="margin-left:21ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">10</div></td><td><div class="PathNav"><a href="#Path9" title="Previous event (9)">←</a></div></td><td>Assuming 'i' is < 'argc'</td><td><div class="PathNav"><a href="#Path11" title="Next event (11)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path11" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">11</div></td><td><div class="PathNav"><a href="#Path10" title="Previous event (10)">←</a></div></td><td>Loop condition is true. Entering loop body</td><td><div class="PathNav"><a href="#Path12" title="Next event (12)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path12" class="msg msgEvent" style="margin-left:21ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">12</div></td><td><div class="PathNav"><a href="#Path11" title="Previous event (11)">←</a></div></td><td>Assuming 'i' is >= 'argc'</td><td><div class="PathNav"><a href="#Path13" title="Next event (13)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path13" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">13</div></td><td><div class="PathNav"><a href="#Path12" title="Previous event (12)">←</a></div></td><td>Loop condition is false. Execution continues on line 518</td><td><div class="PathNav"><a href="#EndPath" title="Next event (14)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> <span id="start3"><span id="end4"><span id="start5"><span id="end6"><span id="start9"><span id="end10"><span id="start11"><span id="end12">new_argv</span></span></span></span></span></span></span></span>[i + 2] = <span id="start4"><span id="end5"><span id="start10"><span id="end11">argv</span></span></span></span>[i];</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> <span id="start2"><span id="end3"><span id="start8"><span id="end9">}</td></tr></span></span></span></span> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> <span class="mrange"><span id="end0">new_argv</span>[i + 2]</span> = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">14</div></td><td><div class="PathNav"><a href="#Path13" title="Previous event (13)">←</a></div></td><td>Access of 'char *' element in the heap area at index 4</td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>if</span> (!execvp(<span class='string_literal'>"dbus-launch"</span>, new_argv))</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> g_set_error(error, <span class='macro'>G_SPAWN_ERROR<span class='macro_popup'>g_spawn_error_quark ()</span></span>, G_SPAWN_ERROR_FAILED, <span class='string_literal'>"No session bus and could not exec dbus-launch: %s"</span>, g_strerror(<span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span>));</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> g_free (new_argv);</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> g_free (new_argv);</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> <span class='comment'>/* Should not be reached */</span></td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line">debug_changed (GSettings *settings, gchar *key, gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> debug = g_settings_get_boolean (settings, <span class='macro'>DEBUG_KEY<span class='macro_popup'>"mate-session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> mdm_log_set_debug (debug);</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line">schema_exists (<span class='keyword'>const</span> gchar* schema_name)</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> GSettingsSchemaSource *source;</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> GSettingsSchema *schema;</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> gboolean exists;</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> source = g_settings_schema_source_get_default();</td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> schema = g_settings_schema_source_lookup (source, schema_name, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> exists = (schema != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> <span class='keyword'>if</span> (schema)</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> g_settings_schema_unref (schema);</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='keyword'>return</span> exists;</td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> set_overlay_scroll (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> GSettings *settings;</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> gboolean enabled;</td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> settings = g_settings_new (<span class='macro'>MATE_INTERFACE_SCHEMA<span class='macro_popup'>"org.mate.interface"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> enabled = g_settings_get_boolean (settings, <span class='macro'>GTK_OVERLAY_SCROLL<span class='macro_popup'>"gtk-overlay-scrolling"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> <span class='keyword'>if</span> (enabled) {</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> gsm_util_setenv (<span class='string_literal'>"GTK_OVERLAY_SCROLLING"</span>, <span class='string_literal'>"1"</span>);</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> gsm_util_setenv (<span class='string_literal'>"GTK_OVERLAY_SCROLLING"</span>, <span class='string_literal'>"0"</span>);</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> g_object_unref (settings);</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line">check_gl (gchar **gl_renderer, GError **error)</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> <span class='keyword'>int</span> status;</td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> <span class='keyword'>char</span> *argv[] = { <span class='macro'>LIBEXECDIR<span class='macro_popup'>"/usr/local/libexec"</span></span> <span class='string_literal'>"/mate-session-check-accelerated"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> };</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>if</span> (getenv (<span class='string_literal'>"DISPLAY"</span>) == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> <span class='comment'>/* Not connected to X11, someone else will take care of checking GL */</span></td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> <span class='keyword'>if</span> (!g_spawn_sync (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, (<span class='keyword'>char</span> **) argv, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, gl_renderer, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> &status, error)) {</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> <span class='keyword'>return</span> g_spawn_check_exit_status (status, error);</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"><span class='keyword'>int</span> main(<span class='keyword'>int</span> argc, <span class='keyword'>char</span>** argv)</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> <span id="start33"><span class='keyword'>struct</span></span> sigaction sa;</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span>* display_str;</td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> GsmManager* manager;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> GsmStore* client_store;</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> GsmXsmpServer* xsmp_server;</td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> GSettings* debug_settings = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> GSettings* accessibility_settings;</td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> MdmSignalHandler* signal_handler;</td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>char</span>** override_autostart_dirs = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> <span class='keyword'>char</span>* gl_renderer = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> gboolean gl_failed = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> <span class='keyword'>static</span> GOptionEntry entries[] = {</td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> {<span class='string_literal'>"autostart"</span>, 'a', 0, G_OPTION_ARG_STRING_ARRAY, &override_autostart_dirs, <span class='macro'>N_(<span class='string_literal'>"Override standard autostart directories"</span>)<span class='macro_popup'>("Override standard autostart directories")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> {<span class='string_literal'>"debug"</span>, 0, 0, G_OPTION_ARG_NONE, &debug, <span class='macro'>N_(<span class='string_literal'>"Enable debugging code"</span>)<span class='macro_popup'>("Enable debugging code")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> {<span class='string_literal'>"failsafe"</span>, 'f', 0, G_OPTION_ARG_NONE, &failsafe, <span class='macro'>N_(<span class='string_literal'>"Do not load user-specified applications"</span>)<span class='macro_popup'>("Do not load user-specified applications")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> {<span class='string_literal'>"version"</span>, 0, 0, G_OPTION_ARG_NONE, &show_version, <span class='macro'>N_(<span class='string_literal'>"Version of this application"</span>)<span class='macro_popup'>("Version of this application")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> { <span class='string_literal'>"disable-acceleration-check"</span>, 0, 0, G_OPTION_ARG_NONE, &disable_acceleration_check, <span class='macro'>N_(<span class='string_literal'>"Disable hardware acceleration check"</span>)<span class='macro_popup'>("Disable hardware acceleration check")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> },</td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> {<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, 0, 0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> }</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> <span class='comment'>/* Make sure that we have a session bus */</span></td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> <span id="start32"><span id="end33"><span class='keyword'>if</span></span></span> (!<span class="mrange"><span id="end32">require_dbus_session</span>(argc, argv, &error)</span>)</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path1" class="msg msgEvent" style="margin-left:14ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">1</div></td><td>Calling 'require_dbus_session'</td><td><div class="PathNav"><a href="#Path2" title="Next event (2)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> gsm_util_init_error(<span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='string_literal'>"%s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"><span class='directive'>#ifdef <span class='macro'>ENABLE_NLS<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line"> bindtextdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='macro'>LOCALE_DIR<span class='macro_popup'>"/usr/local/share/locale"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> bind_textdomain_codeset(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='string_literal'>"UTF-8"</span>);</td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"> textdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line"><span class='directive'>#endif /* ENABLE_NLS */</span></td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> sa.<span class='macro'>sa_handler<span class='macro_popup'>__sigaction_handler.sa_handler</span></span> = <span class='macro'>SIG_IGN<span class='macro_popup'>((__sighandler_t) 1)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> sa.sa_flags = 0;</td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> sigemptyset(&sa.sa_mask);</td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> sigaction(<span class='macro'>SIGPIPE<span class='macro_popup'>13</span></span>, &sa, 0);</td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> gtk_init_with_args(&argc, &argv, (<span class='keyword'>char</span>*) <span class='macro'>_(<span class='string_literal'>" - the MATE session manager"</span>)<span class='macro_popup'>gettext (" - the MATE session manager")</span></span>, entries, <span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, &error);</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> g_warning(<span class='string_literal'>"%s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> exit(1);</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='keyword'>if</span> (show_version)</td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> g_print(<span class='string_literal'>"%s %s\n"</span>, g_get_application_name(), <span class='macro'>VERSION<span class='macro_popup'>"1.28.0"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> exit(1);</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> gsm_util_export_activation_environment (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> gsm_util_export_user_environment (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> mdm_log_init();</td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line"> <span class='comment'>/* Allows to enable/disable debug from GSettings only if it is not set from argument */</span></td></tr> +<tr class="codeline" data-linenumber="657"><td class="num" id="LN657">657</td><td class="line"> <span class='keyword'>if</span> (!debug && schema_exists(<span class='macro'>DEBUG_SCHEMA<span class='macro_popup'>"org.mate.debug"</span></span>))</td></tr> +<tr class="codeline" data-linenumber="658"><td class="num" id="LN658">658</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="659"><td class="num" id="LN659">659</td><td class="line"> debug_settings = g_settings_new (<span class='macro'>DEBUG_SCHEMA<span class='macro_popup'>"org.mate.debug"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="660"><td class="num" id="LN660">660</td><td class="line"> <span class='macro'>g_signal_connect (debug_settings, <span class='string_literal'>"changed::"</span> DEBUG_KEY, G_CALLBACK (debug_changed), NULL)<span class='macro_popup'>g_signal_connect_data ((debug_settings), ("changed::" "mate-session"<br>), (((GCallback) (debug_changed))), (((void*)0)), ((void*)0),<br> (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="661"><td class="num" id="LN661">661</td><td class="line"> debug = g_settings_get_boolean (debug_settings, <span class='macro'>DEBUG_KEY<span class='macro_popup'>"mate-session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="662"><td class="num" id="LN662">662</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="663"><td class="num" id="LN663">663</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="664"><td class="num" id="LN664">664</td><td class="line"> mdm_log_set_debug(debug);</td></tr> +<tr class="codeline" data-linenumber="665"><td class="num" id="LN665">665</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="666"><td class="num" id="LN666">666</td><td class="line"> <span class='keyword'>if</span> (disable_acceleration_check) {</td></tr> +<tr class="codeline" data-linenumber="667"><td class="num" id="LN667">667</td><td class="line"> g_debug (<span class='string_literal'>"hardware acceleration check is disabled"</span>);</td></tr> +<tr class="codeline" data-linenumber="668"><td class="num" id="LN668">668</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="669"><td class="num" id="LN669">669</td><td class="line"> <span class='comment'>/* Check GL, if it doesn't work out then force software fallback */</span></td></tr> +<tr class="codeline" data-linenumber="670"><td class="num" id="LN670">670</td><td class="line"> <span class='keyword'>if</span> (!check_gl (&gl_renderer, &error)) {</td></tr> +<tr class="codeline" data-linenumber="671"><td class="num" id="LN671">671</td><td class="line"> gl_failed = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="672"><td class="num" id="LN672">672</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="673"><td class="num" id="LN673">673</td><td class="line"> g_debug (<span class='string_literal'>"hardware acceleration check failed: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="674"><td class="num" id="LN674">674</td><td class="line"> error? error->message : <span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="675"><td class="num" id="LN675">675</td><td class="line"> g_clear_error (&error);</td></tr> +<tr class="codeline" data-linenumber="676"><td class="num" id="LN676">676</td><td class="line"> <span class='keyword'>if</span> (g_getenv (<span class='string_literal'>"LIBGL_ALWAYS_SOFTWARE"</span>) == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="677"><td class="num" id="LN677">677</td><td class="line"> g_setenv (<span class='string_literal'>"LIBGL_ALWAYS_SOFTWARE"</span>, <span class='string_literal'>"1"</span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="678"><td class="num" id="LN678">678</td><td class="line"> <span class='keyword'>if</span> (!check_gl (&gl_renderer, &error)) {</td></tr> +<tr class="codeline" data-linenumber="679"><td class="num" id="LN679">679</td><td class="line"> g_warning (<span class='string_literal'>"software acceleration check failed: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="680"><td class="num" id="LN680">680</td><td class="line"> error? error->message : <span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="681"><td class="num" id="LN681">681</td><td class="line"> g_clear_error (&error);</td></tr> +<tr class="codeline" data-linenumber="682"><td class="num" id="LN682">682</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="683"><td class="num" id="LN683">683</td><td class="line"> gl_failed = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="684"><td class="num" id="LN684">684</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="685"><td class="num" id="LN685">685</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="686"><td class="num" id="LN686">686</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="687"><td class="num" id="LN687">687</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="688"><td class="num" id="LN688">688</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="689"><td class="num" id="LN689">689</td><td class="line"> <span class='keyword'>if</span> (gl_failed) {</td></tr> +<tr class="codeline" data-linenumber="690"><td class="num" id="LN690">690</td><td class="line"> g_warning (<span class='string_literal'>"gl_failed!"</span>);</td></tr> +<tr class="codeline" data-linenumber="691"><td class="num" id="LN691">691</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="692"><td class="num" id="LN692">692</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="693"><td class="num" id="LN693">693</td><td class="line"> <span class='keyword'>if</span> (g_getenv (<span class='string_literal'>"XDG_CURRENT_DESKTOP"</span>) == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="694"><td class="num" id="LN694">694</td><td class="line"> gsm_util_setenv (<span class='string_literal'>"XDG_CURRENT_DESKTOP"</span>, <span class='string_literal'>"MATE"</span>);</td></tr> +<tr class="codeline" data-linenumber="695"><td class="num" id="LN695">695</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="696"><td class="num" id="LN696">696</td><td class="line"> <span class='comment'>/* Set DISPLAY explicitly for all our children, in case --display</span></td></tr> +<tr class="codeline" data-linenumber="697"><td class="num" id="LN697">697</td><td class="line"> <span class='comment'>* was specified on the command line.</span></td></tr> +<tr class="codeline" data-linenumber="698"><td class="num" id="LN698">698</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="699"><td class="num" id="LN699">699</td><td class="line"> display_str = gdk_display_get_name (gdk_display_get_default());</td></tr> +<tr class="codeline" data-linenumber="700"><td class="num" id="LN700">700</td><td class="line"> gsm_util_setenv(<span class='string_literal'>"DISPLAY"</span>, display_str);</td></tr> +<tr class="codeline" data-linenumber="701"><td class="num" id="LN701">701</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="702"><td class="num" id="LN702">702</td><td class="line"> <span class='comment'>/* Some third-party programs rely on MATE_DESKTOP_SESSION_ID to</span></td></tr> +<tr class="codeline" data-linenumber="703"><td class="num" id="LN703">703</td><td class="line"> <span class='comment'>* detect if MATE is running. We keep this for compatibility reasons.</span></td></tr> +<tr class="codeline" data-linenumber="704"><td class="num" id="LN704">704</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="705"><td class="num" id="LN705">705</td><td class="line"> gsm_util_setenv(<span class='string_literal'>"MATE_DESKTOP_SESSION_ID"</span>, <span class='string_literal'>"this-is-deprecated"</span>);</td></tr> +<tr class="codeline" data-linenumber="706"><td class="num" id="LN706">706</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="707"><td class="num" id="LN707">707</td><td class="line"> <span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="708"><td class="num" id="LN708">708</td><td class="line"> <span class='comment'>* Make sure gsettings is set up correctly. If not, then bail.</span></td></tr> +<tr class="codeline" data-linenumber="709"><td class="num" id="LN709">709</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="710"><td class="num" id="LN710">710</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="711"><td class="num" id="LN711">711</td><td class="line"> <span class='keyword'>if</span> (initialize_gsettings () != <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>)</td></tr> +<tr class="codeline" data-linenumber="712"><td class="num" id="LN712">712</td><td class="line"> exit (1);</td></tr> +<tr class="codeline" data-linenumber="713"><td class="num" id="LN713">713</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="714"><td class="num" id="LN714">714</td><td class="line"> <span class='comment'>/* Look if accessibility is enabled */</span></td></tr> +<tr class="codeline" data-linenumber="715"><td class="num" id="LN715">715</td><td class="line"> accessibility_settings = g_settings_new (<span class='macro'>ACCESSIBILITY_SCHEMA<span class='macro_popup'>"org.mate.interface"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="716"><td class="num" id="LN716">716</td><td class="line"> <span class='keyword'>if</span> (g_settings_get_boolean (accessibility_settings, <span class='macro'>ACCESSIBILITY_KEY<span class='macro_popup'>"accessibility"</span></span>))</td></tr> +<tr class="codeline" data-linenumber="717"><td class="num" id="LN717">717</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="718"><td class="num" id="LN718">718</td><td class="line"> gsm_util_setenv(<span class='string_literal'>"GTK_MODULES"</span>, <span class='string_literal'>"gail:atk-bridge"</span>);</td></tr> +<tr class="codeline" data-linenumber="719"><td class="num" id="LN719">719</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="720"><td class="num" id="LN720">720</td><td class="line"> g_object_unref (accessibility_settings);</td></tr> +<tr class="codeline" data-linenumber="721"><td class="num" id="LN721">721</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="722"><td class="num" id="LN722">722</td><td class="line"> client_store = gsm_store_new();</td></tr> +<tr class="codeline" data-linenumber="723"><td class="num" id="LN723">723</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="724"><td class="num" id="LN724">724</td><td class="line"> xsmp_server = gsm_xsmp_server_new(client_store);</td></tr> +<tr class="codeline" data-linenumber="725"><td class="num" id="LN725">725</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="726"><td class="num" id="LN726">726</td><td class="line"> <span class='comment'>/* Now make sure they succeeded. (They'll call</span></td></tr> +<tr class="codeline" data-linenumber="727"><td class="num" id="LN727">727</td><td class="line"> <span class='comment'>* gsm_util_init_error() if they failed.)</span></td></tr> +<tr class="codeline" data-linenumber="728"><td class="num" id="LN728">728</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="729"><td class="num" id="LN729">729</td><td class="line"> acquire_name();</td></tr> +<tr class="codeline" data-linenumber="730"><td class="num" id="LN730">730</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="731"><td class="num" id="LN731">731</td><td class="line"> <span class='comment'>/* Starts gnome compat mode */</span></td></tr> +<tr class="codeline" data-linenumber="732"><td class="num" id="LN732">732</td><td class="line"> msm_gnome_start();</td></tr> +<tr class="codeline" data-linenumber="733"><td class="num" id="LN733">733</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="734"><td class="num" id="LN734">734</td><td class="line"> <span class='comment'>/* Set to use Gtk3 overlay scroll */</span></td></tr> +<tr class="codeline" data-linenumber="735"><td class="num" id="LN735">735</td><td class="line"> set_overlay_scroll ();</td></tr> +<tr class="codeline" data-linenumber="736"><td class="num" id="LN736">736</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="737"><td class="num" id="LN737">737</td><td class="line"> manager = gsm_manager_new(client_store, failsafe);</td></tr> +<tr class="codeline" data-linenumber="738"><td class="num" id="LN738">738</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="739"><td class="num" id="LN739">739</td><td class="line"> signal_handler = mdm_signal_handler_new();</td></tr> +<tr class="codeline" data-linenumber="740"><td class="num" id="LN740">740</td><td class="line"> mdm_signal_handler_add_fatal(signal_handler);</td></tr> +<tr class="codeline" data-linenumber="741"><td class="num" id="LN741">741</td><td class="line"> mdm_signal_handler_add(signal_handler, <span class='macro'>SIGFPE<span class='macro_popup'>8</span></span>, signal_cb, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="742"><td class="num" id="LN742">742</td><td class="line"> mdm_signal_handler_add(signal_handler, <span class='macro'>SIGHUP<span class='macro_popup'>1</span></span>, signal_cb, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="743"><td class="num" id="LN743">743</td><td class="line"> mdm_signal_handler_add(signal_handler, <span class='macro'>SIGUSR1<span class='macro_popup'>10</span></span>, signal_cb, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="744"><td class="num" id="LN744">744</td><td class="line"> mdm_signal_handler_add(signal_handler, <span class='macro'>SIGTERM<span class='macro_popup'>15</span></span>, signal_cb, manager);</td></tr> +<tr class="codeline" data-linenumber="745"><td class="num" id="LN745">745</td><td class="line"> mdm_signal_handler_add(signal_handler, <span class='macro'>SIGINT<span class='macro_popup'>2</span></span>, signal_cb, manager);</td></tr> +<tr class="codeline" data-linenumber="746"><td class="num" id="LN746">746</td><td class="line"> mdm_signal_handler_set_fatal_func(signal_handler, shutdown_cb, manager);</td></tr> +<tr class="codeline" data-linenumber="747"><td class="num" id="LN747">747</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="748"><td class="num" id="LN748">748</td><td class="line"> <span class='keyword'>if</span> (override_autostart_dirs != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="749"><td class="num" id="LN749">749</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="750"><td class="num" id="LN750">750</td><td class="line"> load_override_apps(manager, override_autostart_dirs);</td></tr> +<tr class="codeline" data-linenumber="751"><td class="num" id="LN751">751</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="752"><td class="num" id="LN752">752</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="753"><td class="num" id="LN753">753</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="754"><td class="num" id="LN754">754</td><td class="line"> load_standard_apps(manager, <span class='macro'>GSM_DEFAULT_SESSION_KEY<span class='macro_popup'>"default-session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="755"><td class="num" id="LN755">755</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="756"><td class="num" id="LN756">756</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="757"><td class="num" id="LN757">757</td><td class="line"> gsm_xsmp_server_start(xsmp_server);</td></tr> +<tr class="codeline" data-linenumber="758"><td class="num" id="LN758">758</td><td class="line"> _gsm_manager_set_renderer (manager, gl_renderer);</td></tr> +<tr class="codeline" data-linenumber="759"><td class="num" id="LN759">759</td><td class="line"> gsm_manager_start(manager);</td></tr> +<tr class="codeline" data-linenumber="760"><td class="num" id="LN760">760</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="761"><td class="num" id="LN761">761</td><td class="line"> gtk_main();</td></tr> +<tr class="codeline" data-linenumber="762"><td class="num" id="LN762">762</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="763"><td class="num" id="LN763">763</td><td class="line"> <span class='keyword'>if</span> (xsmp_server != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="764"><td class="num" id="LN764">764</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="765"><td class="num" id="LN765">765</td><td class="line"> g_object_unref(xsmp_server);</td></tr> +<tr class="codeline" data-linenumber="766"><td class="num" id="LN766">766</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="767"><td class="num" id="LN767">767</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="768"><td class="num" id="LN768">768</td><td class="line"> <span class='keyword'>if</span> (manager != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="769"><td class="num" id="LN769">769</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="770"><td class="num" id="LN770">770</td><td class="line"> g_debug(<span class='string_literal'>"Unreffing manager"</span>);</td></tr> +<tr class="codeline" data-linenumber="771"><td class="num" id="LN771">771</td><td class="line"> g_object_unref(manager);</td></tr> +<tr class="codeline" data-linenumber="772"><td class="num" id="LN772">772</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="773"><td class="num" id="LN773">773</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="774"><td class="num" id="LN774">774</td><td class="line"> <span class='keyword'>if</span> (gl_renderer != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="775"><td class="num" id="LN775">775</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="776"><td class="num" id="LN776">776</td><td class="line"> g_free (gl_renderer);</td></tr> +<tr class="codeline" data-linenumber="777"><td class="num" id="LN777">777</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="778"><td class="num" id="LN778">778</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="779"><td class="num" id="LN779">779</td><td class="line"> <span class='keyword'>if</span> (client_store != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="780"><td class="num" id="LN780">780</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="781"><td class="num" id="LN781">781</td><td class="line"> g_object_unref(client_store);</td></tr> +<tr class="codeline" data-linenumber="782"><td class="num" id="LN782">782</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="783"><td class="num" id="LN783">783</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="784"><td class="num" id="LN784">784</td><td class="line"> <span class='keyword'>if</span> (debug_settings != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="785"><td class="num" id="LN785">785</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="786"><td class="num" id="LN786">786</td><td class="line"> g_object_unref(debug_settings);</td></tr> +<tr class="codeline" data-linenumber="787"><td class="num" id="LN787">787</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="788"><td class="num" id="LN788">788</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="789"><td class="num" id="LN789">789</td><td class="line"> msm_gnome_stop();</td></tr> +<tr class="codeline" data-linenumber="790"><td class="num" id="LN790">790</td><td class="line"> mdm_log_shutdown();</td></tr> +<tr class="codeline" data-linenumber="791"><td class="num" id="LN791">791</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="792"><td class="num" id="LN792">792</td><td class="line"> <span class='keyword'>return</span> 0;</td></tr> +<tr class="codeline" data-linenumber="793"><td class="num" id="LN793">793</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="794"><td class="num" id="LN794">794</td><td class="line"> </td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-5ded7d.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-5ded7d.html new file mode 100644 index 0000000..9385a55 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-5ded7d.html @@ -0,0 +1,967 @@ +<!doctype html> +<html> +<head> +<title>mate-session-save.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC This statement is never executed --> + +<!-- BUGTYPE Unreachable code --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/tools/mate-session-save.c --> + +<!-- FILENAME mate-session-save.c --> + +<!-- FUNCTIONNAME main --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 5ded7d467e1e022928181edf5355a46e --> + +<!-- BUGLINE 279 --> + +<!-- BUGCOLUMN 3 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>tools/mate-session-save.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 279, column 3</a><br />This statement is never executed</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mate-session-save.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/tools -fcoverage-compilation-dir=/rootdir/tools -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -D LOCALE_DIR="/usr/local/share/locale" -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c mate-session-save.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"279": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* save-session.c - Small program to talk to session manager.</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>Copyright (C) 1998 Tom Tromey</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>Copyright (C) 2008 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>This program is free software; you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>it under the terms of the GNU General Public License as published by</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>the Free Software Foundation; either version 2, or (at your option)</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>any later version.</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"><span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <config.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_SERVICE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_PATH_DBUS<span class='macro_popup'>"/org/gnome/SessionManager"</span></span> "/org/gnome/SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_INTERFACE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_SERVICE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span> "org.mate.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_PATH_DBUS_OLD<span class='macro_popup'>"/org/mate/SessionManager"</span></span> "/org/mate/SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_INTERFACE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span> "org.mate.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> GSM_LOGOUT_MODE_NORMAL = 0,</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> GSM_LOGOUT_MODE_NO_CONFIRMATION,</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> GSM_LOGOUT_MODE_FORCE</td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='comment'>/* True if killing. This is deprecated, but we keep it for compatibility</span></td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> <span class='comment'>* reasons. */</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> gboolean kill_session = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"><span class='comment'>/* The real options that should be used now. They are not ambiguous. */</span></td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='keyword'>static</span> gboolean logout = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"><span class='keyword'>static</span> gboolean force_logout = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"><span class='keyword'>static</span> gboolean logout_dialog = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"><span class='keyword'>static</span> gboolean shutdown_dialog = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"><span class='comment'>/* True if we should use dialog boxes */</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"><span class='keyword'>static</span> gboolean show_error_dialogs = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"><span class='comment'>/* True if we should do the requested action without confirmation */</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"><span class='keyword'>static</span> gboolean no_interaction = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>char</span>* session_name = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"><span class='keyword'>static</span> GOptionEntry options[] = {</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> {<span class='string_literal'>"logout"</span>, '\0', 0, G_OPTION_ARG_NONE, &logout, <span class='macro'>N_(<span class='string_literal'>"Log out"</span>)<span class='macro_popup'>("Log out")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> {<span class='string_literal'>"force-logout"</span>, '\0', 0, G_OPTION_ARG_NONE, &force_logout, <span class='macro'>N_(<span class='string_literal'>"Log out, ignoring any existing inhibitors"</span>)<span class='macro_popup'>("Log out, ignoring any existing inhibitors")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> {<span class='string_literal'>"logout-dialog"</span>, '\0', 0, G_OPTION_ARG_NONE, &logout_dialog, <span class='macro'>N_(<span class='string_literal'>"Show logout dialog"</span>)<span class='macro_popup'>("Show logout dialog")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> {<span class='string_literal'>"shutdown-dialog"</span>, '\0', 0, G_OPTION_ARG_NONE, &shutdown_dialog, <span class='macro'>N_(<span class='string_literal'>"Show shutdown dialog"</span>)<span class='macro_popup'>("Show shutdown dialog")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> {<span class='string_literal'>"gui"</span>, '\0', 0, G_OPTION_ARG_NONE, &show_error_dialogs, <span class='macro'>N_(<span class='string_literal'>"Use dialog boxes for errors"</span>)<span class='macro_popup'>("Use dialog boxes for errors")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> <span class='comment'>/* deprecated options */</span></td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> {<span class='string_literal'>"session-name"</span>, 's', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &session_name, <span class='macro'>N_(<span class='string_literal'>"Set the current session name"</span>)<span class='macro_popup'>("Set the current session name")</span></span>, <span class='macro'>N_(<span class='string_literal'>"NAME"</span>)<span class='macro_popup'>("NAME")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> {<span class='string_literal'>"kill"</span>, '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &kill_session, <span class='macro'>N_(<span class='string_literal'>"Kill session"</span>)<span class='macro_popup'>("Kill session")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> {<span class='string_literal'>"silent"</span>, '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &no_interaction, <span class='macro'>N_(<span class='string_literal'>"Do not require confirmation"</span>)<span class='macro_popup'>("Do not require confirmation")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> {<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, 0, G_OPTION_ARG_NONE, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>}</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> display_error(<span class='keyword'>const</span> <span class='keyword'>char</span>* message)</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> <span class='keyword'>if</span> (show_error_dialogs && !no_interaction)</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> GtkWidget* dialog = gtk_message_dialog_new(<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, <span class='string_literal'>"%s"</span>, message);</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> gtk_window_set_default_icon_name (<span class='string_literal'>"dialog-error"</span>);</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> gtk_dialog_run(<span class='macro'>GTK_DIALOG(dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> gtk_widget_destroy(dialog);</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> g_printerr(<span class='string_literal'>"%s\n"</span>, message);</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"><span class='keyword'>static</span> GDBusProxy* get_sm_proxy(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> GDBusProxy *sm_proxy = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> sm_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> G_DBUS_PROXY_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> <span class='macro'>GSM_SERVICE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> <span class='macro'>GSM_PATH_DBUS<span class='macro_popup'>"/org/gnome/SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='macro'>GSM_INTERFACE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> g_warning (<span class='string_literal'>"Couldn't create DBus proxy: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> <span class='comment'>/* Try the old name - for the case when we've just upgraded from 1.10</span></td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> <span class='comment'>* so the old m-s-m is currently running */</span></td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> sm_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> G_DBUS_PROXY_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> <span class='macro'>GSM_SERVICE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='macro'>GSM_PATH_DBUS_OLD<span class='macro_popup'>"/org/mate/SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> <span class='macro'>GSM_INTERFACE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> <span class='comment'>/* Okay, it wasn't the upgrade case, so now we can give up. */</span></td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> display_error (<span class='macro'>_(<span class='string_literal'>"Could not connect to the session manager"</span>)<span class='macro_popup'>gettext ("Could not connect to the session manager")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> do_logout(<span class='keyword'>unsigned</span> <span class='keyword'>int</span> mode)</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> GDBusProxy* sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> GVariant *ret;</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> sm_proxy = get_sm_proxy ();</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> ret = g_dbus_proxy_call_sync (sm_proxy, <span class='string_literal'>"Logout"</span>,</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> g_variant_new (<span class='string_literal'>"(u)"</span>, mode),</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> G_DBUS_CALL_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> <span class='keyword'>if</span> (ret == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> g_warning (<span class='string_literal'>"Failed to call logout: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> g_variant_unref (ret);</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> <span class='keyword'>if</span> (sm_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> g_object_unref (sm_proxy);</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> do_shutdown_dialog(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> GDBusProxy* sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> GVariant *ret;</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> sm_proxy = get_sm_proxy ();</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> ret = g_dbus_proxy_call_sync (sm_proxy, <span class='string_literal'>"Shutdown"</span>,</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> g_variant_new (<span class='string_literal'>"()"</span>),</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> G_DBUS_CALL_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='keyword'>if</span> (ret == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> g_warning (<span class='string_literal'>"Failed to call shutdown: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> g_variant_unref (ret);</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='keyword'>if</span> (sm_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> g_object_unref (sm_proxy);</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"><span class='keyword'>int</span> main(<span class='keyword'>int</span> argc, <span class='keyword'>char</span>* argv[])</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='keyword'>int</span> conflicting_options;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> <span class='comment'>/* Initialize the i18n stuff */</span></td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"><span class='directive'>#ifdef <span class='macro'>ENABLE_NLS<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> bindtextdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='macro'>LOCALE_DIR<span class='macro_popup'>"/usr/local/share/locale"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> bind_textdomain_codeset(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='string_literal'>"UTF-8"</span>);</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> textdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"><span class='directive'>#endif /* ENABLE_NLS */</span></td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='keyword'>if</span> (!gtk_init_with_args(&argc, &argv, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, options, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &error))</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> g_warning(<span class='string_literal'>"Unable to start: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> g_error_free(error);</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> exit(1);</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> conflicting_options = 0;</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (kill_session)</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> <span class='keyword'>if</span> (logout)</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='keyword'>if</span> (force_logout)</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> <span class='keyword'>if</span> (logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>if</span> (shutdown_dialog)</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> <span class='keyword'>if</span> (conflicting_options > 1)</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> display_error(<span class='macro'>_(<span class='string_literal'>"Program called with conflicting options"</span>)<span class='macro_popup'>gettext ("Program called with conflicting options")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> <span class='keyword'>if</span> (kill_session)</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>if</span> (no_interaction)</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> force_logout = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> logout_dialog = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> <span class='keyword'>if</span> (logout)</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> do_logout(GSM_LOGOUT_MODE_NO_CONFIRMATION);</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (force_logout)</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> do_logout(GSM_LOGOUT_MODE_FORCE);</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> <span class="mrange">do_logout</span>(GSM_LOGOUT_MODE_NORMAL);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:17ex">This statement is never executed</div></td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (shutdown_dialog)</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> do_shutdown_dialog();</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> <span class='keyword'>return</span> 0;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-615882.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-615882.html new file mode 100644 index 0000000..1b12190 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-615882.html @@ -0,0 +1,1217 @@ +<!doctype html> +<html> +<head> +<title>gsm-logout-dialog.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Value stored to 'ret' is never read --> + +<!-- BUGTYPE Dead assignment --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/mate-session/gsm-logout-dialog.c --> + +<!-- FILENAME gsm-logout-dialog.c --> + +<!-- FUNCTIONNAME gsm_logout_supports_system_hibernate --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 61588233ec0bd96102fe151367e294f9 --> + +<!-- BUGLINE 211 --> + +<!-- BUGCOLUMN 9 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>mate-session/gsm-logout-dialog.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 211, column 9</a><br />Value stored to 'ret' is never read</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name gsm-logout-dialog.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/mate-session -fcoverage-compilation-dir=/rootdir/mate-session -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -I /usr/include/uuid -I ../mate-submodules/libegg -D LOCALE_DIR="/usr/local/share/locale" -D DATA_DIR="/usr/local/share/mate-session" -D LIBEXECDIR="/usr/local/libexec" -D GTKBUILDER_DIR="/usr/local/share/mate-session-manager" -D I_KNOW_THE_DEVICEKIT_POWER_API_IS_SUBJECT_TO_CHANGE -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c gsm-logout-dialog.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"211": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2006 Vincent Untz</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Copyright (C) 2008 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* This program is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU General Public License as</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* published by the Free Software Foundation; either version 2 of the</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>* License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful, but</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>* General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>* 02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> <span class='comment'>* Authors:</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> <span class='comment'>* Vincent Untz <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <config.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include "gsm-logout-dialog.h"</span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"><span class='directive'>#include "gsm-systemd.h"</span></td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#include "gsm-consolekit.h"</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#include "mdm.h"</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"><span class='directive'>#include "gsm-util.h"</span></td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_ICON_LOGOUT<span class='macro_popup'>"system-log-out"</span></span> "system-log-out"</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_ICON_SHUTDOWN<span class='macro_popup'>"system-shutdown"</span></span> "system-shutdown"</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='directive'>#define <span class='macro'>SESSION_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span> "org.mate.session"</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_LOGOUT_TIMEOUT<span class='macro_popup'>"logout-timeout"</span></span> "logout-timeout"</span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"><span class='directive'>#define <span class='macro'>LOCKDOWN_SCHEMA<span class='macro_popup'>"org.mate.lockdown"</span></span> "org.mate.lockdown"</span></td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_USER_SWITCHING_DISABLE<span class='macro_popup'>"disable-user-switching"</span></span> "disable-user-switching"</span></td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> GSM_DIALOG_LOGOUT_TYPE_LOGOUT,</td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> GSM_DIALOG_LOGOUT_TYPE_SHUTDOWN</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line">} GsmDialogLogoutType;</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='keyword'>struct</span> _GsmLogoutDialog</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> GtkMessageDialog parent;</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> GsmDialogLogoutType type;</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> GtkWidget *progressbar;</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> <span class='keyword'>int</span> timeout;</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>int</span> timeout_id;</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>int</span> default_response;</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> GsmLogoutDialog *current_dialog = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> gsm_logout_dialog_set_timeout (GsmLogoutDialog *logout_dialog);</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> gsm_logout_dialog_destroy (GsmLogoutDialog *logout_dialog,</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> gpointer data);</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> gsm_logout_dialog_show (GsmLogoutDialog *logout_dialog,</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> gpointer data);</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> PROP_0,</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> PROP_MESSAGE_TYPE</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"><span class='macro'>G_DEFINE_TYPE (GsmLogoutDialog, gsm_logout_dialog, GTK_TYPE_MESSAGE_DIALOG)<span class='macro_popup'>static void gsm_logout_dialog_init (GsmLogoutDialog *self); static<br> void gsm_logout_dialog_class_init (GsmLogoutDialogClass *klass<br>); static GType gsm_logout_dialog_get_type_once (void); static<br> gpointer gsm_logout_dialog_parent_class = ((void*)0); static<br> gint GsmLogoutDialog_private_offset; static void gsm_logout_dialog_class_intern_init<br> (gpointer klass) { gsm_logout_dialog_parent_class = g_type_class_peek_parent<br> (klass); if (GsmLogoutDialog_private_offset != 0) g_type_class_adjust_private_offset<br> (klass, &GsmLogoutDialog_private_offset); gsm_logout_dialog_class_init<br> ((GsmLogoutDialogClass*) klass); } __attribute__ ((__unused__<br>)) static inline gpointer gsm_logout_dialog_get_instance_private<br> (GsmLogoutDialog *self) { return (((gpointer) ((guint8*) (self<br>) + (glong) (GsmLogoutDialog_private_offset)))); } GType gsm_logout_dialog_get_type<br> (void) { static GType static_g_define_type_id = 0; if ((__extension__<br> ({ _Static_assert (sizeof *(&static_g_define_type_id) ==<br> sizeof (gpointer), "Expression evaluates to false"); (void) (<br>0 ? (gpointer) * (&static_g_define_type_id) : ((void*)0))<br>; (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); __typeof__<br> (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__<br> ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id<br>); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)<br>; gapg_temp_newval; })) && g_once_init_enter_pointer (<br>&static_g_define_type_id)); })) ) { GType g_define_type_id<br> = gsm_logout_dialog_get_type_once (); (__extension__ ({ _Static_assert<br> (sizeof *(&static_g_define_type_id) == sizeof (gpointer)<br>, "Expression evaluates to false"); 0 ? (void) (*(&static_g_define_type_id<br>) = (g_define_type_id)) : (void) 0; g_once_init_leave_pointer<br> ((&static_g_define_type_id), (gpointer) (guintptr) (g_define_type_id<br>)); })) ; } return static_g_define_type_id; } __attribute__ (<br>(__noinline__)) static GType gsm_logout_dialog_get_type_once (<br>void) { GType g_define_type_id = g_type_register_static_simple<br> ((gtk_message_dialog_get_type ()), g_intern_static_string ("GsmLogoutDialog"<br>), sizeof (GsmLogoutDialogClass), (GClassInitFunc)(void (*)(void<br>)) gsm_logout_dialog_class_intern_init, sizeof (GsmLogoutDialog<br>), (GInstanceInitFunc)(void (*)(void)) gsm_logout_dialog_init<br>, (GTypeFlags) 0); { {{};} } return g_define_type_id; }</span></span>;</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line">gsm_logout_dialog_set_property (GObject *object,</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> <span class='keyword'>const</span> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> <span class='keyword'>case</span> PROP_MESSAGE_TYPE:</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "gsm-logout-dialog.c", 97, ("property"), _glib__property_id<br>, _glib__pspec->name, g_type_name ((((((GTypeClass*) (((GTypeInstance<br>*) (_glib__pspec))->g_class))->g_type)))), (g_type_name<br> ((((((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line">gsm_logout_dialog_get_property (GObject *object,</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='keyword'>case</span> PROP_MESSAGE_TYPE:</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> g_value_set_enum (value, GTK_MESSAGE_WARNING);</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "gsm-logout-dialog.c", 113, ("property"), _glib__property_id<br>, _glib__pspec->name, g_type_name ((((((GTypeClass*) (((GTypeInstance<br>*) (_glib__pspec))->g_class))->g_type)))), (g_type_name<br> ((((((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line">gsm_logout_dialog_class_init (GsmLogoutDialogClass *klass)</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> GObjectClass *gobject_class;</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> gobject_class = <span class='macro'>G_OBJECT_CLASS (klass)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((klass)), (((GType) ((20) << (2))))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> <span class='comment'>/* This is a workaround to avoid a stupid crash: libmateui</span></td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> <span class='comment'>* listens for the "show" signal on all GtkMessageDialog and</span></td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> <span class='comment'>* gets the "message-type" of the dialogs. We will crash when</span></td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> <span class='comment'>* it accesses this property if we don't override it since we</span></td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> <span class='comment'>* didn't define it. */</span></td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> gobject_class->set_property = gsm_logout_dialog_set_property;</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> gobject_class->get_property = gsm_logout_dialog_get_property;</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> g_object_class_override_property (gobject_class,</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> PROP_MESSAGE_TYPE,</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> <span class='string_literal'>"message-type"</span>);</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line">gsm_logout_dialog_init (GsmLogoutDialog *logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> logout_dialog->timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> logout_dialog->timeout = 0;</td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> logout_dialog->default_response = GTK_RESPONSE_CANCEL;</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> GtkStyleContext *context;</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> context = gtk_widget_get_style_context (<span class='macro'>GTK_WIDGET (logout_dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_widget_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> gtk_style_context_add_class (context, <span class='string_literal'>"logout-dialog"</span>);</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> gtk_window_set_skip_taskbar_hint (<span class='macro'>GTK_WINDOW (logout_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_window_get_type ()))))))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> gtk_window_set_keep_above (<span class='macro'>GTK_WINDOW (logout_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_window_get_type ()))))))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> gtk_window_stick (<span class='macro'>GTK_WINDOW (logout_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_window_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> logout_dialog->systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> logout_dialog->consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> <span class='macro'>g_signal_connect (logout_dialog,<span class='macro_popup'>g_signal_connect_data ((logout_dialog), ("destroy"), (((GCallback<br>) (gsm_logout_dialog_destroy))), (((void*)0)), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> <span class='string_literal'><span class='macro'>"destroy"</span>,<span class='macro_popup'>g_signal_connect_data ((logout_dialog), ("destroy"), (((GCallback<br>) (gsm_logout_dialog_destroy))), (((void*)0)), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> <span class='macro'>G_CALLBACK (gsm_logout_dialog_destroy),<span class='macro_popup'>g_signal_connect_data ((logout_dialog), ("destroy"), (((GCallback<br>) (gsm_logout_dialog_destroy))), (((void*)0)), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> <span class='macro'>NULL)<span class='macro_popup'>g_signal_connect_data ((logout_dialog), ("destroy"), (((GCallback<br>) (gsm_logout_dialog_destroy))), (((void*)0)), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> <span class='macro'>g_signal_connect (logout_dialog,<span class='macro_popup'>g_signal_connect_data ((logout_dialog), ("show"), (((GCallback<br>) (gsm_logout_dialog_show))), (((void*)0)), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> <span class='string_literal'><span class='macro'>"show"</span>,<span class='macro_popup'>g_signal_connect_data ((logout_dialog), ("show"), (((GCallback<br>) (gsm_logout_dialog_show))), (((void*)0)), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> <span class='macro'>G_CALLBACK (gsm_logout_dialog_show),<span class='macro_popup'>g_signal_connect_data ((logout_dialog), ("show"), (((GCallback<br>) (gsm_logout_dialog_show))), (((void*)0)), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> <span class='macro'>NULL)<span class='macro_popup'>g_signal_connect_data ((logout_dialog), ("show"), (((GCallback<br>) (gsm_logout_dialog_show))), (((void*)0)), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line">gsm_logout_dialog_destroy (GsmLogoutDialog *logout_dialog,</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> gpointer data)</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> <span class='keyword'>if</span> (logout_dialog->timeout_id != 0) {</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> g_source_remove (logout_dialog->timeout_id);</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> logout_dialog->timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='keyword'>if</span> (logout_dialog->systemd) {</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> g_object_unref (logout_dialog->systemd);</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> logout_dialog->systemd = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='keyword'>if</span> (logout_dialog->consolekit) {</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> g_object_unref (logout_dialog->consolekit);</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> logout_dialog->consolekit = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> current_dialog = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line">gsm_logout_supports_system_suspend (GsmLogoutDialog *logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> ret = gsm_systemd_can_suspend (logout_dialog->systemd);</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> ret = gsm_consolekit_can_suspend (logout_dialog->consolekit);</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line">gsm_logout_supports_system_hibernate (GsmLogoutDialog *logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> ret = <span class="mrange"><span class='macro'>FALSE<span class='macro_popup'>(0)</span></span></span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:9ex">Value stored to 'ret' is never read</div></td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> ret = gsm_systemd_can_hibernate (logout_dialog->systemd);</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> ret = gsm_consolekit_can_hibernate (logout_dialog->consolekit);</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line">gsm_logout_supports_switch_user (GsmLogoutDialog *logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> GSettings *settings;</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> gboolean ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> gboolean locked;</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> settings = g_settings_new (<span class='macro'>LOCKDOWN_SCHEMA<span class='macro_popup'>"org.mate.lockdown"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> locked = g_settings_get_boolean (settings, <span class='macro'>KEY_USER_SWITCHING_DISABLE<span class='macro_popup'>"disable-user-switching"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> g_object_unref (settings);</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> <span class='keyword'>if</span> (!locked) {</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> ret = gsm_systemd_can_switch_user (logout_dialog->systemd);</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> ret = gsm_consolekit_can_switch_user (logout_dialog->consolekit);</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line">gsm_logout_supports_reboot (GsmLogoutDialog *logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> ret = gsm_systemd_can_restart (logout_dialog->systemd);</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> ret = gsm_consolekit_can_restart (logout_dialog->consolekit);</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> <span class='keyword'>if</span> (!ret) {</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> ret = mdm_supports_logout_action (MDM_LOGOUT_ACTION_REBOOT);</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line">gsm_logout_supports_shutdown (GsmLogoutDialog *logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> ret = gsm_systemd_can_stop (logout_dialog->systemd);</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> ret = gsm_consolekit_can_stop (logout_dialog->consolekit);</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> <span class='keyword'>if</span> (!ret) {</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> ret = mdm_supports_logout_action (MDM_LOGOUT_ACTION_SHUTDOWN);</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line">gsm_logout_dialog_show (GsmLogoutDialog *logout_dialog, gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> gsm_logout_dialog_set_timeout (logout_dialog);</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line">gsm_logout_dialog_timeout (gpointer data)</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> GsmLogoutDialog *logout_dialog;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> <span class='keyword'>char</span> *seconds_warning;</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> <span class='keyword'>char</span> *secondary_text;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>char</span> *session_type = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>static</span> gboolean is_not_login;</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> logout_dialog = (GsmLogoutDialog *) data;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> <span class='keyword'>if</span> (!logout_dialog->timeout) {</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> gtk_dialog_response (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> logout_dialog->default_response);</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='keyword'>switch</span> (logout_dialog->type) {</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> <span class='keyword'>case</span> GSM_DIALOG_LOGOUT_TYPE_LOGOUT:</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> seconds_warning = ngettext (<span class='string_literal'>"You will be automatically logged "</span></td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> <span class='string_literal'>"out in %d second"</span>,</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> <span class='string_literal'>"You will be automatically logged "</span></td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> <span class='string_literal'>"out in %d seconds"</span>,</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> logout_dialog->timeout);</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> <span class='keyword'>case</span> GSM_DIALOG_LOGOUT_TYPE_SHUTDOWN:</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> seconds_warning = ngettext (<span class='string_literal'>"This system will be automatically "</span></td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> <span class='string_literal'>"shut down in %d second"</span>,</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> <span class='string_literal'>"This system will be automatically "</span></td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> <span class='string_literal'>"shut down in %d seconds"</span>,</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> logout_dialog->timeout);</td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-logout-dialog.c"<br>, 324, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> seconds_warning = g_strdup_printf (seconds_warning, logout_dialog->timeout);</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (session_type == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> session_type = gsm_systemd_get_current_session_type (systemd);</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> g_object_unref (systemd);</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> is_not_login = (g_strcmp0 (session_type, <span class='macro'>GSM_SYSTEMD_SESSION_TYPE_LOGIN_WINDOW<span class='macro_popup'>"greeter"</span></span>) != 0);</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> session_type = gsm_consolekit_get_current_session_type (consolekit);</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> g_object_unref (consolekit);</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> is_not_login = (g_strcmp0 (session_type, <span class='macro'>GSM_CONSOLEKIT_SESSION_TYPE_LOGIN_WINDOW<span class='macro_popup'>"LoginWindow"</span></span>) != 0);</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> <span class='keyword'>if</span> (is_not_login) {</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> <span class='keyword'>char</span> *name;</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> name = g_locale_to_utf8 (g_get_real_name (), -1, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='keyword'>if</span> (!name || name[0] == '\0' || strcmp (name, <span class='string_literal'>"Unknown"</span>) == 0) {</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> name = g_locale_to_utf8 (g_get_user_name (), -1 , <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='keyword'>if</span> (!name) {</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> name = <span class='macro'>g_strdup (g_get_user_name ())<span class='macro_popup'>g_strdup_inline (g_get_user_name ())</span></span>;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> secondary_text = g_strdup_printf (<span class='macro'>_(<span class='string_literal'>"You are currently logged in as \"%s\"."</span>)<span class='macro_popup'>gettext ("You are currently logged in as \"%s\".")</span></span>, name);</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> g_free (name);</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> secondary_text = <span class='macro'>g_strdup (seconds_warning)<span class='macro_popup'>g_strdup_inline (seconds_warning)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> gtk_progress_bar_set_fraction (<span class='macro'>GTK_PROGRESS_BAR (logout_dialog->progressbar)<span class='macro_popup'>((((GtkProgressBar*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog->progressbar)), ((gtk_progress_bar_get_type<br> ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> logout_dialog->timeout / 60.0);</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> gtk_progress_bar_set_text (<span class='macro'>GTK_PROGRESS_BAR (logout_dialog->progressbar)<span class='macro_popup'>((((GtkProgressBar*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog->progressbar)), ((gtk_progress_bar_get_type<br> ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> seconds_warning);</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> gtk_message_dialog_format_secondary_text (<span class='macro'>GTK_MESSAGE_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkMessageDialog*) (void *) g_type_check_instance_cast ((<br>GTypeInstance*) ((logout_dialog)), ((gtk_message_dialog_get_type<br> ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> secondary_text,</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> logout_dialog->timeout--;</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> g_free (secondary_text);</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> g_free (seconds_warning);</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line">gsm_logout_dialog_set_timeout (GsmLogoutDialog *logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> GSettings *settings;</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> settings = g_settings_new (<span class='macro'>SESSION_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> logout_dialog->timeout = g_settings_get_int (settings, <span class='macro'>KEY_LOGOUT_TIMEOUT<span class='macro_popup'>"logout-timeout"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> <span class='keyword'>if</span> (logout_dialog->timeout > 0) {</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> <span class='comment'>/* Sets the secondary text */</span></td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> gsm_logout_dialog_timeout (logout_dialog);</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> <span class='keyword'>if</span> (logout_dialog->timeout_id != 0) {</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> g_source_remove (logout_dialog->timeout_id);</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> logout_dialog->timeout_id = g_timeout_add (1000,</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> gsm_logout_dialog_timeout,</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> logout_dialog);</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> gtk_widget_hide (logout_dialog->progressbar);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> g_object_unref (settings);</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"><span class='keyword'>static</span> GtkWidget *</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line">gsm_get_dialog (GsmDialogLogoutType type,</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> GdkScreen *screen,</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> guint32 activate_time)</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> GsmLogoutDialog *logout_dialog;</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> GtkWidget *hbox;</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *primary_text;</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *icon_name;</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> <span class='keyword'>if</span> (current_dialog != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> gtk_widget_destroy (<span class='macro'>GTK_WIDGET (current_dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((current_dialog)), ((gtk_widget_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> logout_dialog = g_object_new (<span class='macro'>GSM_TYPE_LOGOUT_DIALOG<span class='macro_popup'>(gsm_logout_dialog_get_type ())</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> current_dialog = logout_dialog;</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> gtk_window_set_title (<span class='macro'>GTK_WINDOW (logout_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_window_get_type ()))))))</span></span>, <span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> logout_dialog->type = type;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> icon_name = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> primary_text = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> <span class='keyword'>switch</span> (type) {</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> <span class='keyword'>case</span> GSM_DIALOG_LOGOUT_TYPE_LOGOUT:</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> icon_name = <span class='macro'>GSM_ICON_LOGOUT<span class='macro_popup'>"system-log-out"</span></span>;</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> primary_text = <span class='macro'>_(<span class='string_literal'>"Log out of this system now?"</span>)<span class='macro_popup'>gettext ("Log out of this system now?")</span></span>;</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> logout_dialog->default_response = GSM_LOGOUT_RESPONSE_LOGOUT;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> <span class='keyword'>if</span> (gsm_logout_supports_switch_user (logout_dialog)) {</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Switch User"</span>)<span class='macro_popup'>gettext ("_Switch User")</span></span>, <span class='string_literal'>"system-users"</span>,</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> GSM_LOGOUT_RESPONSE_SWITCH_USER);</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Cancel"</span>)<span class='macro_popup'>gettext ("_Cancel")</span></span>, <span class='string_literal'>"process-stop"</span>,</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> GTK_RESPONSE_CANCEL);</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Log Out"</span>)<span class='macro_popup'>gettext ("_Log Out")</span></span>, <span class='string_literal'>"system-log-out"</span>,</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> GSM_LOGOUT_RESPONSE_LOGOUT);</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> <span class='keyword'>case</span> GSM_DIALOG_LOGOUT_TYPE_SHUTDOWN:</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> icon_name = <span class='macro'>GSM_ICON_SHUTDOWN<span class='macro_popup'>"system-shutdown"</span></span>;</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> primary_text = <span class='macro'>_(<span class='string_literal'>"Shut down this system now?"</span>)<span class='macro_popup'>gettext ("Shut down this system now?")</span></span>;</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> logout_dialog->default_response = GSM_LOGOUT_RESPONSE_SHUTDOWN;</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> <span class='keyword'>if</span> (gsm_logout_supports_system_suspend (logout_dialog)) {</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"S_uspend"</span>)<span class='macro_popup'>gettext ("S_uspend")</span></span>, <span class='string_literal'>"battery"</span>,</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> GSM_LOGOUT_RESPONSE_SLEEP);</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> <span class='keyword'>if</span> (gsm_logout_supports_system_hibernate (logout_dialog)) {</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Hibernate"</span>)<span class='macro_popup'>gettext ("_Hibernate")</span></span>, <span class='string_literal'>"drive-harddisk"</span>,</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> GSM_LOGOUT_RESPONSE_HIBERNATE);</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> <span class='keyword'>if</span> (gsm_logout_supports_reboot (logout_dialog)) {</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Restart"</span>)<span class='macro_popup'>gettext ("_Restart")</span></span>, <span class='string_literal'>"view-refresh"</span>,</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> GSM_LOGOUT_RESPONSE_REBOOT);</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Cancel"</span>)<span class='macro_popup'>gettext ("_Cancel")</span></span>, <span class='string_literal'>"process-stop"</span>,</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> GTK_RESPONSE_CANCEL);</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> <span class='keyword'>if</span> (gsm_logout_supports_shutdown (logout_dialog)) {</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Shut Down"</span>)<span class='macro_popup'>gettext ("_Shut Down")</span></span>, <span class='string_literal'>"system-shutdown"</span>,</td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> GSM_LOGOUT_RESPONSE_SHUTDOWN);</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-logout-dialog.c"<br>, 496, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> logout_dialog->progressbar = gtk_progress_bar_new ();</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> gtk_progress_bar_set_show_text (<span class='macro'>GTK_PROGRESS_BAR (logout_dialog->progressbar)<span class='macro_popup'>((((GtkProgressBar*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog->progressbar)), ((gtk_progress_bar_get_type<br> ()))))))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> gtk_progress_bar_set_fraction (<span class='macro'>GTK_PROGRESS_BAR (logout_dialog->progressbar)<span class='macro_popup'>((((GtkProgressBar*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog->progressbar)), ((gtk_progress_bar_get_type<br> ()))))))</span></span>, 1.0);</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> gtk_box_pack_start (<span class='macro'>GTK_BOX (hbox)<span class='macro_popup'>((((GtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((hbox)), ((gtk_box_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> logout_dialog->progressbar,</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, 12);</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> gtk_widget_show_all (hbox);</td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> gtk_container_add (<span class='macro'>GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (logout_dialog)))<span class='macro_popup'>((((GtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_dialog_get_content_area (((((GtkDialog*) (void *) g_type_check_instance_cast<br> ((GTypeInstance*) ((logout_dialog)), ((gtk_dialog_get_type (<br>)))))))))), ((gtk_container_get_type ()))))))</span></span>, hbox);</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> gtk_window_set_icon_name (<span class='macro'>GTK_WINDOW (logout_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_window_get_type ()))))))</span></span>, icon_name);</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> gtk_window_set_position (<span class='macro'>GTK_WINDOW (logout_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_window_get_type ()))))))</span></span>, GTK_WIN_POS_CENTER_ALWAYS);</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> gtk_message_dialog_set_markup (<span class='macro'>GTK_MESSAGE_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkMessageDialog*) (void *) g_type_check_instance_cast ((<br>GTypeInstance*) ((logout_dialog)), ((gtk_message_dialog_get_type<br> ()))))))</span></span>, primary_text);</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> gtk_dialog_set_default_response (<span class='macro'>GTK_DIALOG (logout_dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> logout_dialog->default_response);</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> gtk_window_set_screen (<span class='macro'>GTK_WINDOW (logout_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_window_get_type ()))))))</span></span>, screen);</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>GTK_WIDGET (logout_dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line">GtkWidget *</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line">gsm_get_shutdown_dialog (GdkScreen *screen,</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> guint32 activate_time)</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> <span class='keyword'>return</span> gsm_get_dialog (GSM_DIALOG_LOGOUT_TYPE_SHUTDOWN,</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> screen,</td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> activate_time);</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line">GtkWidget *</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line">gsm_get_logout_dialog (GdkScreen *screen,</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> guint32 activate_time)</td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> <span class='keyword'>return</span> gsm_get_dialog (GSM_DIALOG_LOGOUT_TYPE_LOGOUT,</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> screen,</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> activate_time);</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-7c304e.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-7c304e.html new file mode 100644 index 0000000..5e0553b --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-7c304e.html @@ -0,0 +1,1309 @@ +<!doctype html> +<html> +<head> +<title>gsm-app-dialog.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Array access (from variable 'argv') results in an undefined pointer dereference --> + +<!-- BUGTYPE Dereference of undefined pointer value --> + +<!-- BUGCATEGORY Logic error --> + +<!-- BUGFILE /rootdir/capplet/gsm-app-dialog.c --> + +<!-- FILENAME gsm-app-dialog.c --> + +<!-- FUNCTIONNAME gsm_app_dialog_run --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 7c304e5588d0fc1be3a8a5529515ef9a --> + +<!-- BUGLINE 576 --> + +<!-- BUGCOLUMN 32 --> + +<!-- BUGPATHLENGTH 10 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>capplet/gsm-app-dialog.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 576, column 32</a><br />Array access (from variable 'argv') results in an undefined pointer dereference</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name gsm-app-dialog.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/capplet -fcoverage-compilation-dir=/rootdir/capplet -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/freetype2 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/harfbuzz -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -I ../mate-session -D LOCALE_DIR="/usr/local/share/locale" -D GTKBUILDER_DIR="/usr/local/share/mate-session-manager" -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c gsm-app-dialog.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"68": 1, "366": 1, "367": 1, "368": 1, "369": 1, "370": 1, "373": 1, "374": 1, "375": 1, "376": 1, "377": 1, "380": 1, "381": 1, "382": 1, "383": 1, "384": 1, "387": 1, "388": 1, "389": 1, "390": 1, "391": 1, "514": 1, "515": 1, "516": 1, "517": 1, "518": 1, "519": 1, "520": 1, "521": 1, "523": 1, "525": 1, "526": 1, "527": 1, "528": 1, "529": 1, "530": 1, "531": 1, "532": 1, "533": 1, "535": 1, "536": 1, "537": 1, "538": 1, "540": 1, "541": 1, "543": 1, "544": 1, "555": 1, "575": 1, "576": 1}, "77693": {"31": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + <path class="arrow" id="arrow0"/> + <path class="arrow" id="arrow1"/> + <path class="arrow" id="arrow2"/> + <path class="arrow" id="arrow3"/> + <path class="arrow" id="arrow4"/> + <path class="arrow" id="arrow5"/> + <path class="arrow" id="arrow6"/> + <path class="arrow" id="arrow7"/> + <path class="arrow" id="arrow8"/> + <path class="arrow" id="arrow9"/> + <path class="arrow" id="arrow10"/> + <path class="arrow" id="arrow11"/> + <path class="arrow" id="arrow12"/> + <path class="arrow" id="arrow13"/> + <path class="arrow" id="arrow14"/> + <path class="arrow" id="arrow15"/> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 16,14,13,12,10,8,5,3,2,0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2008 William Jon McCann <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This program is free software; you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* it under the terms of the GNU General Public License as published by</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* the Free Software Foundation; either version 2 of the License, or</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"><span class='directive'>#include "config.h"</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <glib.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include "gsm-util.h"</span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='directive'>#include "gsm-app-dialog.h"</span></td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#define <span class='macro'>GTKBUILDER_FILE<span class='macro_popup'>"session-properties.ui"</span></span> "session-properties.ui"</span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#define <span class='macro'>CAPPLET_NAME_ENTRY_WIDGET_NAME<span class='macro_popup'>"session_properties_name_entry"</span></span> "session_properties_name_entry"</span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#define <span class='macro'>CAPPLET_COMMAND_ENTRY_WIDGET_NAME<span class='macro_popup'>"session_properties_command_entry"</span></span> "session_properties_command_entry"</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#define <span class='macro'>CAPPLET_COMMENT_ENTRY_WIDGET_NAME<span class='macro_popup'>"session_properties_comment_entry"</span></span> "session_properties_comment_entry"</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"><span class='directive'>#define <span class='macro'>CAPPLET_DELAY_SPIN_WIDGET_NAME<span class='macro_popup'>"session_properties_delay_spin"</span></span> "session_properties_delay_spin"</span></td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"><span class='directive'>#define <span class='macro'>CAPPLET_BROWSE_WIDGET_NAME<span class='macro_popup'>"session_properties_browse_button"</span></span> "session_properties_browse_button"</span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#ifdef <span class='macro'>__GNUC__<span class='macro_popup'>4</span></span></span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"><span class='directive'>#define <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> __attribute__ ((unused))</span></td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='directive'>#else</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"><span class='directive'>#define <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span></span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"><span class='keyword'>struct</span> _GsmAppDialog</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"> GtkDialog parent;</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> GtkWidget *name_entry;</td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> GtkWidget *command_entry;</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> GtkWidget *comment_entry;</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> GtkWidget *delay_spin;</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> GtkWidget *browse_button;</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> <span class='keyword'>char</span> *name;</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> <span class='keyword'>char</span> *command;</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> <span class='keyword'>char</span> *comment;</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> guint delay;</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> PROP_0,</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> PROP_NAME,</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> PROP_COMMAND,</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> PROP_COMMENT,</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> PROP_DELAY</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"><span class='macro'>G_DEFINE_TYPE (GsmAppDialog, gsm_app_dialog, GTK_TYPE_DIALOG)<span class='macro_popup'>static void gsm_app_dialog_init (GsmAppDialog *self); static void<br> gsm_app_dialog_class_init (GsmAppDialogClass *klass); static<br> GType gsm_app_dialog_get_type_once (void); static gpointer gsm_app_dialog_parent_class<br> = ((void*)0); static gint GsmAppDialog_private_offset; static<br> void gsm_app_dialog_class_intern_init (gpointer klass) { gsm_app_dialog_parent_class<br> = g_type_class_peek_parent (klass); if (GsmAppDialog_private_offset<br> != 0) g_type_class_adjust_private_offset (klass, &GsmAppDialog_private_offset<br>); gsm_app_dialog_class_init ((GsmAppDialogClass*) klass); } __attribute__<br> ((__unused__)) static inline gpointer gsm_app_dialog_get_instance_private<br> (GsmAppDialog *self) { return (((gpointer) ((guint8*) (self)<br> + (glong) (GsmAppDialog_private_offset)))); } GType gsm_app_dialog_get_type<br> (void) { static GType static_g_define_type_id = 0; if ((__extension__<br> ({ _Static_assert (sizeof *(&static_g_define_type_id) ==<br> sizeof (gpointer), "Expression evaluates to false"); (void) (<br>0 ? (gpointer) * (&static_g_define_type_id) : ((void*)0))<br>; (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); __typeof__<br> (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__<br> ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id<br>); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)<br>; gapg_temp_newval; })) && g_once_init_enter_pointer (<br>&static_g_define_type_id)); })) ) { GType g_define_type_id<br> = gsm_app_dialog_get_type_once (); (__extension__ ({ _Static_assert<br> (sizeof *(&static_g_define_type_id) == sizeof (gpointer)<br>, "Expression evaluates to false"); 0 ? (void) (*(&static_g_define_type_id<br>) = (g_define_type_id)) : (void) 0; g_once_init_leave_pointer<br> ((&static_g_define_type_id), (gpointer) (guintptr) (g_define_type_id<br>)); })) ; } return static_g_define_type_id; } __attribute__ (<br>(__noinline__)) static GType gsm_app_dialog_get_type_once (void<br>) { GType g_define_type_id = g_type_register_static_simple ((<br>gtk_dialog_get_type ()), g_intern_static_string ("GsmAppDialog"<br>), sizeof (GsmAppDialogClass), (GClassInitFunc)(void (*)(void<br>)) gsm_app_dialog_class_intern_init, sizeof (GsmAppDialog), (<br>GInstanceInitFunc)(void (*)(void)) gsm_app_dialog_init, (GTypeFlags<br>) 0); { {{};} } return g_define_type_id; }</span></span></td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>char</span> *</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">make_exec_uri (<span class='keyword'>const</span> <span class='keyword'>char</span> *exec)</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> GString *str;</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *c;</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> <span class='keyword'>if</span> (exec == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>g_strdup (<span class='string_literal'>""</span>)<span class='macro_popup'>g_strdup_inline ("")</span></span>;</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> <span class='keyword'>if</span> (strchr (exec, ' ') == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>g_strdup (exec)<span class='macro_popup'>g_strdup_inline (exec)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> str = g_string_new_len (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, strlen (exec));</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> str = <span class='macro'>g_string_append_c (str, '"')<span class='macro_popup'>g_string_append_c_inline (str, '"')</span></span>;</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> <span class='keyword'>for</span> (c = exec; *c != '\0'; c++) {</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> <span class='comment'>/* FIXME: GKeyFile will add an additional backslach so we'll</span></td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> <span class='comment'>* end up with toto\\" instead of toto\"</span></td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> <span class='comment'>* We could use g_key_file_set_value(), but then we don't</span></td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> <span class='comment'>* benefit from the other escaping that glib is doing...</span></td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> <span class='keyword'>if</span> (*c == '"') {</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> str = <span class='macro'>g_string_append (str, <span class='string_literal'>"\\\""</span>)<span class='macro_popup'>(__builtin_constant_p ("\\\"") ? __extension__ ({ const char *<br> const __val = ("\\\""); g_string_append_len_inline (str, __val<br>, (__val != ((void*)0)) ? (gssize) strlen (((__val) + !(__val<br>))) : (gssize) -1); }) : g_string_append_len_inline (str, "\\\""<br>, (gssize) -1))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> str = <span class='macro'>g_string_append_c (str, *c)<span class='macro_popup'>g_string_append_c_inline (str, *c)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> str = <span class='macro'>g_string_append_c (str, '"')<span class='macro_popup'>g_string_append_c_inline (str, '"')</span></span>;</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>g_string_free (str, FALSE)<span class='macro_popup'>(__builtin_constant_p ((0)) ? (((0)) ? (g_string_free) ((str)<br>, ((0))) : g_string_free_and_steal (str)) : (g_string_free) (<br>(str), ((0))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line">on_browse_button_clicked (GtkWidget *widget,</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> GtkWidget *chooser;</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='keyword'>int</span> response;</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> chooser = gtk_file_chooser_dialog_new (<span class='string_literal'>""</span>,</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> <span class='macro'>GTK_WINDOW (dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> GTK_FILE_CHOOSER_ACTION_OPEN,</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> <span class='string_literal'>"gtk-cancel"</span>,</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> GTK_RESPONSE_CANCEL,</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> <span class='string_literal'>"gtk-open"</span>,</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> GTK_RESPONSE_ACCEPT,</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> gtk_window_set_transient_for (<span class='macro'>GTK_WINDOW (chooser)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((chooser)), ((gtk_window_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> <span class='macro'>GTK_WINDOW (dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> gtk_window_set_destroy_with_parent (<span class='macro'>GTK_WINDOW (chooser)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((chooser)), ((gtk_window_get_type ()))))))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> gtk_window_set_title (<span class='macro'>GTK_WINDOW (chooser)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((chooser)), ((gtk_window_get_type ()))))))</span></span>, <span class='macro'>_(<span class='string_literal'>"Select Command"</span>)<span class='macro_popup'>gettext ("Select Command")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> gtk_widget_show (chooser);</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> response = gtk_dialog_run (<span class='macro'>GTK_DIALOG (chooser)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((chooser)), ((gtk_dialog_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> <span class='keyword'>if</span> (response == GTK_RESPONSE_ACCEPT) {</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>char</span> *text;</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> <span class='keyword'>char</span> *uri;</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> text = gtk_file_chooser_get_filename (<span class='macro'>GTK_FILE_CHOOSER (chooser)<span class='macro_popup'>((((GtkFileChooser*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((chooser)), ((gtk_file_chooser_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> uri = make_exec_uri (text);</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> g_free (text);</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> gtk_entry_set_text (<span class='macro'>GTK_ENTRY (dialog->command_entry)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog->command_entry)), ((gtk_entry_get_type ())))))<br>)</span></span>, uri);</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> g_free (uri);</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> gtk_widget_destroy (chooser);</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line">on_entry_activate (GtkEntry *entry,</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> gtk_dialog_response (<span class='macro'>GTK_DIALOG (dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>, GTK_RESPONSE_OK);</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line">on_spin_output (GtkSpinButton *spin, GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> GtkAdjustment *adjustment;</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> gchar *text;</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> <span class='keyword'>int</span> value;</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> adjustment = gtk_spin_button_get_adjustment (spin);</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> value = gtk_adjustment_get_value (adjustment);</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> dialog->delay = value;</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> <span class='keyword'>if</span> (value == 1)</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> text = g_strdup_printf (<span class='string_literal'>"%d %s"</span>, value, <span class='macro'>_(<span class='string_literal'>"second"</span>)<span class='macro_popup'>gettext ("second")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (value > 1)</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> text = g_strdup_printf (<span class='string_literal'>"%d %s"</span>, value, <span class='macro'>_(<span class='string_literal'>"seconds"</span>)<span class='macro_popup'>gettext ("seconds")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> text = g_strdup_printf (<span class='string_literal'>"%d"</span>, value);</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> gtk_entry_set_text (<span class='macro'>GTK_ENTRY (spin)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((spin)), ((gtk_entry_get_type ()))))))</span></span>, text);</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> g_free (text);</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line">setup_dialog (GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> GtkWidget *content_area;</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> GtkWidget *widget;</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> GtkBuilder *xml;</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> xml = gtk_builder_new ();</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"><span class='directive'>#ifdef <span class='macro'>ENABLE_NLS<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> gtk_builder_set_translation_domain (xml, <span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"><span class='directive'>#endif /* ENABLE_NLS */</span></td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='keyword'>if</span> (!gtk_builder_add_from_file (xml,</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='macro'>GTKBUILDER_DIR<span class='macro_popup'>"/usr/local/share/mate-session-manager"</span></span> <span class='string_literal'>"/"</span> <span class='macro'>GTKBUILDER_FILE<span class='macro_popup'>"session-properties.ui"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> &error)) {</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='keyword'>if</span> (error) {</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> g_warning (<span class='string_literal'>"Could not load capplet UI file: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> g_warning (<span class='string_literal'>"Could not load capplet UI file."</span>);</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> content_area = gtk_dialog_get_content_area (<span class='macro'>GTK_DIALOG (dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> widget = <span class='macro'>GTK_WIDGET (gtk_builder_get_object (xml, <span class='string_literal'>"main-table"</span>))<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object (xml, "main-table"))), ((gtk_widget_get_type<br> ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> gtk_container_add (<span class='macro'>GTK_CONTAINER (content_area)<span class='macro_popup'>((((GtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((content_area)), ((gtk_container_get_type ()))))))</span></span>, widget);</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> gtk_container_set_border_width (<span class='macro'>GTK_CONTAINER (dialog)<span class='macro_popup'>((((GtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_container_get_type ()))))))</span></span>, 6);</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> gtk_window_set_icon_name (<span class='macro'>GTK_WINDOW (dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>, <span class='string_literal'>"mate-session-properties"</span>);</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> g_object_set (dialog,</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> <span class='string_literal'>"resizable"</span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Cancel"</span>)<span class='macro_popup'>gettext ("_Cancel")</span></span>, <span class='string_literal'>"process-stop"</span>,</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> GTK_RESPONSE_CANCEL);</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='keyword'>if</span> (dialog->name == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span></td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> && dialog->command == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span></td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> && dialog->comment == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> gtk_window_set_title (<span class='macro'>GTK_WINDOW (dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>, <span class='macro'>_(<span class='string_literal'>"Add Startup Program"</span>)<span class='macro_popup'>gettext ("Add Startup Program")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Add"</span>)<span class='macro_popup'>gettext ("_Add")</span></span>, <span class='string_literal'>"list-add"</span>,</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> GTK_RESPONSE_OK);</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> gtk_window_set_title (<span class='macro'>GTK_WINDOW (dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>, <span class='macro'>_(<span class='string_literal'>"Edit Startup Program"</span>)<span class='macro_popup'>gettext ("Edit Startup Program")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> gsm_util_dialog_add_button (<span class='macro'>GTK_DIALOG (dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"_Save"</span>)<span class='macro_popup'>gettext ("_Save")</span></span>, <span class='string_literal'>"document-save"</span>,</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> GTK_RESPONSE_OK);</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> dialog->name_entry = <span class='macro'>GTK_WIDGET (gtk_builder_get_object (xml, CAPPLET_NAME_ENTRY_WIDGET_NAME))<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object (xml, "session_properties_name_entry"<br>))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> <span class='macro'>g_signal_connect (dialog->name_entry,<span class='macro_popup'>g_signal_connect_data ((dialog->name_entry), ("activate"),<br> (((GCallback) (on_entry_activate))), (dialog), ((void*)0), (<br>GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='string_literal'><span class='macro'>"activate"</span>,<span class='macro_popup'>g_signal_connect_data ((dialog->name_entry), ("activate"),<br> (((GCallback) (on_entry_activate))), (dialog), ((void*)0), (<br>GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> <span class='macro'>G_CALLBACK (on_entry_activate),<span class='macro_popup'>g_signal_connect_data ((dialog->name_entry), ("activate"),<br> (((GCallback) (on_entry_activate))), (dialog), ((void*)0), (<br>GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> <span class='macro'>dialog)<span class='macro_popup'>g_signal_connect_data ((dialog->name_entry), ("activate"),<br> (((GCallback) (on_entry_activate))), (dialog), ((void*)0), (<br>GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> <span class='keyword'>if</span> (dialog->name != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> gtk_entry_set_text (<span class='macro'>GTK_ENTRY (dialog->name_entry)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog->name_entry)), ((gtk_entry_get_type ()))))))</span></span>, dialog->name);</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> dialog->browse_button = <span class='macro'>GTK_WIDGET (gtk_builder_get_object (xml, CAPPLET_BROWSE_WIDGET_NAME))<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object (xml, "session_properties_browse_button"<br>))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> <span class='macro'>g_signal_connect (dialog->browse_button,<span class='macro_popup'>g_signal_connect_data ((dialog->browse_button), ("clicked"<br>), (((GCallback) (on_browse_button_clicked))), (dialog), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> <span class='string_literal'><span class='macro'>"clicked"</span>,<span class='macro_popup'>g_signal_connect_data ((dialog->browse_button), ("clicked"<br>), (((GCallback) (on_browse_button_clicked))), (dialog), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='macro'>G_CALLBACK (on_browse_button_clicked),<span class='macro_popup'>g_signal_connect_data ((dialog->browse_button), ("clicked"<br>), (((GCallback) (on_browse_button_clicked))), (dialog), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> <span class='macro'>dialog)<span class='macro_popup'>g_signal_connect_data ((dialog->browse_button), ("clicked"<br>), (((GCallback) (on_browse_button_clicked))), (dialog), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> dialog->command_entry = <span class='macro'>GTK_WIDGET (gtk_builder_get_object (xml, CAPPLET_COMMAND_ENTRY_WIDGET_NAME))<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object (xml, "session_properties_command_entry"<br>))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> <span class='macro'>g_signal_connect (dialog->command_entry,<span class='macro_popup'>g_signal_connect_data ((dialog->command_entry), ("activate"<br>), (((GCallback) (on_entry_activate))), (dialog), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> <span class='string_literal'><span class='macro'>"activate"</span>,<span class='macro_popup'>g_signal_connect_data ((dialog->command_entry), ("activate"<br>), (((GCallback) (on_entry_activate))), (dialog), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='macro'>G_CALLBACK (on_entry_activate),<span class='macro_popup'>g_signal_connect_data ((dialog->command_entry), ("activate"<br>), (((GCallback) (on_entry_activate))), (dialog), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> <span class='macro'>dialog)<span class='macro_popup'>g_signal_connect_data ((dialog->command_entry), ("activate"<br>), (((GCallback) (on_entry_activate))), (dialog), ((void*)0),<br> (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> <span class='keyword'>if</span> (dialog->command != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> gtk_entry_set_text (<span class='macro'>GTK_ENTRY (dialog->command_entry)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog->command_entry)), ((gtk_entry_get_type ())))))<br>)</span></span>, dialog->command);</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> dialog->comment_entry = <span class='macro'>GTK_WIDGET (gtk_builder_get_object (xml, CAPPLET_COMMENT_ENTRY_WIDGET_NAME))<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object (xml, "session_properties_comment_entry"<br>))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> <span class='macro'>g_signal_connect (dialog->comment_entry,<span class='macro_popup'>g_signal_connect_data ((dialog->comment_entry), ("activate"<br>), (((GCallback) (on_entry_activate))), (dialog), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='string_literal'><span class='macro'>"activate"</span>,<span class='macro_popup'>g_signal_connect_data ((dialog->comment_entry), ("activate"<br>), (((GCallback) (on_entry_activate))), (dialog), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> <span class='macro'>G_CALLBACK (on_entry_activate),<span class='macro_popup'>g_signal_connect_data ((dialog->comment_entry), ("activate"<br>), (((GCallback) (on_entry_activate))), (dialog), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> <span class='macro'>dialog)<span class='macro_popup'>g_signal_connect_data ((dialog->comment_entry), ("activate"<br>), (((GCallback) (on_entry_activate))), (dialog), ((void*)0),<br> (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> <span class='keyword'>if</span> (dialog->comment != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> gtk_entry_set_text (<span class='macro'>GTK_ENTRY (dialog->comment_entry)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog->comment_entry)), ((gtk_entry_get_type ())))))<br>)</span></span>, dialog->comment);</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> dialog->delay_spin = <span class='macro'>GTK_WIDGET(gtk_builder_get_object (xml, CAPPLET_DELAY_SPIN_WIDGET_NAME))<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((gtk_builder_get_object (xml, "session_properties_delay_spin"<br>))), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> <span class='macro'>g_signal_connect (dialog->delay_spin,<span class='macro_popup'>g_signal_connect_data ((dialog->delay_spin), ("output"), (<br>((GCallback) (on_spin_output))), (dialog), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> <span class='string_literal'><span class='macro'>"output"</span>,<span class='macro_popup'>g_signal_connect_data ((dialog->delay_spin), ("output"), (<br>((GCallback) (on_spin_output))), (dialog), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='macro'>G_CALLBACK (on_spin_output),<span class='macro_popup'>g_signal_connect_data ((dialog->delay_spin), ("output"), (<br>((GCallback) (on_spin_output))), (dialog), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> <span class='macro'>dialog)<span class='macro_popup'>g_signal_connect_data ((dialog->delay_spin), ("output"), (<br>((GCallback) (on_spin_output))), (dialog), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> <span class='keyword'>if</span> (dialog->delay > 0) {</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> GtkAdjustment *adjustment;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> adjustment = gtk_spin_button_get_adjustment (<span class='macro'>GTK_SPIN_BUTTON(dialog->delay_spin)<span class='macro_popup'>((((GtkSpinButton*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog->delay_spin)), ((gtk_spin_button_get_type ()))<br>))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> gtk_adjustment_set_value (adjustment, (gdouble) dialog->delay);</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> <span class='keyword'>if</span> (xml != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> g_object_unref (xml);</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"><span class='keyword'>static</span> GObject *</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line">gsm_app_dialog_constructor (GType type,</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> guint n_construct_app,</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> GObjectConstructParam *construct_app)</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> GsmAppDialog *dialog;</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> dialog = GSM_APP_DIALOG (<span class='macro'>G_OBJECT_CLASS (gsm_app_dialog_parent_class)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((gsm_app_dialog_parent_class)), (((GType) ((20) << (<br>2))))))))</span></span>->constructor (type,</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> n_construct_app,</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> construct_app));</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> setup_dialog (dialog);</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>G_OBJECT (dialog)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), (((GType) ((20) << (2))))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line">gsm_app_dialog_dispose (GObject *object)</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> GsmAppDialog *dialog;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> <span class='macro'>g_return_if_fail (object != NULL)<span class='macro_popup'>do { if ((object != ((void*)0))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "object != NULL")<br>; return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_APP_DIALOG (object))<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (object))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (object)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> dialog = GSM_APP_DIALOG (object);</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> g_free (dialog->name);</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> dialog->name = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> g_free (dialog->command);</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> dialog->command = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> g_free (dialog->comment);</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> dialog->comment = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> <span class='macro'>G_OBJECT_CLASS (gsm_app_dialog_parent_class)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((gsm_app_dialog_parent_class)), (((GType) ((20) << (<br>2))))))))</span></span>->dispose (object);</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line">gsm_app_dialog_set_name (GsmAppDialog *dialog,</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *name)</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_APP_DIALOG (dialog))<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (dialog))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (dialog)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> g_free (dialog->name);</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> dialog->name = <span class='macro'>g_strdup (name)<span class='macro_popup'>g_strdup_inline (name)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> g_object_notify (<span class='macro'>G_OBJECT (dialog)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"name"</span>);</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line">gsm_app_dialog_set_command (GsmAppDialog *dialog,</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *name)</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_APP_DIALOG (dialog))<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (dialog))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (dialog)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> g_free (dialog->command);</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> dialog->command = <span class='macro'>g_strdup (name)<span class='macro_popup'>g_strdup_inline (name)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> g_object_notify (<span class='macro'>G_OBJECT (dialog)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"command"</span>);</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line">gsm_app_dialog_set_comment (GsmAppDialog *dialog,</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *name)</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_APP_DIALOG (dialog))<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (dialog))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (dialog)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> g_free (dialog->comment);</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> dialog->comment = <span class='macro'>g_strdup (name)<span class='macro_popup'>g_strdup_inline (name)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> g_object_notify (<span class='macro'>G_OBJECT (dialog)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"comment"</span>);</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line">gsm_app_dialog_set_delay (GsmAppDialog *dialog,</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> guint delay)</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_APP_DIALOG (dialog))<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (dialog))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (dialog)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> dialog->delay = delay;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> g_object_notify (<span class='macro'>G_OBJECT (dialog)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"delay"</span>);</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"><span class='keyword'>const</span> <span class='keyword'>char</span> *</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line">gsm_app_dialog_get_name (GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_APP_DIALOG (dialog), NULL)<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (dialog))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (dialog)"<br>); return (((void*)0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> <span class='keyword'>return</span> gtk_entry_get_text (<span class='macro'>GTK_ENTRY (dialog->name_entry)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog->name_entry)), ((gtk_entry_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"><span class='keyword'>const</span> <span class='keyword'>char</span> *</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line">gsm_app_dialog_get_command (GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_APP_DIALOG (dialog), NULL)<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (dialog))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (dialog)"<br>); return (((void*)0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>return</span> gtk_entry_get_text (<span class='macro'>GTK_ENTRY (dialog->command_entry)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog->command_entry)), ((gtk_entry_get_type ())))))<br>)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"><span class='keyword'>const</span> <span class='keyword'>char</span> *</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line">gsm_app_dialog_get_comment (GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_APP_DIALOG (dialog), NULL)<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (dialog))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (dialog)"<br>); return (((void*)0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> <span class='keyword'>return</span> gtk_entry_get_text (<span class='macro'>GTK_ENTRY (dialog->comment_entry)<span class='macro_popup'>((((GtkEntry*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog->comment_entry)), ((gtk_entry_get_type ())))))<br>)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line">guint</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line">gsm_app_dialog_get_delay (GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_APP_DIALOG (dialog), 0)<span class='macro_popup'>do { if ((GSM_IS_APP_DIALOG (dialog))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_APP_DIALOG (dialog)"<br>); return (0); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>return</span> dialog->delay;</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line">gsm_app_dialog_set_property (GObject *object,</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> <span class='keyword'>const</span> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> GsmAppDialog *dialog = GSM_APP_DIALOG (object);</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> <span class='keyword'>case</span> PROP_NAME:</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> gsm_app_dialog_set_name (dialog, g_value_get_string (value));</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>case</span> PROP_COMMAND:</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> gsm_app_dialog_set_command (dialog, g_value_get_string (value));</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> <span class='keyword'>case</span> PROP_COMMENT:</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> gsm_app_dialog_set_comment (dialog, g_value_get_string (value));</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> <span class='keyword'>case</span> PROP_DELAY:</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> gsm_app_dialog_set_delay (dialog, g_value_get_uint (value));</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "gsm-app-dialog.c", 416, ("property"), _glib__property_id, _glib__pspec<br>->name, g_type_name ((((((GTypeClass*) (((GTypeInstance*) (<br>_glib__pspec))->g_class))->g_type)))), (g_type_name (((<br>(((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line">gsm_app_dialog_get_property (GObject *object,</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> GsmAppDialog *dialog = GSM_APP_DIALOG (object);</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> <span class='keyword'>case</span> PROP_NAME:</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> g_value_set_string (value, dialog->name);</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> <span class='keyword'>case</span> PROP_COMMAND:</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> g_value_set_string (value, dialog->command);</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> <span class='keyword'>case</span> PROP_COMMENT:</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> g_value_set_string (value, dialog->comment);</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> <span class='keyword'>case</span> PROP_DELAY:</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> g_value_set_uint (value, dialog->delay);</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "gsm-app-dialog.c", 443, ("property"), _glib__property_id, _glib__pspec<br>->name, g_type_name ((((((GTypeClass*) (((GTypeInstance*) (<br>_glib__pspec))->g_class))->g_type)))), (g_type_name (((<br>(((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line">gsm_app_dialog_class_init (GsmAppDialogClass *klass)</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> GObjectClass *object_class = <span class='macro'>G_OBJECT_CLASS (klass)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((klass)), (((GType) ((20) << (2))))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> object_class->get_property = gsm_app_dialog_get_property;</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> object_class->set_property = gsm_app_dialog_set_property;</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> object_class->constructor = gsm_app_dialog_constructor;</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> object_class->dispose = gsm_app_dialog_dispose;</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> g_object_class_install_property (object_class,</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> PROP_NAME,</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> g_param_spec_string (<span class='string_literal'>"name"</span>,</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> <span class='string_literal'>"name"</span>,</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> <span class='string_literal'>"name"</span>,</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> G_PARAM_READWRITE | G_PARAM_CONSTRUCT));</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> g_object_class_install_property (object_class,</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> PROP_COMMAND,</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> g_param_spec_string (<span class='string_literal'>"command"</span>,</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='string_literal'>"command"</span>,</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='string_literal'>"command"</span>,</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> G_PARAM_READWRITE | G_PARAM_CONSTRUCT));</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> g_object_class_install_property (object_class,</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> PROP_COMMENT,</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> g_param_spec_string (<span class='string_literal'>"comment"</span>,</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> <span class='string_literal'>"comment"</span>,</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> <span class='string_literal'>"comment"</span>,</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> G_PARAM_READWRITE | G_PARAM_CONSTRUCT));</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> g_object_class_install_property (object_class,</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> PROP_DELAY,</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> g_param_spec_uint (<span class='string_literal'>"delay"</span>,</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='string_literal'>"delay"</span>,</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> <span class='string_literal'>"delay"</span>,</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> 0,</td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> 100,</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> 0,</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> G_PARAM_READWRITE | G_PARAM_CONSTRUCT));</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line">gsm_app_dialog_init (GsmAppDialog *dialog)</td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line">GtkWidget *</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line">gsm_app_dialog_new (<span class='keyword'>const</span> <span class='keyword'>char</span> *name,</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *command,</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *comment,</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> guint delay)</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> GObject *object;</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> object = g_object_new (<span class='macro'>GSM_TYPE_APP_DIALOG<span class='macro_popup'>(gsm_app_dialog_get_type ())</span></span>,</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='string_literal'>"name"</span>, name,</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> <span class='string_literal'>"command"</span>, command,</td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> <span class='string_literal'>"comment"</span>, comment,</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> <span class='string_literal'>"delay"</span>, delay,</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>GTK_WIDGET (object)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((object)), ((gtk_widget_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line">gsm_app_dialog_run (GsmAppDialog *dialog,</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> <span class='keyword'>char</span> **name_p,</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> <span class='keyword'>char</span> **command_p,</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> <span class='keyword'>char</span> **comment_p,</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> guint *delay_p)</td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> <span id="start15">gboolean</span> retval;</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> retval = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> <span id="start14"><span id="end15"><span class='keyword'>while</span></span></span> (<span id="start13"><span class="mrange"><span id="end14">gtk_dialog_run</span></span> (<span class='macro'>GTK_DIALOG (dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>) == GTK_RESPONSE_OK</span>) {</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path1" class="msg msgEvent" style="margin-left:16ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">1</div></td><td>Assuming the condition is true</td><td><div class="PathNav"><a href="#Path2" title="Next event (2)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path2" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">2</div></td><td><div class="PathNav"><a href="#Path1" title="Previous event (1)">←</a></div></td><td>Loop condition is true. Entering loop body</td><td><div class="PathNav"><a href="#Path3" title="Next event (3)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> <span id="start12"><span id="end13"><span class='keyword'>const</span></span></span> <span class='keyword'>char</span> *name;</td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *exec;</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *comment;</td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> guint delay;</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *error_msg;</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> <span id="start11"><span class="mrange"><span id="end12"><span class='keyword'>char</span></span></span> **argv</span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path3" class="msg msgEvent" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">3</div></td><td><div class="PathNav"><a href="#Path2" title="Previous event (2)">←</a></div></td><td>'argv' declared without an initial value</td><td><div class="PathNav"><a href="#Path4" title="Next event (4)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> <span class='keyword'>int</span> argc;</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> name = gsm_app_dialog_get_name (GSM_APP_DIALOG (dialog));</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> exec = gsm_app_dialog_get_command (GSM_APP_DIALOG (dialog));</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> comment = gsm_app_dialog_get_comment (GSM_APP_DIALOG (dialog));</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> delay = gsm_app_dialog_get_delay (GSM_APP_DIALOG (dialog));</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> error_msg = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> <span id="start10"><span id="end11"><span class='keyword'>if</span></span></span> (<span id="start9"><span class="mrange"><span id="end10">gsm_util_text_is_blank</span></span> (exec)</span>) {</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path4" class="msg msgEvent" style="margin-left:21ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">4</div></td><td><div class="PathNav"><a href="#Path3" title="Previous event (3)">←</a></div></td><td>Assuming the condition is true</td><td><div class="PathNav"><a href="#Path5" title="Next event (5)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path5" class="msg msgControl" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">5</div></td><td><div class="PathNav"><a href="#Path4" title="Previous event (4)">←</a></div></td><td>Taking true branch</td><td><div class="PathNav"><a href="#Path6" title="Next event (6)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> <span id="start6"><span id="end7"><span id="start8"><span id="end9">error_msg</span></span></span></span> = <span id="start7"><span id="end8"><span class='macro'>_</span></span>(<span class='string_literal'>"The startup command cannot be empty"</span>)<span class='macro_popup'>gettext ("The startup command cannot be empty")</span></span>;</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> <span class='keyword'>if</span> (!g_shell_parse_argv (exec, &argc, &argv, &error)) {</td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> error_msg = error->message;</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> error_msg = <span class='macro'>_(<span class='string_literal'>"The startup command is not valid"</span>)<span class='macro_popup'>gettext ("The startup command is not valid")</span></span>;</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> <span id="start5"><span id="end6"><span class='keyword'>if</span></span></span> (<span id="start4"><span class="mrange"><span id="end5">error_msg</span></span> != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span></span>) {</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path6" class="msg msgEvent" style="margin-left:21ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">6</div></td><td><div class="PathNav"><a href="#Path5" title="Previous event (5)">←</a></div></td><td>Assuming 'error_msg' is equal to NULL</td><td><div class="PathNav"><a href="#Path7" title="Next event (7)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path7" class="msg msgControl" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">7</div></td><td><div class="PathNav"><a href="#Path6" title="Previous event (6)">←</a></div></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path8" title="Next event (8)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> GtkWidget *msgbox;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> msgbox = gtk_message_dialog_new (<span class='macro'>GTK_WINDOW (dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> GTK_DIALOG_MODAL,</td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> GTK_MESSAGE_ERROR,</td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> GTK_BUTTONS_CLOSE,</td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='string_literal'>"%s"</span>, error_msg);</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> gtk_dialog_run (<span class='macro'>GTK_DIALOG (msgbox)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((msgbox)), ((gtk_dialog_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> gtk_widget_destroy (msgbox);</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> <span id="start3"><span id="end4"><span class='keyword'>if</span></span></span> (<span id="start1"><span class="mrange"><span id="end2">gsm_util_text_is_blank</span></span> (<span id="start2"><span id="end3">name</span></span>)</span>) {</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path8" class="msg msgEvent" style="margin-left:21ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">8</div></td><td><div class="PathNav"><a href="#Path7" title="Previous event (7)">←</a></div></td><td>Assuming the condition is true</td><td><div class="PathNav"><a href="#Path9" title="Next event (9)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path9" class="msg msgControl" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">9</div></td><td><div class="PathNav"><a href="#Path8" title="Previous event (8)">←</a></div></td><td>Taking true branch</td><td><div class="PathNav"><a href="#EndPath" title="Next event (10)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> <span id="start0"><span id="end1">name</span></span> = <span class="mrange"><span id="end0">argv</span></span>[0];</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:32ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">10</div></td><td><div class="PathNav"><a href="#Path9" title="Previous event (9)">←</a></div></td><td>Array access (from variable 'argv') results in an undefined pointer dereference</td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>if</span> (name_p) {</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> *name_p = <span class='macro'>g_strdup (name)<span class='macro_popup'>g_strdup_inline (name)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> g_strfreev (argv);</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> <span class='keyword'>if</span> (command_p) {</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> *command_p = <span class='macro'>g_strdup (exec)<span class='macro_popup'>g_strdup_inline (exec)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> <span class='keyword'>if</span> (comment_p) {</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> *comment_p = <span class='macro'>g_strdup (comment)<span class='macro_popup'>g_strdup_inline (comment)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> <span class='keyword'>if</span> (delay_p) {</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> *delay_p = delay;</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> retval = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> gtk_widget_destroy (<span class='macro'>GTK_WIDGET (dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_widget_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> <span class='keyword'>return</span> retval;</td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-836628.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-836628.html new file mode 100644 index 0000000..f4618e0 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-836628.html @@ -0,0 +1,1229 @@ +<!doctype html> +<html> +<head> +<title>mdm-signal-handler.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC This statement is never executed --> + +<!-- BUGTYPE Unreachable code --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/mate-session/mdm-signal-handler.c --> + +<!-- FILENAME mdm-signal-handler.c --> + +<!-- FUNCTIONNAME signal_handler --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 836628b7e882dc352b25411f70f22bc9 --> + +<!-- BUGLINE 279 --> + +<!-- BUGCOLUMN 4 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>mate-session/mdm-signal-handler.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 279, column 4</a><br />This statement is never executed</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mdm-signal-handler.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/mate-session -fcoverage-compilation-dir=/rootdir/mate-session -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -I /usr/include/uuid -I ../mate-submodules/libegg -D LOCALE_DIR="/usr/local/share/locale" -D DATA_DIR="/usr/local/share/mate-session" -D LIBEXECDIR="/usr/local/libexec" -D GTKBUILDER_DIR="/usr/local/share/mate-session-manager" -D I_KNOW_THE_DEVICEKIT_POWER_API_IS_SUBJECT_TO_CHANGE -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c mdm-signal-handler.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"279": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2006 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Copyright (C) 2007 William Jon McCann <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* This program is free software; you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* it under the terms of the GNU General Public License as published by</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* the Free Software Foundation; either version 2 of the License, or</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>* (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>* GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include "config.h"</span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include <fcntl.h></span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='directive'>#include <signal.h></span></td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#if <span class='macro'>HAVE_EXECINFO_H<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> <span class='directive'>#include <execinfo.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#include <syslog.h></span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#include <sys/wait.h></span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#include <sys/stat.h></span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"><span class='directive'>#include <glib.h></span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#include <glib/gstdio.h></span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"><span class='directive'>#include <glib-object.h></span></td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"><span class='directive'>#include "mdm-signal-handler.h"</span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"><span class='directive'>#ifdef <span class='macro'>__GNUC__<span class='macro_popup'>4</span></span></span></td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"><span class='directive'>#define <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> __attribute__ ((unused))</span></td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"><span class='directive'>#else</span></td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='directive'>#define <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span></span></td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span> {</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> <span class='keyword'>int</span> signal_number;</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> MdmSignalHandlerFunc func;</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> gpointer data;</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> guint id;</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line">} CallbackData;</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"><span class='keyword'>struct</span> _MdmSignalHandler {</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> GObject parent_instance;</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> GHashTable* lookup;</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> GHashTable* id_lookup;</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> GHashTable* action_lookup;</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> guint next_id;</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> GDestroyNotify fatal_func;</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> gpointer fatal_data;</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> mdm_signal_handler_finalize (GObject* object);</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> gpointer signal_handler_object = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span> signal_pipes[2];</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span> signals_blocked = 0;</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"><span class='keyword'>static</span> sigset_t signals_block_mask;</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"><span class='keyword'>static</span> sigset_t signals_oldmask;</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"><span class='macro'>G_DEFINE_TYPE(MdmSignalHandler, mdm_signal_handler, G_TYPE_OBJECT)<span class='macro_popup'>static void mdm_signal_handler_init (MdmSignalHandler *self);<br> static void mdm_signal_handler_class_init (MdmSignalHandlerClass<br> *klass); static GType mdm_signal_handler_get_type_once (void<br>); static gpointer mdm_signal_handler_parent_class = ((void*)<br>0); static gint MdmSignalHandler_private_offset; static void mdm_signal_handler_class_intern_init<br> (gpointer klass) { mdm_signal_handler_parent_class = g_type_class_peek_parent<br> (klass); if (MdmSignalHandler_private_offset != 0) g_type_class_adjust_private_offset<br> (klass, &MdmSignalHandler_private_offset); mdm_signal_handler_class_init<br> ((MdmSignalHandlerClass*) klass); } __attribute__ ((__unused__<br>)) static inline gpointer mdm_signal_handler_get_instance_private<br> (MdmSignalHandler *self) { return (((gpointer) ((guint8*) (self<br>) + (glong) (MdmSignalHandler_private_offset)))); } GType mdm_signal_handler_get_type<br> (void) { static GType static_g_define_type_id = 0; if ((__extension__<br> ({ _Static_assert (sizeof *(&static_g_define_type_id) ==<br> sizeof (gpointer), "Expression evaluates to false"); (void) (<br>0 ? (gpointer) * (&static_g_define_type_id) : ((void*)0))<br>; (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); __typeof__<br> (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__<br> ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id<br>); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)<br>; gapg_temp_newval; })) && g_once_init_enter_pointer (<br>&static_g_define_type_id)); })) ) { GType g_define_type_id<br> = mdm_signal_handler_get_type_once (); (__extension__ ({ _Static_assert<br> (sizeof *(&static_g_define_type_id) == sizeof (gpointer)<br>, "Expression evaluates to false"); 0 ? (void) (*(&static_g_define_type_id<br>) = (g_define_type_id)) : (void) 0; g_once_init_leave_pointer<br> ((&static_g_define_type_id), (gpointer) (guintptr) (g_define_type_id<br>)); })) ; } return static_g_define_type_id; } __attribute__ (<br>(__noinline__)) static GType mdm_signal_handler_get_type_once<br> (void) { GType g_define_type_id = g_type_register_static_simple<br> (((GType) ((20) << (2))), g_intern_static_string ("MdmSignalHandler"<br>), sizeof (MdmSignalHandlerClass), (GClassInitFunc)(void (*)(<br>void)) mdm_signal_handler_class_intern_init, sizeof (MdmSignalHandler<br>), (GInstanceInitFunc)(void (*)(void)) mdm_signal_handler_init<br>, (GTypeFlags) 0); { {{};} } return g_define_type_id; }</span></span></td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> block_signals_push(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> signals_blocked++;</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> <span class='keyword'>if</span> (signals_blocked == 1)</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='comment'>/* Set signal mask */</span></td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> sigemptyset(&signals_block_mask);</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> sigfillset(&signals_block_mask);</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> sigprocmask(<span class='macro'>SIG_BLOCK<span class='macro_popup'>0</span></span>, &signals_block_mask, &signals_oldmask);</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> block_signals_pop(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> signals_blocked--;</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='keyword'>if</span> (signals_blocked == 0)</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> <span class='comment'>/* Set signal mask */</span></td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> sigprocmask(<span class='macro'>SIG_SETMASK<span class='macro_popup'>2</span></span>, &signals_oldmask, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"><span class='keyword'>static</span> gboolean signal_io_watch(GIOChannel* ioc, GIOCondition condition, MdmSignalHandler* handler)</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> <span class='keyword'>char</span> buf[256];</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> gboolean is_fatal;</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> gsize bytes_read;</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> block_signals_push();</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> g_io_channel_read_chars(ioc, buf, <span class='keyword'>sizeof</span>(buf), &bytes_read, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> is_fatal = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < bytes_read; i++)</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> <span class='keyword'>int</span> signum;</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> GSList* handlers;</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> GSList* l;</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> signum = (gint32) buf[i];</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> g_debug(<span class='string_literal'>"MdmSignalHandler: handling signal %d"</span>, signum);</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> handlers = g_hash_table_lookup(handler->lookup, <span class='macro'>GINT_TO_POINTER(signum)<span class='macro_popup'>((gpointer) (glong) (signum))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> g_debug(<span class='string_literal'>"MdmSignalHandler: Found %u callbacks"</span>, g_slist_length(handlers));</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> <span class='keyword'>for</span> (l = handlers; l != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; l = l->next)</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> CallbackData* data;</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> data = g_hash_table_lookup(handler->id_lookup, l->data);</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> <span class='keyword'>if</span> (data != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> <span class='keyword'>if</span> (data->func != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> g_debug(<span class='string_literal'>"MdmSignalHandler: running %d handler: %p"</span>, signum, data->func);</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> res = data->func(signum, data->data);</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='keyword'>if</span> (!res)</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> is_fatal = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> block_signals_pop();</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> <span class='keyword'>if</span> (is_fatal)</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> <span class='keyword'>if</span> (handler->fatal_func != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> g_debug(<span class='string_literal'>"MdmSignalHandler: Caught termination signal - calling fatal func"</span>);</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> handler->fatal_func(handler->fatal_data);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> g_debug(<span class='string_literal'>"MdmSignalHandler: Caught termination signal - exiting"</span>);</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> exit (1);</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> g_debug(<span class='string_literal'>"MdmSignalHandler: Done handling signals"</span>);</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> fallback_get_backtrace(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> <span class='directive'>#if <span class='macro'>HAVE_EXECINFO_H<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>void</span>* frames[64];</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> size_t size;</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='keyword'>char</span>** strings;</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> size_t i;</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> size = backtrace(frames, <span class='macro'>G_N_ELEMENTS(frames)<span class='macro_popup'>(sizeof (frames) / sizeof ((frames)[0]))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='keyword'>if</span> ((strings = backtrace_symbols(frames, size)))</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> syslog(<span class='macro'>LOG_CRIT<span class='macro_popup'>2</span></span>, <span class='string_literal'>"******************* START ********************************"</span>);</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < size; i++)</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> syslog(<span class='macro'>LOG_CRIT<span class='macro_popup'>2</span></span>, <span class='string_literal'>"Frame %zd: %s"</span>, i, strings[i]);</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> free(strings);</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> syslog(<span class='macro'>LOG_CRIT<span class='macro_popup'>2</span></span>, <span class='string_literal'>"******************* END **********************************"</span>);</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> <span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> g_warning (<span class='string_literal'>"MDM crashed, but symbols couldn't be retrieved."</span>);</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='directive'>#if <span class='macro'>HAVE_EXECINFO_H<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> <span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"><span class='keyword'>static</span> gboolean crashlogger_get_backtrace(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> gboolean success = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> <span class='keyword'>int</span> pid;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> pid = fork();</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>if</span> (pid > 0)</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='comment'>/* Wait for the child to finish */</span></td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> <span class='keyword'>int</span> estatus;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='keyword'>if</span> (waitpid(pid, &estatus, 0) != -1)</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> <span class='comment'>/* Only succeed if the crashlogger succeeded */</span></td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>WIFEXITED(estatus)<span class='macro_popup'>(((estatus) & 0x7f) == 0)</span></span> && (<span class='macro'>WEXITSTATUS(estatus)<span class='macro_popup'>(((estatus) & 0xff00) >> 8)</span></span> == 0))</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> success = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (pid == 0)</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> <span class='comment'>/* Child process */</span></td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> execl(<span class='macro'>LIBEXECDIR<span class='macro_popup'>"/usr/local/libexec"</span></span> <span class='string_literal'>"/mdm-crash-logger"</span>, <span class='macro'>LIBEXECDIR<span class='macro_popup'>"/usr/local/libexec"</span></span> <span class='string_literal'>"/mdm-crash-logger"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> <span class='keyword'>return</span> success;</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> mdm_signal_handler_backtrace(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> <span class='keyword'>struct</span> stat s;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> gboolean fallback = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='comment'>/* Try to use gdb via mdm-crash-logger if it exists, since</span></td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> <span class='comment'>* we get much better information out of it. Otherwise</span></td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> <span class='comment'>* fall back to execinfo.</span></td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>g_stat<span class='macro_popup'>stat</span></span>(<span class='macro'>LIBEXECDIR<span class='macro_popup'>"/usr/local/libexec"</span></span> <span class='string_literal'>"/mdm-crash-logger"</span>, &s) == 0)</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> fallback = crashlogger_get_backtrace() ? <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span> : <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> <span class='keyword'>if</span> (fallback)</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> fallback_get_backtrace();</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> signal_handler(<span class='keyword'>int</span> signo)</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>int</span> in_fatal = 0;</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>int</span> <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> ignore;</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> guchar signo_byte = signo;</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> <span class='comment'>/* avoid loops */</span></td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> <span class='keyword'>if</span> (in_fatal > 0)</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> ++in_fatal;</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> <span class='keyword'>switch</span> (signo)</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGSEGV<span class='macro_popup'>11</span></span>:</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGBUS<span class='macro_popup'>7</span></span>:</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGILL<span class='macro_popup'>4</span></span>:</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGABRT<span class='macro_popup'>6</span></span>:</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGTRAP<span class='macro_popup'>5</span></span>:</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> mdm_signal_handler_backtrace();</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> exit(1);</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> <span class="mrange"><span class='keyword'>break</span></span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:25ex">This statement is never executed</div></td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGFPE<span class='macro_popup'>8</span></span>:</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGPIPE<span class='macro_popup'>13</span></span>:</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> <span class='comment'>/* let the fatal signals interrupt us */</span></td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> --in_fatal;</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> mdm_signal_handler_backtrace();</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> ignore = write(signal_pipes [1], &signo_byte, 1);</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> --in_fatal;</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> ignore = write(signal_pipes [1], &signo_byte, 1);</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> catch_signal(MdmSignalHandler *handler, <span class='keyword'>int</span> signal_number)</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> <span class='keyword'>struct</span> sigaction action;</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> <span class='keyword'>struct</span> sigaction* old_action;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> g_debug(<span class='string_literal'>"MdmSignalHandler: Registering for %d signals"</span>, signal_number);</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> action.<span class='macro'>sa_handler<span class='macro_popup'>__sigaction_handler.sa_handler</span></span> = signal_handler;</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> sigemptyset(&action.sa_mask);</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> action.sa_flags = 0;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> old_action = <span class='macro'>g_new0(<span class='keyword'>struct</span> sigaction, 1)<span class='macro_popup'>((struct sigaction *) g_malloc0_n ((1), sizeof (struct sigaction<br>)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> sigaction(signal_number, &action, old_action);</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> g_hash_table_insert(handler->action_lookup, <span class='macro'>GINT_TO_POINTER(signal_number)<span class='macro_popup'>((gpointer) (glong) (signal_number))</span></span>, old_action);</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> uncatch_signal(MdmSignalHandler* handler, <span class='keyword'>int</span> signal_number)</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='keyword'>struct</span> sigaction* old_action;</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> g_debug(<span class='string_literal'>"MdmSignalHandler: Unregistering for %d signals"</span>, signal_number);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> old_action = g_hash_table_lookup(handler->action_lookup, <span class='macro'>GINT_TO_POINTER(signal_number)<span class='macro_popup'>((gpointer) (glong) (signal_number))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> g_hash_table_remove(handler->action_lookup, <span class='macro'>GINT_TO_POINTER(signal_number)<span class='macro_popup'>((gpointer) (glong) (signal_number))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> sigaction(signal_number, old_action, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> g_free(old_action);</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line">guint mdm_signal_handler_add(MdmSignalHandler* handler, <span class='keyword'>int</span> signal_number, MdmSignalHandlerFunc callback, gpointer data)</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> CallbackData* cdata;</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> GSList* list;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='macro'>g_return_val_if_fail(MDM_IS_SIGNAL_HANDLER(handler), 0)<span class='macro_popup'>do { if ((MDM_IS_SIGNAL_HANDLER(handler))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "MDM_IS_SIGNAL_HANDLER(handler)"<br>); return (0); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> cdata = <span class='macro'>g_new0(CallbackData, 1)<span class='macro_popup'>((CallbackData *) g_malloc0_n ((1), sizeof (CallbackData)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> cdata->signal_number = signal_number;</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> cdata->func = callback;</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> cdata->data = data;</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> cdata->id = handler->next_id++;</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> g_debug(<span class='string_literal'>"MdmSignalHandler: Adding handler %u: signum=%d %p"</span>, cdata->id, cdata->signal_number, cdata->func);</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> <span class='keyword'>if</span> (g_hash_table_lookup(handler->action_lookup, <span class='macro'>GINT_TO_POINTER(signal_number)<span class='macro_popup'>((gpointer) (glong) (signal_number))</span></span>) == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> catch_signal(handler, signal_number);</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='comment'>/* ID lookup owns the CallbackData */</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> g_hash_table_insert(handler->id_lookup, <span class='macro'>GUINT_TO_POINTER(cdata->id)<span class='macro_popup'>((gpointer) (gulong) (cdata->id))</span></span>, cdata);</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> list = g_hash_table_lookup(handler->lookup, <span class='macro'>GINT_TO_POINTER(signal_number)<span class='macro_popup'>((gpointer) (glong) (signal_number))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> list = g_slist_prepend(list, <span class='macro'>GUINT_TO_POINTER (cdata->id)<span class='macro_popup'>((gpointer) (gulong) (cdata->id))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> g_hash_table_insert(handler->lookup, <span class='macro'>GINT_TO_POINTER(signal_number)<span class='macro_popup'>((gpointer) (glong) (signal_number))</span></span>, list);</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='keyword'>return</span> cdata->id;</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"><span class='keyword'>void</span> mdm_signal_handler_add_fatal(MdmSignalHandler* handler)</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='macro'>g_return_if_fail(MDM_IS_SIGNAL_HANDLER(handler))<span class='macro_popup'>do { if ((MDM_IS_SIGNAL_HANDLER(handler))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "MDM_IS_SIGNAL_HANDLER(handler)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> mdm_signal_handler_add(handler, <span class='macro'>SIGILL<span class='macro_popup'>4</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> mdm_signal_handler_add(handler, <span class='macro'>SIGBUS<span class='macro_popup'>7</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> mdm_signal_handler_add(handler, <span class='macro'>SIGSEGV<span class='macro_popup'>11</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> mdm_signal_handler_add(handler, <span class='macro'>SIGABRT<span class='macro_popup'>6</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> mdm_signal_handler_add(handler, <span class='macro'>SIGTRAP<span class='macro_popup'>5</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> callback_data_free(CallbackData* d)</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> g_free(d);</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> mdm_signal_handler_remove_and_free_data(MdmSignalHandler* handler, CallbackData* cdata)</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> GSList* list;</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='macro'>g_return_if_fail(MDM_IS_SIGNAL_HANDLER(handler))<span class='macro_popup'>do { if ((MDM_IS_SIGNAL_HANDLER(handler))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "MDM_IS_SIGNAL_HANDLER(handler)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> list = g_hash_table_lookup(handler->lookup, <span class='macro'>GINT_TO_POINTER(cdata->signal_number)<span class='macro_popup'>((gpointer) (glong) (cdata->signal_number))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> list = g_slist_remove_all(list, <span class='macro'>GUINT_TO_POINTER(cdata->id)<span class='macro_popup'>((gpointer) (gulong) (cdata->id))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> <span class='keyword'>if</span> (list == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> uncatch_signal(handler, cdata->signal_number);</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> g_debug(<span class='string_literal'>"MdmSignalHandler: Removing handler %u: signum=%d %p"</span>, cdata->signal_number, cdata->id, cdata->func);</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> <span class='comment'>/* put changed list back in */</span></td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> g_hash_table_insert(handler->lookup, <span class='macro'>GINT_TO_POINTER(cdata->signal_number)<span class='macro_popup'>((gpointer) (glong) (cdata->signal_number))</span></span>, list);</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> g_hash_table_remove(handler->id_lookup, <span class='macro'>GUINT_TO_POINTER(cdata->id)<span class='macro_popup'>((gpointer) (gulong) (cdata->id))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"><span class='keyword'>void</span> mdm_signal_handler_remove(MdmSignalHandler* handler, guint id)</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> CallbackData* found;</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> <span class='macro'>g_return_if_fail(MDM_IS_SIGNAL_HANDLER(handler))<span class='macro_popup'>do { if ((MDM_IS_SIGNAL_HANDLER(handler))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "MDM_IS_SIGNAL_HANDLER(handler)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> found = g_hash_table_lookup(handler->id_lookup, <span class='macro'>GUINT_TO_POINTER(id)<span class='macro_popup'>((gpointer) (gulong) (id))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> <span class='keyword'>if</span> (found != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> mdm_signal_handler_remove_and_free_data(handler, found);</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> found = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"><span class='keyword'>static</span> CallbackData* find_callback_data_by_func(MdmSignalHandler* handler, guint signal_number, MdmSignalHandlerFunc callback, gpointer data)</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> GSList* list;</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> GSList* l;</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> CallbackData* found;</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> found = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> list = g_hash_table_lookup(handler->lookup, <span class='macro'>GINT_TO_POINTER(signal_number)<span class='macro_popup'>((gpointer) (glong) (signal_number))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> <span class='keyword'>for</span> (l = list; l != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; l = l->next)</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> guint id;</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> CallbackData* d;</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> id = <span class='macro'>GPOINTER_TO_UINT(l->data)<span class='macro_popup'>((guint) (gulong) (l->data))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> d = g_hash_table_lookup(handler->id_lookup, <span class='macro'>GUINT_TO_POINTER (id)<span class='macro_popup'>((gpointer) (gulong) (id))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> <span class='keyword'>if</span> (d != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> && d->func == callback && d->data == data)</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> found = d;</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> <span class='keyword'>return</span> found;</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"><span class='keyword'>void</span> mdm_signal_handler_remove_func(MdmSignalHandler* handler, guint signal_number, MdmSignalHandlerFunc callback, gpointer data)</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> CallbackData* found;</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> <span class='macro'>g_return_if_fail(MDM_IS_SIGNAL_HANDLER(handler))<span class='macro_popup'>do { if ((MDM_IS_SIGNAL_HANDLER(handler))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "MDM_IS_SIGNAL_HANDLER(handler)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> found = find_callback_data_by_func(handler, signal_number, callback, data);</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> <span class='keyword'>if</span> (found != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> mdm_signal_handler_remove_and_free_data(handler, found);</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> found = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> <span class='comment'>/* FIXME: once all handlers are removed deregister signum handler */</span></td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> mdm_signal_handler_class_init(MdmSignalHandlerClass* klass)</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> GObjectClass* object_class = <span class='macro'>G_OBJECT_CLASS(klass)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((klass)), (((GType) ((20) << (2))))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> object_class->finalize = mdm_signal_handler_finalize;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> signal_list_free(GSList *list)</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> g_slist_free(list);</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"><span class='keyword'>void</span> mdm_signal_handler_set_fatal_func(MdmSignalHandler* handler, MdmShutdownHandlerFunc func, gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='macro'>g_return_if_fail(MDM_IS_SIGNAL_HANDLER(handler))<span class='macro_popup'>do { if ((MDM_IS_SIGNAL_HANDLER(handler))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "MDM_IS_SIGNAL_HANDLER(handler)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> handler->fatal_func = func;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> handler->fatal_data = user_data;</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> mdm_signal_handler_init(MdmSignalHandler* handler)</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> GIOChannel* ioc;</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> handler->next_id = 1;</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> handler->lookup = g_hash_table_new(<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> handler->id_lookup = g_hash_table_new(<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> handler->action_lookup = g_hash_table_new(<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> <span class='keyword'>if</span> (pipe(signal_pipes) == -1)</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> g_error (<span class='string_literal'>"Could not create pipe() for signal handling"</span>);</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> ioc = g_io_channel_unix_new(signal_pipes[0]);</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> g_io_channel_set_flags(ioc, G_IO_FLAG_NONBLOCK, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> g_io_add_watch_full(ioc, <span class='macro'>G_PRIORITY_HIGH<span class='macro_popup'>-100</span></span>, G_IO_IN, (GIOFunc) signal_io_watch, handler, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> g_io_channel_set_close_on_unref(ioc, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> g_io_channel_unref(ioc);</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> mdm_signal_handler_finalize(GObject* object)</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> MdmSignalHandler* handler;</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> GList* l;</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> <span class='macro'>g_return_if_fail(object != NULL)<span class='macro_popup'>do { if ((object != ((void*)0))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "object != NULL")<br>; return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> <span class='macro'>g_return_if_fail(MDM_IS_SIGNAL_HANDLER(object))<span class='macro_popup'>do { if ((MDM_IS_SIGNAL_HANDLER(object))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "MDM_IS_SIGNAL_HANDLER(object)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> handler = MDM_SIGNAL_HANDLER(object);</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> g_debug(<span class='string_literal'>"MdmSignalHandler: Finalizing signal handler"</span>);</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='keyword'>for</span> (l = g_hash_table_get_values(handler->lookup); l != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; l = l->next)</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> signal_list_free((GSList*) l->data);</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> g_hash_table_destroy(handler->lookup);</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> <span class='keyword'>for</span> (l = g_hash_table_get_values(handler->id_lookup); l != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; l = l->next)</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> callback_data_free((CallbackData*) l->data);</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> g_hash_table_destroy(handler->id_lookup);</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> <span class='keyword'>for</span> (l = g_hash_table_get_values(handler->action_lookup); l != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; l = l->next)</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> g_free(l->data);</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> g_hash_table_destroy(handler->action_lookup);</td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> close(signal_pipes[0]);</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> close(signal_pipes[1]);</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> <span class='macro'>G_OBJECT_CLASS(mdm_signal_handler_parent_class)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((mdm_signal_handler_parent_class)), (((GType) ((20) <<<br> (2))))))))</span></span>->finalize(object);</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line">MdmSignalHandler* mdm_signal_handler_new(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> <span class='keyword'>if</span> (signal_handler_object != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"> <span class='macro'>g_object_ref(signal_handler_object)<span class='macro_popup'>((__typeof__ (signal_handler_object)) (g_object_ref) (signal_handler_object<br>))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> signal_handler_object = g_object_new(<span class='macro'>MDM_TYPE_SIGNAL_HANDLER<span class='macro_popup'>(mdm_signal_handler_get_type())</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> g_object_add_weak_pointer(signal_handler_object, (gpointer*) &signal_handler_object);</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> <span class='keyword'>return</span> MDM_SIGNAL_HANDLER(signal_handler_object);</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-88d32f.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-88d32f.html new file mode 100644 index 0000000..1a07409 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-88d32f.html @@ -0,0 +1,1197 @@ +<!doctype html> +<html> +<head> +<title>mate-session-check-accelerated-gl-helper.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC This statement is never executed --> + +<!-- BUGTYPE Unreachable code --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/tools/mate-session-check-accelerated-gl-helper.c --> + +<!-- FILENAME mate-session-check-accelerated-gl-helper.c --> + +<!-- FUNCTIONNAME main --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 88d32f26093a65c98f7549b37f39a95b --> + +<!-- BUGLINE 505 --> + +<!-- BUGCOLUMN 30 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>tools/mate-session-check-accelerated-gl-helper.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 505, column 30</a><br />This statement is never executed</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mate-session-check-accelerated-gl-helper.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/tools -fcoverage-compilation-dir=/rootdir/tools -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -D PKGDATADIR="/usr/local/share/mate-session-manager" -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -D LOCALE_DIR="/usr/local/share/locale" -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-6 -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c mate-session-check-accelerated-gl-helper.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"505": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2010 Novell, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2006-2009 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This program is free software; you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* it under the terms of the GNU General Public License as published by</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* the Free Software Foundation; either version 2 of the License, or</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>* Author:</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>* Vincent Untz <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> <span class='comment'>* Most of the code comes from desktop-effects [1], released under GPLv2+.</span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> <span class='comment'>* desktop-effects was written by:</span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> <span class='comment'>* Soren Sandmann <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"> <span class='comment'>* [1] http://git.fedorahosted.org/git/?p=desktop-effects.git;a=blob_plain;f=desktop-effects.c;hb=HEAD</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> <span class='comment'>* Here's the rationale behind this helper, quoting Owen, in his mail to the</span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> <span class='comment'>* release team:</span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> <span class='comment'>* (http://mail.gnome.org/archives/release-team/2010-June/msg00079.html)</span></td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> <span class='comment'>* """</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> <span class='comment'>* There are some limits to what we can do here automatically without</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> <span class='comment'>* knowing anything about the driver situation on the system. The basic</span></td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"> <span class='comment'>* problem is that there are all sorts of suck:</span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"> <span class='comment'>* * No GL at all. This typically only happens if a system is</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> <span class='comment'>* misconfigured.</span></td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> <span class='comment'>* * Only software GL. This one is easy to detect. We have code in</span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> <span class='comment'>* the Fedora desktop-effects tool, etc.</span></td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"> <span class='comment'>* * GL that isn't featureful enough. (Tiny texture size limits, no</span></td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> <span class='comment'>* texture-from-pixmap, etc.) Possible to detect with more work, but</span></td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"> <span class='comment'>* largely a fringe case.</span></td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> <span class='comment'>* * Buggy GL. This isn't possible to detect. Except for the case where</span></td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> <span class='comment'>* all GL programs crash. For that reason, we probably don't want</span></td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> <span class='comment'>* gnome-session to directly try and do any GL detection; better to</span></td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> <span class='comment'>* use a helper binary.</span></td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> <span class='comment'>* * Horribly slow hardware GL. We could theoretically develop some sort</span></td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> <span class='comment'>* of benchmark, but it's a tricky area. And how slow is too slow?</span></td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> <span class='comment'>* """</span></td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> <span class='comment'>* Some other tools are doing similar checks:</span></td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> <span class='comment'>* - desktop-effects (Fedora Config Tool) [1]</span></td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> <span class='comment'>* - drak3d (Mandriva Config Tool) [2]</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> <span class='comment'>* - compiz-manager (Compiz wrapper) [3]</span></td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> <span class='comment'>* [1] http://git.fedorahosted.org/git/?p=desktop-effects.git;a=blob_plain;f=desktop-effects.c;hb=HEAD</span></td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> <span class='comment'>* [2] http://svn.mandriva.com/cgi-bin/viewvc.cgi/soft/drak3d/trunk/lib/Xconfig/glx.pm?view=markup</span></td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> <span class='comment'>* [3] http://git.compiz.org/fusion/misc/compiz-manager/tree/compiz-manager</span></td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"><span class='comment'>/* for strcasestr */</span></td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='directive'>#define _GNU_SOURCE</span></td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"><span class='directive'>#include <ctype.h></span></td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"><span class='directive'>#include <locale.h></span></td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"><span class='directive'>#include <glib.h></span></td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"><span class='directive'>#include <regex.h></span></td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='directive'>#ifdef __FreeBSD__</span></td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"><span class='directive'>#include <kenv.h></span></td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"><span class='directive'>#include <X11/Xlib.h></span></td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"><span class='directive'>#include <X11/Xatom.h></span></td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"><span class='directive'>#include <X11/extensions/Xcomposite.h></span></td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"><span class='directive'>#include <GL/gl.h></span></td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"><span class='directive'>#include <GL/glx.h></span></td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"><span class='directive'>#include "mate-session-check-accelerated-common.h"</span></td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"><span class='directive'>#define <span class='macro'>SIZE_UNSET<span class='macro_popup'>0</span></span> 0</span></td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"><span class='directive'>#define <span class='macro'>SIZE_ERROR<span class='macro_popup'>-1</span></span> -1</span></td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span> max_texture_size = <span class='macro'>SIZE_UNSET<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span> max_renderbuffer_size = <span class='macro'>SIZE_UNSET<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"><span class='keyword'>static</span> gboolean has_llvmpipe = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line">_print_error (<span class='keyword'>const</span> <span class='keyword'>char</span> *str)</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> fprintf (<span class='macro'>stderr<span class='macro_popup'>stderr</span></span>, <span class='string_literal'>"mate-session-is-accelerated: %s\n"</span>, str);</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"><span class='directive'>#define <span class='macro'>CMDLINE_UNSET<span class='macro_popup'>-1</span></span> -1</span></td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"><span class='directive'>#define <span class='macro'>CMDLINE_NON_FALLBACK_FORCED<span class='macro_popup'>0</span></span> 0</span></td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"><span class='directive'>#define <span class='macro'>CMDLINE_FALLBACK_FORCED<span class='macro_popup'>1</span></span> 1</span></td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"><span class='directive'>#if defined(<span class='macro'>__linux__<span class='macro_popup'>1</span></span>)</span></td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line">_parse_kcmdline (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> <span class='keyword'>int</span> ret = <span class='macro'>CMDLINE_UNSET<span class='macro_popup'>-1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> GRegex *regex;</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> GMatchInfo *match;</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> <span class='keyword'>char</span> *contents;</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> <span class='keyword'>char</span> *word;</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *arg;</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='keyword'>if</span> (!g_file_get_contents (<span class='string_literal'>"/proc/cmdline"</span>, &contents, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>))</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> regex = g_regex_new (<span class='string_literal'>"mate.fallback=(\\S+)"</span>, 0, G_REGEX_MATCH_NOTEMPTY, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>if</span> (!g_regex_match (regex, contents, G_REGEX_MATCH_NOTEMPTY, &match))</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> word = g_match_info_fetch (match, 0);</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> g_debug (<span class='string_literal'>"Found command-line match '%s'"</span>, word);</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> arg = word + strlen (<span class='string_literal'>"mate.fallback="</span>);</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> <span class='keyword'>if</span> (*arg != '0' && *arg != '1')</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> fprintf (<span class='macro'>stderr<span class='macro_popup'>stderr</span></span>, <span class='string_literal'>"mate-session-check-accelerated: Invalid value '%s' for mate.fallback passed in kernel command line.\n"</span>, arg);</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> ret = atoi (arg);</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> g_free (word);</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> g_match_info_free (match);</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> g_regex_unref (regex);</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> g_free (contents);</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> g_debug (<span class='string_literal'>"Command-line parsed to %d"</span>, ret);</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"><span class='directive'>#elif defined(__FreeBSD__)</span></td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line">_parse_kcmdline (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> <span class='keyword'>int</span> ret = <span class='macro'>CMDLINE_UNSET<span class='macro_popup'>-1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> <span class='keyword'>char</span> value[KENV_MVALLEN];</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> <span class='comment'>/* a compile time check to avoid unexpected stack overflow */</span></td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='keyword'>_Static_assert</span>(KENV_MVALLEN < 1024 * 1024, <span class='string_literal'>"KENV_MVALLEN is too large"</span>);</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> <span class='keyword'>if</span> (kenv (KENV_GET, <span class='string_literal'>"mate.fallback"</span>, value, KENV_MVALLEN) == -1)</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> <span class='keyword'>if</span> (*value != '0' && *value != '1')</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> fprintf (<span class='macro'>stderr<span class='macro_popup'>stderr</span></span>, <span class='string_literal'>"mate-session-is-accelerated: Invalid value '%s' for mate.fallback passed in kernel environment.\n"</span>, value);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> ret = atoi (value);</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> g_debug (<span class='string_literal'>"Kernel environment parsed to %d"</span>, ret);</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"><span class='directive'>#else</span></td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line">_parse_kcmdline (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>CMDLINE_UNSET<span class='macro_popup'>-1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line">_has_composite (Display *display)</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>int</span> dummy1, dummy2;</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='keyword'>return</span> XCompositeQueryExtension (display, &dummy1, &dummy2);</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line">_is_comment (<span class='keyword'>const</span> <span class='keyword'>char</span> *line)</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='keyword'>while</span> (*line && <span class='macro'>isspace(*line)<span class='macro_popup'>((*__ctype_b_loc ())[(int) ((*line))] & (unsigned short int<br>) _ISspace)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> line++;</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='keyword'>if</span> (*line == '#' || *line == '\0')</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line">_is_gl_renderer_blacklisted (<span class='keyword'>const</span> <span class='keyword'>char</span> *renderer)</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> FILE *blacklist;</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='keyword'>char</span> *line = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> size_t line_len = 0;</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> gboolean ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> blacklist = fopen(<span class='macro'>PKGDATADIR<span class='macro_popup'>"/usr/local/share/mate-session-manager"</span></span> <span class='string_literal'>"/hardware-compatibility"</span>, <span class='string_literal'>"r"</span>);</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> <span class='keyword'>if</span> (blacklist == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> <span class='keyword'>while</span> (getline (&line, &line_len, blacklist) != -1) {</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='keyword'>int</span> whitelist = 0;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *re_str;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> regex_t re;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> <span class='keyword'>int</span> status;</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> <span class='keyword'>if</span> (line == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='comment'>/* Drop trailing \n */</span></td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> line[strlen(line) - 1] = '\0';</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='keyword'>if</span> (_is_comment (line)) {</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> free (line);</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> line = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> <span class='keyword'>if</span> (line[0] == '+')</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> whitelist = 1;</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (line[0] == '-')</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> whitelist = 0;</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> _print_error (<span class='string_literal'>"Invalid syntax in this line for hardware compatibility:"</span>);</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> _print_error (line);</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> free (line);</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> line = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> re_str = line + 1;</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> <span class='keyword'>if</span> (regcomp (&re, re_str, <span class='macro'>REG_EXTENDED<span class='macro_popup'>1</span></span>|<span class='macro'>REG_ICASE<span class='macro_popup'>(1 << 1)</span></span>|<span class='macro'>REG_NOSUB<span class='macro_popup'>(1 << 3)</span></span>) != 0) {</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> _print_error (<span class='string_literal'>"Cannot use this regular expression for hardware compatibility:"</span>);</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> _print_error (re_str);</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> status = regexec (&re, renderer, 0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0);</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> regfree(&re);</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> <span class='keyword'>if</span> (status == 0) {</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> <span class='keyword'>if</span> (whitelist)</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> free (line);</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> line = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>if</span> (line != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> free (line);</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> <span class='keyword'>if</span> (blacklist != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> fclose (blacklist);</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>char</span> *</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line">_get_hardware_gl (Display *display)</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>int</span> screen;</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> Window root;</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> XVisualInfo *visual = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> GLXContext context = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> XSetWindowAttributes cwa = { 0 };</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> Window window = <span class='macro'>None<span class='macro_popup'>0L</span></span>;</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>char</span> *renderer = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> <span class='keyword'>int</span> attrlist[] = {</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> <span class='macro'>GLX_RGBA<span class='macro_popup'>4</span></span>,</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> <span class='macro'>GLX_RED_SIZE<span class='macro_popup'>8</span></span>, 1,</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> <span class='macro'>GLX_GREEN_SIZE<span class='macro_popup'>9</span></span>, 1,</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='macro'>GLX_BLUE_SIZE<span class='macro_popup'>10</span></span>, 1,</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> <span class='macro'>GLX_DOUBLEBUFFER<span class='macro_popup'>5</span></span>,</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> <span class='macro'>None<span class='macro_popup'>0L</span></span></td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> screen = <span class='macro'>DefaultScreen (display)<span class='macro_popup'>(((_XPrivDisplay)(display))->default_screen)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> root = <span class='macro'>RootWindow (display, screen)<span class='macro_popup'>((&((_XPrivDisplay)(display))->screens[screen])->root<br>)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> visual = glXChooseVisual (display, screen, attrlist);</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> <span class='keyword'>if</span> (!visual)</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> context = glXCreateContext (display, visual, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>True<span class='macro_popup'>1</span></span>);</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> <span class='keyword'>if</span> (!context)</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> cwa.colormap = XCreateColormap (display, root,</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> visual->visual, <span class='macro'>AllocNone<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> cwa.background_pixel = 0;</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> cwa.border_pixel = 0;</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> window = XCreateWindow (display, root,</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> 0, 0, 1, 1, 0,</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> visual->depth, <span class='macro'>InputOutput<span class='macro_popup'>1</span></span>, visual->visual,</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='macro'>CWColormap<span class='macro_popup'>(1L<<13)</span></span> | <span class='macro'>CWBackPixel<span class='macro_popup'>(1L<<1)</span></span> | <span class='macro'>CWBorderPixel<span class='macro_popup'>(1L<<3)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> &cwa);</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> <span class='keyword'>if</span> (!glXMakeCurrent (display, window, context))</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> renderer = <span class='macro'>g_strdup ((<span class='keyword'>const</span> <span class='keyword'>char</span> *) glGetString (GL_RENDERER))<span class='macro_popup'>g_strdup_inline ((const char *) glGetString (0x1F01))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> <span class='keyword'>if</span> (_is_gl_renderer_blacklisted (renderer)) {</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='macro'>g_clear_pointer (&renderer, g_free)<span class='macro_popup'>do { _Static_assert (sizeof *(&renderer) == sizeof (gpointer<br>), "Expression evaluates to false"); __typeof__ ((&renderer<br>)) _pp = (&renderer); __typeof__ (*(&renderer)) _ptr =<br> *_pp; *_pp = ((void*)0); if (_ptr) (g_free) (_ptr); } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> <span class='keyword'>if</span> (renderer && strcasestr (renderer, <span class='string_literal'>"llvmpipe"</span>))</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> has_llvmpipe = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> <span class='comment'>/* we need to get the max texture and renderbuffer sizes while we have</span></td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> <span class='comment'>* a context, but we'll check their values later */</span></td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> glGetIntegerv (<span class='macro'>GL_MAX_TEXTURE_SIZE<span class='macro_popup'>0x0D33</span></span>, &max_texture_size);</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> <span class='keyword'>if</span> (glGetError() != <span class='macro'>GL_NO_ERROR<span class='macro_popup'>0</span></span>)</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> max_texture_size = <span class='macro'>SIZE_ERROR<span class='macro_popup'>-1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> glGetIntegerv (<span class='macro'>GL_MAX_RENDERBUFFER_SIZE_EXT<span class='macro_popup'>0x84E8</span></span>, &max_renderbuffer_size);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (glGetError() != <span class='macro'>GL_NO_ERROR<span class='macro_popup'>0</span></span>)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> max_renderbuffer_size = <span class='macro'>SIZE_ERROR<span class='macro_popup'>-1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> glXMakeCurrent (display, <span class='macro'>None<span class='macro_popup'>0L</span></span>, <span class='macro'>None<span class='macro_popup'>0L</span></span>);</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> <span class='keyword'>if</span> (context)</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> glXDestroyContext (display, context);</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> <span class='keyword'>if</span> (window)</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> XDestroyWindow (display, window);</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='keyword'>if</span> (cwa.colormap)</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> XFreeColormap (display, cwa.colormap);</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='keyword'>return</span> renderer;</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line">_has_extension (<span class='keyword'>const</span> <span class='keyword'>char</span> *extension_list,</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *extension)</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> <span class='keyword'>char</span> **extensions;</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> guint i;</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='macro'>g_return_val_if_fail (extension != NULL, TRUE)<span class='macro_popup'>do { if ((extension != ((void*)0))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "extension != NULL"<br>); return ((!(0))); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='comment'>/* Extension_list is one big string, containing extensions</span></td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='comment'>* separated by spaces. */</span></td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>if</span> (extension_list == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> extensions = g_strsplit (extension_list, <span class='string_literal'>" "</span>, -1);</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>if</span> (extensions == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> <span class='keyword'>for</span> (i = 0; extensions[i] != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; i++) {</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>g_str_equal (extensions[i], extension)<span class='macro_popup'>(strcmp ((const char *) (extensions[i]), (const char *) (extension<br>)) == 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> g_strfreev (extensions);</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line">_has_texture_from_pixmap (Display *display)</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>int</span> screen;</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *server_extensions;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *client_extensions;</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> gboolean ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> screen = <span class='macro'>DefaultScreen (display)<span class='macro_popup'>(((_XPrivDisplay)(display))->default_screen)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> server_extensions = glXQueryServerString (display, screen,</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='macro'>GLX_EXTENSIONS<span class='macro_popup'>3</span></span>);</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> <span class='keyword'>if</span> (!_has_extension (server_extensions,</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='string_literal'>"GLX_EXT_texture_from_pixmap"</span>))</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> client_extensions = glXGetClientString (display, <span class='macro'>GLX_EXTENSIONS<span class='macro_popup'>3</span></span>);</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>if</span> (!_has_extension (client_extensions,</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> <span class='string_literal'>"GLX_EXT_texture_from_pixmap"</span>))</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line">_set_max_screen_size_property (Display *display, <span class='keyword'>int</span> screen, <span class='keyword'>int</span> size)</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> Atom max_screen_size_atom;</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> max_screen_size_atom = XInternAtom (display, <span class='string_literal'>"_GNOME_MAX_SCREEN_SIZE"</span>,</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> <span class='macro'>False<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='comment'>/* Will be read by gnome-settings-daemon and</span></td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> <span class='comment'>* gnome-control-center to avoid display configurations where 3D</span></td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> <span class='comment'>* is not available (and would break gnome-shell) */</span></td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> XChangeProperty (display, <span class='macro'>RootWindow(display, screen)<span class='macro_popup'>((&((_XPrivDisplay)(display))->screens[screen])->root<br>)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> max_screen_size_atom,</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='macro'>XA_CARDINAL<span class='macro_popup'>((Atom) 6)</span></span>, 32, <span class='macro'>PropModeReplace<span class='macro_popup'>0</span></span>,</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> (<span class='keyword'>unsigned</span> <span class='keyword'>char</span> *)&size, 1);</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> XSync(display, <span class='macro'>False<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line">_is_max_texture_size_big_enough (Display *display)</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> <span class='keyword'>int</span> screen, size;</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> screen = <span class='macro'>DefaultScreen (display)<span class='macro_popup'>(((_XPrivDisplay)(display))->default_screen)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> size = <span class='macro'>MIN(max_renderbuffer_size, max_texture_size)<span class='macro_popup'>(((max_renderbuffer_size) < (max_texture_size)) ? (max_renderbuffer_size<br>) : (max_texture_size))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> <span class='keyword'>if</span> (size < <span class='macro'>DisplayWidth (display, screen)<span class='macro_popup'>((&((_XPrivDisplay)(display))->screens[screen])->width<br>)</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> size < <span class='macro'>DisplayHeight (display, screen)<span class='macro_popup'>((&((_XPrivDisplay)(display))->screens[screen])->height<br>)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> _set_max_screen_size_property (display, screen, size);</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"><span class='keyword'>static</span> gboolean print_renderer = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>const</span> GOptionEntry entries[] = {</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> { <span class='string_literal'>"print-renderer"</span>, 'p', 0, G_OPTION_ARG_NONE, &print_renderer, <span class='string_literal'>"Print GL renderer name"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> },</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> { <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, 0, G_OPTION_ARG_NONE, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> },</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"><span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line">main (<span class='keyword'>int</span> argc, <span class='keyword'>char</span> **argv)</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> <span class='keyword'>int</span> kcmdline_parsed;</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> Display *display = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> <span class='keyword'>int</span> ret = <span class='macro'>HELPER_NO_ACCEL<span class='macro_popup'>1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> GOptionContext *context;</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> <span class='keyword'>char</span> *renderer = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> setlocale (<span class='macro'>LC_ALL<span class='macro_popup'>6</span></span>, <span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> context = g_option_context_new (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> g_option_context_add_main_entries (context, entries, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> <span class='keyword'>if</span> (!g_option_context_parse (context, &argc, &argv, &error)) {</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> g_error (<span class='string_literal'>"Can't parse command line: %s\n"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> kcmdline_parsed = _parse_kcmdline ();</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> <span class='keyword'>if</span> (kcmdline_parsed > <span class='macro'>CMDLINE_UNSET<span class='macro_popup'>-1</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='keyword'>if</span> (kcmdline_parsed == <span class='macro'>CMDLINE_NON_FALLBACK_FORCED<span class='macro_popup'>0</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> _print_error (<span class='string_literal'>"Non-fallback mode forced by kernel command line."</span>);</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> ret = <span class='macro'>HELPER_ACCEL<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (kcmdline_parsed == <span class='macro'>CMDLINE_FALLBACK_FORCED<span class='macro_popup'>1</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> _print_error (<span class='string_literal'>"Fallback mode forced by kernel command line."</span>);</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> display = XOpenDisplay (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> <span class='keyword'>if</span> (!display) {</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> _print_error (<span class='string_literal'>"No X display."</span>);</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> <span class='keyword'>if</span> (!_has_composite (display)) {</td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> _print_error (<span class='string_literal'>"No composite extension."</span>);</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> renderer = _get_hardware_gl (display);</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> <span class='keyword'>if</span> (!renderer) {</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> _print_error (<span class='string_literal'>"No hardware 3D support."</span>);</td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> <span class='keyword'>if</span> (!_has_texture_from_pixmap (display)) {</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> _print_error (<span class='string_literal'>"No GLX_EXT_texture_from_pixmap support."</span>);</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='keyword'>if</span> (!_is_max_texture_size_big_enough (display)) {</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> _print_error (<span class='string_literal'>"GL_MAX_{TEXTURE,RENDERBUFFER}_SIZE is too small."</span>);</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> ret = has_llvmpipe ? <span class="mrange"><span class='macro'>HELPER_SOFTWARE_RENDERING<span class='macro_popup'>2</span></span></span> : <span class='macro'>HELPER_ACCEL<span class='macro_popup'>0</span></span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:30ex">This statement is never executed</div></td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> <span class='keyword'>if</span> (print_renderer)</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> g_print (<span class='string_literal'>"%s"</span>, renderer);</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>if</span> (display)</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> XCloseDisplay (display);</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> g_option_context_free (context);</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> g_free (renderer);</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-a80670.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-a80670.html new file mode 100644 index 0000000..25bf7b2 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-a80670.html @@ -0,0 +1,4937 @@ +<!doctype html> +<html> +<head> +<title>gsm-manager.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC This statement is never executed --> + +<!-- BUGTYPE Unreachable code --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/mate-session/gsm-manager.c --> + +<!-- FILENAME gsm-manager.c --> + +<!-- FUNCTIONNAME gsm_manager_new --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT a806706c6a937e19e49542ea0ec29bc9 --> + +<!-- BUGLINE 2932 --> + +<!-- BUGCOLUMN 25 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>mate-session/gsm-manager.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 2932, column 25</a><br />This statement is never executed</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name gsm-manager.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/mate-session -fcoverage-compilation-dir=/rootdir/mate-session -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -I /usr/include/uuid -I ../mate-submodules/libegg -D LOCALE_DIR="/usr/local/share/locale" -D DATA_DIR="/usr/local/share/mate-session" -D LIBEXECDIR="/usr/local/libexec" -D GTKBUILDER_DIR="/usr/local/share/mate-session-manager" -D I_KNOW_THE_DEVICEKIT_POWER_API_IS_SUBJECT_TO_CHANGE -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c gsm-manager.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"2932": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2007 Novell, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Copyright (C) 2008 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* Copyright (C) 2008 William Jon McCann <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* This program is free software; you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* it under the terms of the GNU General Public License as published by</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>* the Free Software Foundation; either version 2 of the License, or</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>* along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include "config.h"</span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <fcntl.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include <signal.h></span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include <sys/stat.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"><span class='directive'>#include <sys/types.h></span></td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#include <glib.h></span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"><span class='directive'>#include <glib/gstdio.h></span></td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"><span class='directive'>#include <glib-object.h></span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#include <dbus/dbus-glib.h></span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#include <dbus/dbus-glib-lowlevel.h></span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='directive'>#include <gtk/gtk.h> /* for logout dialog */</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"><span class='directive'>#include <gio/gio.h> /* for gsettings */</span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"><span class='directive'>#include "gsm-manager.h"</span></td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"><span class='directive'>#include "gsm-manager-glue.h"</span></td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"><span class='directive'>#include "gsm-store.h"</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='directive'>#include "gsm-inhibitor.h"</span></td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"><span class='directive'>#include "gsm-presence.h"</span></td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='directive'>#include "gsm-xsmp-client.h"</span></td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"><span class='directive'>#include "gsm-dbus-client.h"</span></td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"><span class='directive'>#include "gsm-autostart-app.h"</span></td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"><span class='directive'>#include "gsm-util.h"</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"><span class='directive'>#include "mdm.h"</span></td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='directive'>#include "gsm-logout-dialog.h"</span></td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"><span class='directive'>#include "gsm-inhibit-dialog.h"</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"><span class='directive'>#include "gsm-consolekit.h"</span></td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"><span class='directive'>#include "gsm-systemd.h"</span></td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"><span class='directive'>#include "gsm-session-save.h"</span></td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_MANAGER_GET_PRIVATE(o)<span class='macro_popup'>(((GsmManagerPrivate*) g_type_instance_get_private ((GTypeInstance<br>*) ((o)), ((gsm_manager_get_type ())))) GCC warning "Deprecated pre-processor symbol: replace with \"G_ADD_PRIVATE\""<br> +)</span></span> (<span class='macro'>G_TYPE_INSTANCE_GET_PRIVATE ((o), GSM_TYPE_MANAGER, GsmManagerPrivate)<span class='macro_popup'>((GsmManagerPrivate*) g_type_instance_get_private ((GTypeInstance<br>*) ((o)), ((gsm_manager_get_type ())))) GCC warning "Deprecated pre-processor symbol: replace with \"G_ADD_PRIVATE\""<br> +</span></span>)</span></td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_MANAGER_DBUS_PATH<span class='macro_popup'>"/org/gnome/SessionManager"</span></span> "/org/gnome/SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_MANAGER_DBUS_NAME<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_MANAGER_PHASE_TIMEOUT<span class='macro_popup'>30</span></span> 30 /* seconds */</span></td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"><span class='comment'>/* In the exit phase, all apps were already given the chance to inhibit the session end</span></td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> <span class='comment'>* At that stage we don't want to wait much for apps to respond, we want to exit, and fast.</span></td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_MANAGER_EXIT_PHASE_TIMEOUT<span class='macro_popup'>1</span></span> 1 /* seconds */</span></td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"><span class='directive'>#define <span class='macro'>MDM_FLEXISERVER_COMMAND<span class='macro_popup'>"mdmflexiserver"</span></span> "mdmflexiserver"</span></td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='directive'>#define <span class='macro'>MDM_FLEXISERVER_ARGS<span class='macro_popup'>"--startnew Standard"</span></span> "--startnew Standard"</span></td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"><span class='directive'>#define <span class='macro'>GDM_FLEXISERVER_COMMAND<span class='macro_popup'>"gdmflexiserver"</span></span> "gdmflexiserver"</span></td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"><span class='directive'>#define <span class='macro'>GDM_FLEXISERVER_ARGS<span class='macro_popup'>"--startnew Standard"</span></span> "--startnew Standard"</span></td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"><span class='directive'>#define <span class='macro'>LOCKDOWN_SCHEMA<span class='macro_popup'>"org.mate.lockdown"</span></span> "org.mate.lockdown"</span></td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_LOCK_DISABLE<span class='macro_popup'>"disable-lock-screen"</span></span> "disable-lock-screen"</span></td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_LOG_OUT_DISABLE<span class='macro_popup'>"disable-log-out"</span></span> "disable-log-out"</span></td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_USER_SWITCH_DISABLE<span class='macro_popup'>"disable-user-switching"</span></span> "disable-user-switching"</span></td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"><span class='directive'>#define <span class='macro'>SESSION_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span> "org.mate.session"</span></td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_IDLE_DELAY<span class='macro_popup'>"idle-delay"</span></span> "idle-delay"</span></td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_AUTOSAVE<span class='macro_popup'>"auto-save-session"</span></span> "auto-save-session"</span></td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"><span class='directive'>#define <span class='macro'>SCREENSAVER_SCHEMA<span class='macro_popup'>"org.mate.screensaver"</span></span> "org.mate.screensaver"</span></td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_SLEEP_LOCK<span class='macro_popup'>"lock-enabled"</span></span> "lock-enabled"</span></td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"><span class='directive'>#ifdef <span class='macro'>__GNUC__<span class='macro_popup'>4</span></span></span></td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"><span class='directive'>#define <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> __attribute__ ((unused))</span></td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"><span class='directive'>#else</span></td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"><span class='directive'>#define <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span></span></td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>enum</span></td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> GSM_MANAGER_LOGOUT_NONE,</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> GSM_MANAGER_LOGOUT_LOGOUT,</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> GSM_MANAGER_LOGOUT_REBOOT,</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> GSM_MANAGER_LOGOUT_REBOOT_INTERACT,</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> GSM_MANAGER_LOGOUT_REBOOT_MDM,</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> GSM_MANAGER_LOGOUT_SHUTDOWN,</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> GSM_MANAGER_LOGOUT_SHUTDOWN_INTERACT,</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> GSM_MANAGER_LOGOUT_SHUTDOWN_MDM</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line">} GsmManagerLogoutType;</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span> {</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> gboolean failsafe;</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> GsmStore *clients;</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> GsmStore *inhibitors;</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> GsmStore *apps;</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> GsmPresence *presence;</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> <span class='comment'>/* Current status */</span></td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> GsmManagerPhase phase;</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> guint phase_timeout_id;</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> GSList *pending_apps;</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> GsmManagerLogoutMode logout_mode;</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> GSList *query_clients;</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> guint query_timeout_id;</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> <span class='comment'>/* This is used for GSM_MANAGER_PHASE_END_SESSION only at the moment,</span></td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> <span class='comment'>* since it uses a sublist of all running client that replied in a</span></td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='comment'>* specific way */</span></td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> GSList *next_query_clients;</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> <span class='comment'>/* This is the action that will be done just before we exit */</span></td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> GsmManagerLogoutType logout_type;</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> GtkWidget *inhibit_dialog;</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> <span class='comment'>/* List of clients which were disconnected due to disabled condition</span></td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> <span class='comment'>* and shouldn't be automatically restarted */</span></td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> GSList *condition_clients;</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> GSettings *settings_session;</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> GSettings *settings_lockdown;</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> GSettings *settings_screensaver;</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> <span class='keyword'>char</span> *renderer;</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> DBusGProxy *bus_proxy;</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> DBusGConnection *connection;</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> gboolean dbus_disconnected : 1;</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">} GsmManagerPrivate;</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> PROP_0,</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> PROP_CLIENT_STORE,</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> PROP_RENDERER,</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> PROP_FAILSAFE</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> PHASE_CHANGED,</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> CLIENT_ADDED,</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> CLIENT_REMOVED,</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> INHIBITOR_ADDED,</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> INHIBITOR_REMOVED,</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> SESSION_RUNNING,</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> SESSION_OVER,</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> LAST_SIGNAL</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"><span class='keyword'>static</span> guint signals [LAST_SIGNAL] = { 0 };</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> gsm_manager_finalize (GObject *object);</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"><span class='keyword'>static</span> gboolean _log_out_is_locked_down (GsmManager *manager);</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"><span class='keyword'>static</span> gboolean _switch_user_is_locked_down (GsmManager *manager);</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> _handle_client_end_session_response (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> gboolean is_ok,</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> gboolean do_last,</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> gboolean cancel,</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *reason);</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"><span class='keyword'>static</span> gboolean auto_save_is_enabled (GsmManager *manager);</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> maybe_save_session (GsmManager *manager);</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"><span class='keyword'>static</span> gpointer manager_object = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"><span class='macro'>G_DEFINE_TYPE_WITH_PRIVATE (GsmManager, gsm_manager, G_TYPE_OBJECT)<span class='macro_popup'>static void gsm_manager_init (GsmManager *self); static void gsm_manager_class_init<br> (GsmManagerClass *klass); static GType gsm_manager_get_type_once<br> (void); static gpointer gsm_manager_parent_class = ((void*)0<br>); static gint GsmManager_private_offset; static void gsm_manager_class_intern_init<br> (gpointer klass) { gsm_manager_parent_class = g_type_class_peek_parent<br> (klass); if (GsmManager_private_offset != 0) g_type_class_adjust_private_offset<br> (klass, &GsmManager_private_offset); gsm_manager_class_init<br> ((GsmManagerClass*) klass); } __attribute__ ((__unused__)) static<br> inline gpointer gsm_manager_get_instance_private (GsmManager<br> *self) { return (((gpointer) ((guint8*) (self) + (glong) (GsmManager_private_offset<br>)))); } GType gsm_manager_get_type (void) { static GType static_g_define_type_id<br> = 0; if ((__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); (void<br>) (0 ? (gpointer) * (&static_g_define_type_id) : ((void*)<br>0)); (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); __typeof__<br> (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__<br> ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id<br>); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)<br>; gapg_temp_newval; })) && g_once_init_enter_pointer (<br>&static_g_define_type_id)); })) ) { GType g_define_type_id<br> = gsm_manager_get_type_once (); (__extension__ ({ _Static_assert<br> (sizeof *(&static_g_define_type_id) == sizeof (gpointer)<br>, "Expression evaluates to false"); 0 ? (void) (*(&static_g_define_type_id<br>) = (g_define_type_id)) : (void) 0; g_once_init_leave_pointer<br> ((&static_g_define_type_id), (gpointer) (guintptr) (g_define_type_id<br>)); })) ; } return static_g_define_type_id; } __attribute__ (<br>(__noinline__)) static GType gsm_manager_get_type_once (void)<br> { GType g_define_type_id = g_type_register_static_simple (((<br>GType) ((20) << (2))), g_intern_static_string ("GsmManager"<br>), sizeof (GsmManagerClass), (GClassInitFunc)(void (*)(void))<br> gsm_manager_class_intern_init, sizeof (GsmManager), (GInstanceInitFunc<br>)(void (*)(void)) gsm_manager_init, (GTypeFlags) 0); { {{ GsmManager_private_offset<br> = g_type_add_instance_private (g_define_type_id, sizeof (GsmManagerPrivate<br>)); };} } return g_define_type_id; }</span></span></td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line">GQuark</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line">gsm_manager_error_quark (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='keyword'>static</span> GQuark ret = 0;</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='keyword'>if</span> (ret == 0) {</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> ret = g_quark_from_static_string (<span class='string_literal'>"gsm_manager_error"</span>);</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"><span class='directive'>#define <span class='macro'>ENUM_ENTRY(NAME, DESC)<span class='macro_popup'>{ NAME, "" "NAME" "", DESC }</span></span> { NAME, "" #NAME "", DESC }</span></td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line">GType</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line">gsm_manager_error_get_type (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> <span class='keyword'>static</span> GType etype = 0;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> <span class='keyword'>if</span> (etype == 0) {</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> GEnumValue values[] = {</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='macro'>ENUM_ENTRY (GSM_MANAGER_ERROR_GENERAL, <span class='string_literal'>"GeneralError"</span>)<span class='macro_popup'>{ GSM_MANAGER_ERROR_GENERAL, "" "GSM_MANAGER_ERROR_GENERAL" ""<br>, "GeneralError" }</span></span>,</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> <span class='macro'>ENUM_ENTRY (GSM_MANAGER_ERROR_NOT_IN_INITIALIZATION, <span class='string_literal'>"NotInInitialization"</span>)<span class='macro_popup'>{ GSM_MANAGER_ERROR_NOT_IN_INITIALIZATION, "" "GSM_MANAGER_ERROR_NOT_IN_INITIALIZATION"<br> "", "NotInInitialization" }</span></span>,</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='macro'>ENUM_ENTRY (GSM_MANAGER_ERROR_NOT_IN_RUNNING, <span class='string_literal'>"NotInRunning"</span>)<span class='macro_popup'>{ GSM_MANAGER_ERROR_NOT_IN_RUNNING, "" "GSM_MANAGER_ERROR_NOT_IN_RUNNING"<br> "", "NotInRunning" }</span></span>,</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> <span class='macro'>ENUM_ENTRY (GSM_MANAGER_ERROR_ALREADY_REGISTERED, <span class='string_literal'>"AlreadyRegistered"</span>)<span class='macro_popup'>{ GSM_MANAGER_ERROR_ALREADY_REGISTERED, "" "GSM_MANAGER_ERROR_ALREADY_REGISTERED"<br> "", "AlreadyRegistered" }</span></span>,</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> <span class='macro'>ENUM_ENTRY (GSM_MANAGER_ERROR_NOT_REGISTERED, <span class='string_literal'>"NotRegistered"</span>)<span class='macro_popup'>{ GSM_MANAGER_ERROR_NOT_REGISTERED, "" "GSM_MANAGER_ERROR_NOT_REGISTERED"<br> "", "NotRegistered" }</span></span>,</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='macro'>ENUM_ENTRY (GSM_MANAGER_ERROR_INVALID_OPTION, <span class='string_literal'>"InvalidOption"</span>)<span class='macro_popup'>{ GSM_MANAGER_ERROR_INVALID_OPTION, "" "GSM_MANAGER_ERROR_INVALID_OPTION"<br> "", "InvalidOption" }</span></span>,</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> <span class='macro'>ENUM_ENTRY (GSM_MANAGER_ERROR_LOCKED_DOWN, <span class='string_literal'>"LockedDown"</span>)<span class='macro_popup'>{ GSM_MANAGER_ERROR_LOCKED_DOWN, "" "GSM_MANAGER_ERROR_LOCKED_DOWN"<br> "", "LockedDown" }</span></span>,</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> { 0, 0, 0 }</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> <span class='macro'>g_assert (GSM_MANAGER_NUM_ERRORS == G_N_ELEMENTS (values) - 1)<span class='macro_popup'>do { if (GSM_MANAGER_NUM_ERRORS == (sizeof (values) / sizeof (<br>(values)[0])) - 1) ; else g_assertion_message_expr (((gchar*)<br> 0), "gsm-manager.c", 223, ((const char*) (__func__)), "GSM_MANAGER_NUM_ERRORS == G_N_ELEMENTS (values) - 1"<br>); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> etype = g_enum_register_static (<span class='string_literal'>"GsmManagerError"</span>, values);</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> <span class='keyword'>return</span> etype;</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line">_debug_client (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Client %s"</span>, gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line">debug_clients (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> gsm_store_foreach (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> (GsmStoreFunc)_debug_client,</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> manager);</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line">_debug_inhibitor (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> GsmInhibitor *inhibitor,</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Inhibitor app:%s client:%s bus-name:%s reason:%s"</span>,</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> gsm_inhibitor_peek_app_id (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> gsm_inhibitor_peek_client_id (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> gsm_inhibitor_peek_bus_name (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> gsm_inhibitor_peek_reason (inhibitor));</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line">debug_inhibitors (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> gsm_store_foreach (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> (GsmStoreFunc)_debug_inhibitor,</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> manager);</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line">_find_by_cookie (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> GsmInhibitor *inhibitor,</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> guint *cookie_ap)</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> guint cookie_b;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> cookie_b = gsm_inhibitor_peek_cookie (inhibitor);</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='keyword'>return</span> (*cookie_ap == cookie_b);</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line">_find_by_startup_id (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id_a)</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id_b;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> startup_id_b = gsm_client_peek_startup_id (client);</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (startup_id_b)<span class='macro_popup'>((startup_id_b)==((void*)0)||(startup_id_b)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> <span class='keyword'>return</span> (strcmp (startup_id_a, startup_id_b) == 0);</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line">app_condition_changed (GsmApp *app,</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> gboolean condition,</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> GsmClient *client;</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: app:%s condition changed condition:%d"</span>,</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> gsm_app_peek_id (app),</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> condition);</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> client = (GsmClient *)gsm_store_find (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> (GsmStoreFunc)_find_by_startup_id,</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> (<span class='keyword'>char</span> *)gsm_app_peek_startup_id (app));</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> <span class='keyword'>if</span> (condition) {</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> <span class='keyword'>if</span> (!gsm_app_is_running (app) && client == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> gboolean <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> res;</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: starting app '%s'"</span>, gsm_app_peek_id (app));</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> res = gsm_app_start (app, &error);</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> g_warning (<span class='string_literal'>"Not able to start app from its condition: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: not starting - app still running '%s'"</span>, gsm_app_peek_id (app));</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> gboolean <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> res;</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> <span class='keyword'>if</span> (client != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='comment'>/* Kill client in case condition if false and make sure it won't</span></td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> <span class='comment'>* be automatically restarted by adding the client to</span></td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='comment'>* condition_clients */</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> priv->condition_clients =</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> g_slist_prepend (priv->condition_clients, client);</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: stopping client %s for app"</span>, gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> res = gsm_client_stop (client, &error);</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> g_warning (<span class='string_literal'>"Not able to stop app client from its condition: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: stopping app %s"</span>, gsm_app_peek_id (app));</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='comment'>/* If we don't have a client then we should try to kill the app,</span></td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='comment'>* if it is running */</span></td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>if</span> (gsm_app_is_running (app)) {</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> res = gsm_app_stop (app, &error);</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> g_warning (<span class='string_literal'>"Not able to stop app from its condition: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>const</span> <span class='keyword'>char</span> *</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line">phase_num_to_name (guint phase)</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *name;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> <span class='keyword'>switch</span> (phase) {</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_STARTUP:</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> name = <span class='string_literal'>"STARTUP"</span>;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_INITIALIZATION:</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> name = <span class='string_literal'>"INITIALIZATION"</span>;</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_WINDOW_MANAGER:</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> name = <span class='string_literal'>"WINDOW_MANAGER"</span>;</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_PANEL:</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> name = <span class='string_literal'>"PANEL"</span>;</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_DESKTOP:</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> name = <span class='string_literal'>"DESKTOP"</span>;</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_APPLICATION:</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> name = <span class='string_literal'>"APPLICATION"</span>;</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_RUNNING:</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> name = <span class='string_literal'>"RUNNING"</span>;</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_QUERY_END_SESSION:</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> name = <span class='string_literal'>"QUERY_END_SESSION"</span>;</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_END_SESSION:</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> name = <span class='string_literal'>"END_SESSION"</span>;</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_EXIT:</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> name = <span class='string_literal'>"EXIT"</span>;</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-manager.c",<br> 410, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> <span class='keyword'>return</span> name;</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> start_phase (GsmManager *manager);</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line">quit_request_completed_consolekit (GsmConsolekit *consolekit,</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> GError *error,</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> MdmLogoutAction fallback_action = <span class='macro'>GPOINTER_TO_INT (user_data)<span class='macro_popup'>((gint) (glong) (user_data))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> mdm_set_logout_action (fallback_action);</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> g_object_unref (consolekit);</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> gtk_main_quit ();</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line">quit_request_completed_systemd (GsmSystemd *systemd,</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> GError *error,</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> MdmLogoutAction fallback_action = <span class='macro'>GPOINTER_TO_INT (user_data)<span class='macro_popup'>((gint) (glong) (user_data))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> mdm_set_logout_action (fallback_action);</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> g_object_unref (systemd);</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> gtk_main_quit ();</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line">gsm_manager_quit (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> <span class='comment'>/* See the comment in request_reboot() for some more details about how</span></td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> <span class='comment'>* this works. */</span></td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> <span class='keyword'>switch</span> (priv->logout_type) {</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_LOGOUT:</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> gtk_main_quit ();</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_REBOOT:</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_REBOOT_INTERACT:</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> mdm_set_logout_action (MDM_LOGOUT_ACTION_NONE);</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> <span class='macro'>g_signal_connect (systemd,<span class='macro_popup'>g_signal_connect_data ((systemd), ("request-completed"), (((GCallback<br>) (quit_request_completed_systemd))), (((gpointer) (glong) (MDM_LOGOUT_ACTION_REBOOT<br>))), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> <span class='string_literal'><span class='macro'>"request-completed"</span>,<span class='macro_popup'>g_signal_connect_data ((systemd), ("request-completed"), (((GCallback<br>) (quit_request_completed_systemd))), (((gpointer) (glong) (MDM_LOGOUT_ACTION_REBOOT<br>))), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> <span class='macro'>G_CALLBACK (quit_request_completed_systemd),<span class='macro_popup'>g_signal_connect_data ((systemd), ("request-completed"), (((GCallback<br>) (quit_request_completed_systemd))), (((gpointer) (glong) (MDM_LOGOUT_ACTION_REBOOT<br>))), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='macro'>GINT_TO_POINTER (MDM_LOGOUT_ACTION_REBOOT))<span class='macro_popup'>g_signal_connect_data ((systemd), ("request-completed"), (((GCallback<br>) (quit_request_completed_systemd))), (((gpointer) (glong) (MDM_LOGOUT_ACTION_REBOOT<br>))), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> gsm_systemd_attempt_restart (systemd);</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> <span class='macro'>g_signal_connect (consolekit,<span class='macro_popup'>g_signal_connect_data ((consolekit), ("request-completed"), (<br>((GCallback) (quit_request_completed_consolekit))), (((gpointer<br>) (glong) (MDM_LOGOUT_ACTION_REBOOT))), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> <span class='string_literal'><span class='macro'>"request-completed"</span>,<span class='macro_popup'>g_signal_connect_data ((consolekit), ("request-completed"), (<br>((GCallback) (quit_request_completed_consolekit))), (((gpointer<br>) (glong) (MDM_LOGOUT_ACTION_REBOOT))), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> <span class='macro'>G_CALLBACK (quit_request_completed_consolekit),<span class='macro_popup'>g_signal_connect_data ((consolekit), ("request-completed"), (<br>((GCallback) (quit_request_completed_consolekit))), (((gpointer<br>) (glong) (MDM_LOGOUT_ACTION_REBOOT))), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> <span class='macro'>GINT_TO_POINTER (MDM_LOGOUT_ACTION_REBOOT))<span class='macro_popup'>g_signal_connect_data ((consolekit), ("request-completed"), (<br>((GCallback) (quit_request_completed_consolekit))), (((gpointer<br>) (glong) (MDM_LOGOUT_ACTION_REBOOT))), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> gsm_consolekit_attempt_restart (consolekit);</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_REBOOT_MDM:</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> mdm_set_logout_action (MDM_LOGOUT_ACTION_REBOOT);</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> gtk_main_quit ();</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_SHUTDOWN:</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_SHUTDOWN_INTERACT:</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> mdm_set_logout_action (MDM_LOGOUT_ACTION_NONE);</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> <span class='macro'>g_signal_connect (systemd,<span class='macro_popup'>g_signal_connect_data ((systemd), ("request-completed"), (((GCallback<br>) (quit_request_completed_systemd))), (((gpointer) (glong) (MDM_LOGOUT_ACTION_SHUTDOWN<br>))), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> <span class='string_literal'><span class='macro'>"request-completed"</span>,<span class='macro_popup'>g_signal_connect_data ((systemd), ("request-completed"), (((GCallback<br>) (quit_request_completed_systemd))), (((gpointer) (glong) (MDM_LOGOUT_ACTION_SHUTDOWN<br>))), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> <span class='macro'>G_CALLBACK (quit_request_completed_systemd),<span class='macro_popup'>g_signal_connect_data ((systemd), ("request-completed"), (((GCallback<br>) (quit_request_completed_systemd))), (((gpointer) (glong) (MDM_LOGOUT_ACTION_SHUTDOWN<br>))), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='macro'>GINT_TO_POINTER (MDM_LOGOUT_ACTION_SHUTDOWN))<span class='macro_popup'>g_signal_connect_data ((systemd), ("request-completed"), (((GCallback<br>) (quit_request_completed_systemd))), (((gpointer) (glong) (MDM_LOGOUT_ACTION_SHUTDOWN<br>))), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> gsm_systemd_attempt_stop (systemd);</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> <span class='macro'>g_signal_connect (consolekit,<span class='macro_popup'>g_signal_connect_data ((consolekit), ("request-completed"), (<br>((GCallback) (quit_request_completed_consolekit))), (((gpointer<br>) (glong) (MDM_LOGOUT_ACTION_SHUTDOWN))), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> <span class='string_literal'><span class='macro'>"request-completed"</span>,<span class='macro_popup'>g_signal_connect_data ((consolekit), ("request-completed"), (<br>((GCallback) (quit_request_completed_consolekit))), (((gpointer<br>) (glong) (MDM_LOGOUT_ACTION_SHUTDOWN))), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> <span class='macro'>G_CALLBACK (quit_request_completed_consolekit),<span class='macro_popup'>g_signal_connect_data ((consolekit), ("request-completed"), (<br>((GCallback) (quit_request_completed_consolekit))), (((gpointer<br>) (glong) (MDM_LOGOUT_ACTION_SHUTDOWN))), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> <span class='macro'>GINT_TO_POINTER (MDM_LOGOUT_ACTION_SHUTDOWN))<span class='macro_popup'>g_signal_connect_data ((consolekit), ("request-completed"), (<br>((GCallback) (quit_request_completed_consolekit))), (((gpointer<br>) (glong) (MDM_LOGOUT_ACTION_SHUTDOWN))), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> gsm_consolekit_attempt_stop (consolekit);</td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_SHUTDOWN_MDM:</td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> mdm_set_logout_action (MDM_LOGOUT_ACTION_SHUTDOWN);</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> gtk_main_quit ();</td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-manager.c",<br> 529, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line">end_phase (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> gboolean start_next_phase = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: ending phase %s\n"</span>,</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> phase_num_to_name (priv->phase));</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> g_slist_free (priv->pending_apps);</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> priv->pending_apps = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> g_slist_free (priv->query_clients);</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> priv->query_clients = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> g_slist_free (priv->next_query_clients);</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> priv->next_query_clients = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> <span class='keyword'>if</span> (priv->phase_timeout_id > 0) {</td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> g_source_remove (priv->phase_timeout_id);</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> priv->phase_timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> <span class='keyword'>switch</span> (priv->phase) {</td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_STARTUP:</td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_INITIALIZATION:</td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_WINDOW_MANAGER:</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_PANEL:</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_DESKTOP:</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_APPLICATION:</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_RUNNING:</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> <span class='keyword'>if</span> (_log_out_is_locked_down (manager)) {</td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> g_warning (<span class='string_literal'>"Unable to logout: Logout has been locked down"</span>);</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> start_next_phase = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_QUERY_END_SESSION:</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_END_SESSION:</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> <span class='keyword'>if</span> (auto_save_is_enabled (manager))</td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> maybe_save_session (manager);</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_EXIT:</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> start_next_phase = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> gsm_manager_quit (manager);</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-manager.c",<br> 584, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>if</span> (start_next_phase) {</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> priv->phase++;</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> start_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line">app_registered (GsmApp *app,</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> priv->pending_apps = g_slist_remove (priv->pending_apps, app);</td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (app, app_registered, manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((app), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (app_registered), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> <span class='keyword'>if</span> (priv->pending_apps == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> <span class='keyword'>if</span> (priv->phase_timeout_id > 0) {</td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> g_source_remove (priv->phase_timeout_id);</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> priv->phase_timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line">on_phase_timeout (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> GSList *a;</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> priv->phase_timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line"> <span class='keyword'>switch</span> (priv->phase) {</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_STARTUP:</td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_INITIALIZATION:</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_WINDOW_MANAGER:</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_PANEL:</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_DESKTOP:</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_APPLICATION:</td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> <span class='keyword'>for</span> (a = priv->pending_apps; a; a = a->next) {</td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> g_warning (<span class='string_literal'>"Application '%s' failed to register before timeout"</span>,</td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> gsm_app_peek_app_id (a->data));</td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (a->data, app_registered, manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((a->data), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (app_registered), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> <span class='comment'>/* FIXME: what if the app was filling in a required slot? */</span></td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_RUNNING:</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_QUERY_END_SESSION:</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_END_SESSION:</td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_EXIT:</td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-manager.c",<br> 645, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line">_autostart_delay_timeout (GsmApp *app)</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="657"><td class="num" id="LN657">657</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="658"><td class="num" id="LN658">658</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="659"><td class="num" id="LN659">659</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="660"><td class="num" id="LN660">660</td><td class="line"> <span class='keyword'>if</span> (!gsm_app_peek_is_disabled (app)</td></tr> +<tr class="codeline" data-linenumber="661"><td class="num" id="LN661">661</td><td class="line"> && !gsm_app_peek_is_conditionally_disabled (app)) {</td></tr> +<tr class="codeline" data-linenumber="662"><td class="num" id="LN662">662</td><td class="line"> res = gsm_app_start (app, &error);</td></tr> +<tr class="codeline" data-linenumber="663"><td class="num" id="LN663">663</td><td class="line"> <span class='keyword'>if</span> (!res) {</td></tr> +<tr class="codeline" data-linenumber="664"><td class="num" id="LN664">664</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="665"><td class="num" id="LN665">665</td><td class="line"> g_warning (<span class='string_literal'>"Could not launch application '%s': %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="666"><td class="num" id="LN666">666</td><td class="line"> gsm_app_peek_app_id (app),</td></tr> +<tr class="codeline" data-linenumber="667"><td class="num" id="LN667">667</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="668"><td class="num" id="LN668">668</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="669"><td class="num" id="LN669">669</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="670"><td class="num" id="LN670">670</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="671"><td class="num" id="LN671">671</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="672"><td class="num" id="LN672">672</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="673"><td class="num" id="LN673">673</td><td class="line"> g_object_unref (app);</td></tr> +<tr class="codeline" data-linenumber="674"><td class="num" id="LN674">674</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="675"><td class="num" id="LN675">675</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="676"><td class="num" id="LN676">676</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="677"><td class="num" id="LN677">677</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="678"><td class="num" id="LN678">678</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="679"><td class="num" id="LN679">679</td><td class="line">_start_app (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="680"><td class="num" id="LN680">680</td><td class="line"> GsmApp *app,</td></tr> +<tr class="codeline" data-linenumber="681"><td class="num" id="LN681">681</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="682"><td class="num" id="LN682">682</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="683"><td class="num" id="LN683">683</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="684"><td class="num" id="LN684">684</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="685"><td class="num" id="LN685">685</td><td class="line"> <span class='keyword'>int</span> delay;</td></tr> +<tr class="codeline" data-linenumber="686"><td class="num" id="LN686">686</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="687"><td class="num" id="LN687">687</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="688"><td class="num" id="LN688">688</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="689"><td class="num" id="LN689">689</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="690"><td class="num" id="LN690">690</td><td class="line"> <span class='keyword'>if</span> (gsm_app_peek_phase (app) != priv->phase) {</td></tr> +<tr class="codeline" data-linenumber="691"><td class="num" id="LN691">691</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="692"><td class="num" id="LN692">692</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="693"><td class="num" id="LN693">693</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="694"><td class="num" id="LN694">694</td><td class="line"> <span class='comment'>/* Keep track of app autostart condition in order to react</span></td></tr> +<tr class="codeline" data-linenumber="695"><td class="num" id="LN695">695</td><td class="line"> <span class='comment'>* accordingly in the future. */</span></td></tr> +<tr class="codeline" data-linenumber="696"><td class="num" id="LN696">696</td><td class="line"> <span class='macro'>g_signal_connect (app,<span class='macro_popup'>g_signal_connect_data ((app), ("condition-changed"), (((GCallback<br>) (app_condition_changed))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="697"><td class="num" id="LN697">697</td><td class="line"> <span class='string_literal'><span class='macro'>"condition-changed"</span>,<span class='macro_popup'>g_signal_connect_data ((app), ("condition-changed"), (((GCallback<br>) (app_condition_changed))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="698"><td class="num" id="LN698">698</td><td class="line"> <span class='macro'>G_CALLBACK (app_condition_changed),<span class='macro_popup'>g_signal_connect_data ((app), ("condition-changed"), (((GCallback<br>) (app_condition_changed))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="699"><td class="num" id="LN699">699</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((app), ("condition-changed"), (((GCallback<br>) (app_condition_changed))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="700"><td class="num" id="LN700">700</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="701"><td class="num" id="LN701">701</td><td class="line"> <span class='keyword'>if</span> (gsm_app_peek_is_disabled (app)</td></tr> +<tr class="codeline" data-linenumber="702"><td class="num" id="LN702">702</td><td class="line"> || gsm_app_peek_is_conditionally_disabled (app)) {</td></tr> +<tr class="codeline" data-linenumber="703"><td class="num" id="LN703">703</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Skipping disabled app: %s"</span>, id);</td></tr> +<tr class="codeline" data-linenumber="704"><td class="num" id="LN704">704</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="705"><td class="num" id="LN705">705</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="706"><td class="num" id="LN706">706</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="707"><td class="num" id="LN707">707</td><td class="line"> delay = gsm_app_peek_autostart_delay (app);</td></tr> +<tr class="codeline" data-linenumber="708"><td class="num" id="LN708">708</td><td class="line"> <span class='keyword'>if</span> (delay > 0) {</td></tr> +<tr class="codeline" data-linenumber="709"><td class="num" id="LN709">709</td><td class="line"> g_timeout_add_seconds (delay,</td></tr> +<tr class="codeline" data-linenumber="710"><td class="num" id="LN710">710</td><td class="line"> (GSourceFunc)_autostart_delay_timeout,</td></tr> +<tr class="codeline" data-linenumber="711"><td class="num" id="LN711">711</td><td class="line"> <span class='macro'>g_object_ref (app)<span class='macro_popup'>((__typeof__ (app)) (g_object_ref) (app))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="712"><td class="num" id="LN712">712</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: %s is scheduled to start in %d seconds"</span>, id, delay);</td></tr> +<tr class="codeline" data-linenumber="713"><td class="num" id="LN713">713</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="714"><td class="num" id="LN714">714</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="715"><td class="num" id="LN715">715</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="716"><td class="num" id="LN716">716</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="717"><td class="num" id="LN717">717</td><td class="line"> res = gsm_app_start (app, &error);</td></tr> +<tr class="codeline" data-linenumber="718"><td class="num" id="LN718">718</td><td class="line"> <span class='keyword'>if</span> (!res) {</td></tr> +<tr class="codeline" data-linenumber="719"><td class="num" id="LN719">719</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="720"><td class="num" id="LN720">720</td><td class="line"> g_warning (<span class='string_literal'>"Could not launch application '%s': %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="721"><td class="num" id="LN721">721</td><td class="line"> gsm_app_peek_app_id (app),</td></tr> +<tr class="codeline" data-linenumber="722"><td class="num" id="LN722">722</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="723"><td class="num" id="LN723">723</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="724"><td class="num" id="LN724">724</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="725"><td class="num" id="LN725">725</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="726"><td class="num" id="LN726">726</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="727"><td class="num" id="LN727">727</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="728"><td class="num" id="LN728">728</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="729"><td class="num" id="LN729">729</td><td class="line"> <span class='keyword'>if</span> (priv->phase < GSM_MANAGER_PHASE_APPLICATION) {</td></tr> +<tr class="codeline" data-linenumber="730"><td class="num" id="LN730">730</td><td class="line"> <span class='macro'>g_signal_connect (app,<span class='macro_popup'>g_signal_connect_data ((app), ("exited"), (((GCallback) (app_registered<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="731"><td class="num" id="LN731">731</td><td class="line"> <span class='string_literal'><span class='macro'>"exited"</span>,<span class='macro_popup'>g_signal_connect_data ((app), ("exited"), (((GCallback) (app_registered<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="732"><td class="num" id="LN732">732</td><td class="line"> <span class='macro'>G_CALLBACK (app_registered),<span class='macro_popup'>g_signal_connect_data ((app), ("exited"), (((GCallback) (app_registered<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="733"><td class="num" id="LN733">733</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((app), ("exited"), (((GCallback) (app_registered<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="734"><td class="num" id="LN734">734</td><td class="line"> <span class='macro'>g_signal_connect (app,<span class='macro_popup'>g_signal_connect_data ((app), ("registered"), (((GCallback) (<br>app_registered))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="735"><td class="num" id="LN735">735</td><td class="line"> <span class='string_literal'><span class='macro'>"registered"</span>,<span class='macro_popup'>g_signal_connect_data ((app), ("registered"), (((GCallback) (<br>app_registered))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="736"><td class="num" id="LN736">736</td><td class="line"> <span class='macro'>G_CALLBACK (app_registered),<span class='macro_popup'>g_signal_connect_data ((app), ("registered"), (((GCallback) (<br>app_registered))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="737"><td class="num" id="LN737">737</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((app), ("registered"), (((GCallback) (<br>app_registered))), (manager), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="738"><td class="num" id="LN738">738</td><td class="line"> priv->pending_apps = g_slist_prepend (priv->pending_apps, app);</td></tr> +<tr class="codeline" data-linenumber="739"><td class="num" id="LN739">739</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="740"><td class="num" id="LN740">740</td><td class="line"> out:</td></tr> +<tr class="codeline" data-linenumber="741"><td class="num" id="LN741">741</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="742"><td class="num" id="LN742">742</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="743"><td class="num" id="LN743">743</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="744"><td class="num" id="LN744">744</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="745"><td class="num" id="LN745">745</td><td class="line">do_phase_startup (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="746"><td class="num" id="LN746">746</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="747"><td class="num" id="LN747">747</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="748"><td class="num" id="LN748">748</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="749"><td class="num" id="LN749">749</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="750"><td class="num" id="LN750">750</td><td class="line"> gsm_store_foreach (priv->apps,</td></tr> +<tr class="codeline" data-linenumber="751"><td class="num" id="LN751">751</td><td class="line"> (GsmStoreFunc)_start_app,</td></tr> +<tr class="codeline" data-linenumber="752"><td class="num" id="LN752">752</td><td class="line"> manager);</td></tr> +<tr class="codeline" data-linenumber="753"><td class="num" id="LN753">753</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="754"><td class="num" id="LN754">754</td><td class="line"> <span class='keyword'>if</span> (priv->pending_apps != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="755"><td class="num" id="LN755">755</td><td class="line"> <span class='keyword'>if</span> (priv->phase < GSM_MANAGER_PHASE_APPLICATION) {</td></tr> +<tr class="codeline" data-linenumber="756"><td class="num" id="LN756">756</td><td class="line"> priv->phase_timeout_id = g_timeout_add_seconds (<span class='macro'>GSM_MANAGER_PHASE_TIMEOUT<span class='macro_popup'>30</span></span>,</td></tr> +<tr class="codeline" data-linenumber="757"><td class="num" id="LN757">757</td><td class="line"> (GSourceFunc)on_phase_timeout,</td></tr> +<tr class="codeline" data-linenumber="758"><td class="num" id="LN758">758</td><td class="line"> manager);</td></tr> +<tr class="codeline" data-linenumber="759"><td class="num" id="LN759">759</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="760"><td class="num" id="LN760">760</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="761"><td class="num" id="LN761">761</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="762"><td class="num" id="LN762">762</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="763"><td class="num" id="LN763">763</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="764"><td class="num" id="LN764">764</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="765"><td class="num" id="LN765">765</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span> {</td></tr> +<tr class="codeline" data-linenumber="766"><td class="num" id="LN766">766</td><td class="line"> GsmManager *manager;</td></tr> +<tr class="codeline" data-linenumber="767"><td class="num" id="LN767">767</td><td class="line"> guint flags;</td></tr> +<tr class="codeline" data-linenumber="768"><td class="num" id="LN768">768</td><td class="line">} ClientEndSessionData;</td></tr> +<tr class="codeline" data-linenumber="769"><td class="num" id="LN769">769</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="770"><td class="num" id="LN770">770</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="771"><td class="num" id="LN771">771</td><td class="line">_client_end_session (GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="772"><td class="num" id="LN772">772</td><td class="line"> ClientEndSessionData *data)</td></tr> +<tr class="codeline" data-linenumber="773"><td class="num" id="LN773">773</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="774"><td class="num" id="LN774">774</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="775"><td class="num" id="LN775">775</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="776"><td class="num" id="LN776">776</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="777"><td class="num" id="LN777">777</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="778"><td class="num" id="LN778">778</td><td class="line"> priv = gsm_manager_get_instance_private (data->manager);</td></tr> +<tr class="codeline" data-linenumber="779"><td class="num" id="LN779">779</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="780"><td class="num" id="LN780">780</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="781"><td class="num" id="LN781">781</td><td class="line"> ret = gsm_client_end_session (client, data->flags, &error);</td></tr> +<tr class="codeline" data-linenumber="782"><td class="num" id="LN782">782</td><td class="line"> <span class='keyword'>if</span> (! ret) {</td></tr> +<tr class="codeline" data-linenumber="783"><td class="num" id="LN783">783</td><td class="line"> g_warning (<span class='string_literal'>"Unable to query client: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="784"><td class="num" id="LN784">784</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="785"><td class="num" id="LN785">785</td><td class="line"> <span class='comment'>/* FIXME: what should we do if we can't communicate with client? */</span></td></tr> +<tr class="codeline" data-linenumber="786"><td class="num" id="LN786">786</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="787"><td class="num" id="LN787">787</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: adding client to end-session clients: %s"</span>, gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="788"><td class="num" id="LN788">788</td><td class="line"> priv->query_clients = g_slist_prepend (priv->query_clients,</td></tr> +<tr class="codeline" data-linenumber="789"><td class="num" id="LN789">789</td><td class="line"> client);</td></tr> +<tr class="codeline" data-linenumber="790"><td class="num" id="LN790">790</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="791"><td class="num" id="LN791">791</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="792"><td class="num" id="LN792">792</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="793"><td class="num" id="LN793">793</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="794"><td class="num" id="LN794">794</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="795"><td class="num" id="LN795">795</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="796"><td class="num" id="LN796">796</td><td class="line">_client_end_session_helper (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="797"><td class="num" id="LN797">797</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="798"><td class="num" id="LN798">798</td><td class="line"> ClientEndSessionData *data)</td></tr> +<tr class="codeline" data-linenumber="799"><td class="num" id="LN799">799</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="800"><td class="num" id="LN800">800</td><td class="line"> <span class='keyword'>return</span> _client_end_session (client, data);</td></tr> +<tr class="codeline" data-linenumber="801"><td class="num" id="LN801">801</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="802"><td class="num" id="LN802">802</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="803"><td class="num" id="LN803">803</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="804"><td class="num" id="LN804">804</td><td class="line">do_phase_end_session (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="805"><td class="num" id="LN805">805</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="806"><td class="num" id="LN806">806</td><td class="line"> ClientEndSessionData data;</td></tr> +<tr class="codeline" data-linenumber="807"><td class="num" id="LN807">807</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="808"><td class="num" id="LN808">808</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="809"><td class="num" id="LN809">809</td><td class="line"> data.manager = manager;</td></tr> +<tr class="codeline" data-linenumber="810"><td class="num" id="LN810">810</td><td class="line"> data.flags = 0;</td></tr> +<tr class="codeline" data-linenumber="811"><td class="num" id="LN811">811</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="812"><td class="num" id="LN812">812</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="813"><td class="num" id="LN813">813</td><td class="line"> <span class='keyword'>if</span> (priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_FORCE) {</td></tr> +<tr class="codeline" data-linenumber="814"><td class="num" id="LN814">814</td><td class="line"> data.flags |= GSM_CLIENT_END_SESSION_FLAG_FORCEFUL;</td></tr> +<tr class="codeline" data-linenumber="815"><td class="num" id="LN815">815</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="816"><td class="num" id="LN816">816</td><td class="line"> <span class='keyword'>if</span> (auto_save_is_enabled (manager)) {</td></tr> +<tr class="codeline" data-linenumber="817"><td class="num" id="LN817">817</td><td class="line"> data.flags |= GSM_CLIENT_END_SESSION_FLAG_SAVE;</td></tr> +<tr class="codeline" data-linenumber="818"><td class="num" id="LN818">818</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="819"><td class="num" id="LN819">819</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="820"><td class="num" id="LN820">820</td><td class="line"> <span class='keyword'>if</span> (priv->phase_timeout_id > 0) {</td></tr> +<tr class="codeline" data-linenumber="821"><td class="num" id="LN821">821</td><td class="line"> g_source_remove (priv->phase_timeout_id);</td></tr> +<tr class="codeline" data-linenumber="822"><td class="num" id="LN822">822</td><td class="line"> priv->phase_timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="823"><td class="num" id="LN823">823</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="824"><td class="num" id="LN824">824</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="825"><td class="num" id="LN825">825</td><td class="line"> <span class='keyword'>if</span> (gsm_store_size (priv->clients) > 0) {</td></tr> +<tr class="codeline" data-linenumber="826"><td class="num" id="LN826">826</td><td class="line"> priv->phase_timeout_id = g_timeout_add_seconds (<span class='macro'>GSM_MANAGER_PHASE_TIMEOUT<span class='macro_popup'>30</span></span>,</td></tr> +<tr class="codeline" data-linenumber="827"><td class="num" id="LN827">827</td><td class="line"> (GSourceFunc)on_phase_timeout,</td></tr> +<tr class="codeline" data-linenumber="828"><td class="num" id="LN828">828</td><td class="line"> manager);</td></tr> +<tr class="codeline" data-linenumber="829"><td class="num" id="LN829">829</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="830"><td class="num" id="LN830">830</td><td class="line"> gsm_store_foreach (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="831"><td class="num" id="LN831">831</td><td class="line"> (GsmStoreFunc)_client_end_session_helper,</td></tr> +<tr class="codeline" data-linenumber="832"><td class="num" id="LN832">832</td><td class="line"> &data);</td></tr> +<tr class="codeline" data-linenumber="833"><td class="num" id="LN833">833</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="834"><td class="num" id="LN834">834</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="835"><td class="num" id="LN835">835</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="836"><td class="num" id="LN836">836</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="837"><td class="num" id="LN837">837</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="838"><td class="num" id="LN838">838</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="839"><td class="num" id="LN839">839</td><td class="line">do_phase_end_session_part_2 (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="840"><td class="num" id="LN840">840</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="841"><td class="num" id="LN841">841</td><td class="line"> ClientEndSessionData data;</td></tr> +<tr class="codeline" data-linenumber="842"><td class="num" id="LN842">842</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="843"><td class="num" id="LN843">843</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="844"><td class="num" id="LN844">844</td><td class="line"> data.manager = manager;</td></tr> +<tr class="codeline" data-linenumber="845"><td class="num" id="LN845">845</td><td class="line"> data.flags = 0;</td></tr> +<tr class="codeline" data-linenumber="846"><td class="num" id="LN846">846</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="847"><td class="num" id="LN847">847</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="848"><td class="num" id="LN848">848</td><td class="line"> <span class='keyword'>if</span> (priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_FORCE) {</td></tr> +<tr class="codeline" data-linenumber="849"><td class="num" id="LN849">849</td><td class="line"> data.flags |= GSM_CLIENT_END_SESSION_FLAG_FORCEFUL;</td></tr> +<tr class="codeline" data-linenumber="850"><td class="num" id="LN850">850</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="851"><td class="num" id="LN851">851</td><td class="line"> <span class='keyword'>if</span> (auto_save_is_enabled (manager)) {</td></tr> +<tr class="codeline" data-linenumber="852"><td class="num" id="LN852">852</td><td class="line"> data.flags |= GSM_CLIENT_END_SESSION_FLAG_SAVE;</td></tr> +<tr class="codeline" data-linenumber="853"><td class="num" id="LN853">853</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="854"><td class="num" id="LN854">854</td><td class="line"> data.flags |= GSM_CLIENT_END_SESSION_FLAG_LAST;</td></tr> +<tr class="codeline" data-linenumber="855"><td class="num" id="LN855">855</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="856"><td class="num" id="LN856">856</td><td class="line"> <span class='comment'>/* keep the timeout that was started at the beginning of the</span></td></tr> +<tr class="codeline" data-linenumber="857"><td class="num" id="LN857">857</td><td class="line"> <span class='comment'>* GSM_MANAGER_PHASE_END_SESSION phase */</span></td></tr> +<tr class="codeline" data-linenumber="858"><td class="num" id="LN858">858</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="859"><td class="num" id="LN859">859</td><td class="line"> <span class='keyword'>if</span> (g_slist_length (priv->next_query_clients) > 0) {</td></tr> +<tr class="codeline" data-linenumber="860"><td class="num" id="LN860">860</td><td class="line"> g_slist_foreach (priv->next_query_clients,</td></tr> +<tr class="codeline" data-linenumber="861"><td class="num" id="LN861">861</td><td class="line"> (GFunc)_client_end_session,</td></tr> +<tr class="codeline" data-linenumber="862"><td class="num" id="LN862">862</td><td class="line"> &data);</td></tr> +<tr class="codeline" data-linenumber="863"><td class="num" id="LN863">863</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="864"><td class="num" id="LN864">864</td><td class="line"> g_slist_free (priv->next_query_clients);</td></tr> +<tr class="codeline" data-linenumber="865"><td class="num" id="LN865">865</td><td class="line"> priv->next_query_clients = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="866"><td class="num" id="LN866">866</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="867"><td class="num" id="LN867">867</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="868"><td class="num" id="LN868">868</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="869"><td class="num" id="LN869">869</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="870"><td class="num" id="LN870">870</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="871"><td class="num" id="LN871">871</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="872"><td class="num" id="LN872">872</td><td class="line">_client_stop (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="873"><td class="num" id="LN873">873</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="874"><td class="num" id="LN874">874</td><td class="line"> gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="875"><td class="num" id="LN875">875</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="876"><td class="num" id="LN876">876</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="877"><td class="num" id="LN877">877</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="878"><td class="num" id="LN878">878</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="879"><td class="num" id="LN879">879</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="880"><td class="num" id="LN880">880</td><td class="line"> ret = gsm_client_stop (client, &error);</td></tr> +<tr class="codeline" data-linenumber="881"><td class="num" id="LN881">881</td><td class="line"> <span class='keyword'>if</span> (! ret) {</td></tr> +<tr class="codeline" data-linenumber="882"><td class="num" id="LN882">882</td><td class="line"> g_warning (<span class='string_literal'>"Unable to stop client: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="883"><td class="num" id="LN883">883</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="884"><td class="num" id="LN884">884</td><td class="line"> <span class='comment'>/* FIXME: what should we do if we can't communicate with client? */</span></td></tr> +<tr class="codeline" data-linenumber="885"><td class="num" id="LN885">885</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="886"><td class="num" id="LN886">886</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: stopped client: %s"</span>, gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="887"><td class="num" id="LN887">887</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="888"><td class="num" id="LN888">888</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="889"><td class="num" id="LN889">889</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="890"><td class="num" id="LN890">890</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="891"><td class="num" id="LN891">891</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="892"><td class="num" id="LN892">892</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="893"><td class="num" id="LN893">893</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="894"><td class="num" id="LN894">894</td><td class="line">maybe_restart_user_bus (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="895"><td class="num" id="LN895">895</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="896"><td class="num" id="LN896">896</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="897"><td class="num" id="LN897">897</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="898"><td class="num" id="LN898">898</td><td class="line"> GDBusConnection *connection;</td></tr> +<tr class="codeline" data-linenumber="899"><td class="num" id="LN899">899</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="900"><td class="num" id="LN900">900</td><td class="line"> <span class='macro'>g_autoptr(GVariant)<span class='macro_popup'>__attribute__((cleanup(glib_autoptr_cleanup_GVariant))) GVariant_autoptr</span></span> reply = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="901"><td class="num" id="LN901">901</td><td class="line"> <span class='macro'>g_autoptr(GError)<span class='macro_popup'>__attribute__((cleanup(glib_autoptr_cleanup_GError))) GError_autoptr</span></span> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="902"><td class="num" id="LN902">902</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="903"><td class="num" id="LN903">903</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="904"><td class="num" id="LN904">904</td><td class="line"> <span class='keyword'>if</span> (priv->dbus_disconnected)</td></tr> +<tr class="codeline" data-linenumber="905"><td class="num" id="LN905">905</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="906"><td class="num" id="LN906">906</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="907"><td class="num" id="LN907">907</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="908"><td class="num" id="LN908">908</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="909"><td class="num" id="LN909">909</td><td class="line"> <span class='keyword'>if</span> (!gsm_systemd_is_last_session_for_user (systemd))</td></tr> +<tr class="codeline" data-linenumber="910"><td class="num" id="LN910">910</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="911"><td class="num" id="LN911">911</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="912"><td class="num" id="LN912">912</td><td class="line"> connection = g_bus_get_sync (G_BUS_TYPE_SESSION, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &error);</td></tr> +<tr class="codeline" data-linenumber="913"><td class="num" id="LN913">913</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="914"><td class="num" id="LN914">914</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="915"><td class="num" id="LN915">915</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: failed to connect to session bus: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="916"><td class="num" id="LN916">916</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="917"><td class="num" id="LN917">917</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="918"><td class="num" id="LN918">918</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="919"><td class="num" id="LN919">919</td><td class="line"> reply = g_dbus_connection_call_sync (connection,</td></tr> +<tr class="codeline" data-linenumber="920"><td class="num" id="LN920">920</td><td class="line"> <span class='string_literal'>"org.freedesktop.systemd1"</span>,</td></tr> +<tr class="codeline" data-linenumber="921"><td class="num" id="LN921">921</td><td class="line"> <span class='string_literal'>"/org/freedesktop/systemd1"</span>,</td></tr> +<tr class="codeline" data-linenumber="922"><td class="num" id="LN922">922</td><td class="line"> <span class='string_literal'>"org.freedesktop.systemd1.Manager"</span>,</td></tr> +<tr class="codeline" data-linenumber="923"><td class="num" id="LN923">923</td><td class="line"> <span class='string_literal'>"TryRestartUnit"</span>,</td></tr> +<tr class="codeline" data-linenumber="924"><td class="num" id="LN924">924</td><td class="line"> g_variant_new (<span class='string_literal'>"(ss)"</span>, <span class='string_literal'>"dbus.service"</span>, <span class='string_literal'>"replace"</span>),</td></tr> +<tr class="codeline" data-linenumber="925"><td class="num" id="LN925">925</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="926"><td class="num" id="LN926">926</td><td class="line"> G_DBUS_CALL_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="927"><td class="num" id="LN927">927</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="928"><td class="num" id="LN928">928</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="929"><td class="num" id="LN929">929</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="930"><td class="num" id="LN930">930</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="931"><td class="num" id="LN931">931</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="932"><td class="num" id="LN932">932</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: reloading user bus failed: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="933"><td class="num" id="LN933">933</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="934"><td class="num" id="LN934">934</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="935"><td class="num" id="LN935">935</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="936"><td class="num" id="LN936">936</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="937"><td class="num" id="LN937">937</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="938"><td class="num" id="LN938">938</td><td class="line">do_phase_exit (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="939"><td class="num" id="LN939">939</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="940"><td class="num" id="LN940">940</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="941"><td class="num" id="LN941">941</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="942"><td class="num" id="LN942">942</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="943"><td class="num" id="LN943">943</td><td class="line"> <span class='keyword'>if</span> (gsm_store_size (priv->clients) > 0) {</td></tr> +<tr class="codeline" data-linenumber="944"><td class="num" id="LN944">944</td><td class="line"> gsm_store_foreach (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="945"><td class="num" id="LN945">945</td><td class="line"> (GsmStoreFunc)_client_stop,</td></tr> +<tr class="codeline" data-linenumber="946"><td class="num" id="LN946">946</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="947"><td class="num" id="LN947">947</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="948"><td class="num" id="LN948">948</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="949"><td class="num" id="LN949">949</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="950"><td class="num" id="LN950">950</td><td class="line"> maybe_restart_user_bus (manager);</td></tr> +<tr class="codeline" data-linenumber="951"><td class="num" id="LN951">951</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="952"><td class="num" id="LN952">952</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="953"><td class="num" id="LN953">953</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="954"><td class="num" id="LN954">954</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="955"><td class="num" id="LN955">955</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="956"><td class="num" id="LN956">956</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="957"><td class="num" id="LN957">957</td><td class="line">_client_query_end_session (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="958"><td class="num" id="LN958">958</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="959"><td class="num" id="LN959">959</td><td class="line"> ClientEndSessionData *data)</td></tr> +<tr class="codeline" data-linenumber="960"><td class="num" id="LN960">960</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="961"><td class="num" id="LN961">961</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="962"><td class="num" id="LN962">962</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="963"><td class="num" id="LN963">963</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="964"><td class="num" id="LN964">964</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="965"><td class="num" id="LN965">965</td><td class="line"> priv = gsm_manager_get_instance_private (data->manager);</td></tr> +<tr class="codeline" data-linenumber="966"><td class="num" id="LN966">966</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="967"><td class="num" id="LN967">967</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="968"><td class="num" id="LN968">968</td><td class="line"> ret = gsm_client_query_end_session (client, data->flags, &error);</td></tr> +<tr class="codeline" data-linenumber="969"><td class="num" id="LN969">969</td><td class="line"> <span class='keyword'>if</span> (! ret) {</td></tr> +<tr class="codeline" data-linenumber="970"><td class="num" id="LN970">970</td><td class="line"> g_warning (<span class='string_literal'>"Unable to query client: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="971"><td class="num" id="LN971">971</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="972"><td class="num" id="LN972">972</td><td class="line"> <span class='comment'>/* FIXME: what should we do if we can't communicate with client? */</span></td></tr> +<tr class="codeline" data-linenumber="973"><td class="num" id="LN973">973</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="974"><td class="num" id="LN974">974</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: adding client to query clients: %s"</span>, gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="975"><td class="num" id="LN975">975</td><td class="line"> priv->query_clients = g_slist_prepend (priv->query_clients, client);</td></tr> +<tr class="codeline" data-linenumber="976"><td class="num" id="LN976">976</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="977"><td class="num" id="LN977">977</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="978"><td class="num" id="LN978">978</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="979"><td class="num" id="LN979">979</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="980"><td class="num" id="LN980">980</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="981"><td class="num" id="LN981">981</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="982"><td class="num" id="LN982">982</td><td class="line">inhibitor_has_flag (gpointer key,</td></tr> +<tr class="codeline" data-linenumber="983"><td class="num" id="LN983">983</td><td class="line"> GsmInhibitor *inhibitor,</td></tr> +<tr class="codeline" data-linenumber="984"><td class="num" id="LN984">984</td><td class="line"> gpointer data)</td></tr> +<tr class="codeline" data-linenumber="985"><td class="num" id="LN985">985</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="986"><td class="num" id="LN986">986</td><td class="line"> guint flag;</td></tr> +<tr class="codeline" data-linenumber="987"><td class="num" id="LN987">987</td><td class="line"> guint flags;</td></tr> +<tr class="codeline" data-linenumber="988"><td class="num" id="LN988">988</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="989"><td class="num" id="LN989">989</td><td class="line"> flag = <span class='macro'>GPOINTER_TO_UINT (data)<span class='macro_popup'>((guint) (gulong) (data))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="990"><td class="num" id="LN990">990</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="991"><td class="num" id="LN991">991</td><td class="line"> flags = gsm_inhibitor_peek_flags (inhibitor);</td></tr> +<tr class="codeline" data-linenumber="992"><td class="num" id="LN992">992</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="993"><td class="num" id="LN993">993</td><td class="line"> <span class='keyword'>return</span> (flags & flag);</td></tr> +<tr class="codeline" data-linenumber="994"><td class="num" id="LN994">994</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="995"><td class="num" id="LN995">995</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="996"><td class="num" id="LN996">996</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="997"><td class="num" id="LN997">997</td><td class="line">gsm_manager_is_logout_inhibited (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="998"><td class="num" id="LN998">998</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="999"><td class="num" id="LN999">999</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="1000"><td class="num" id="LN1000">1000</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1001"><td class="num" id="LN1001">1001</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1002"><td class="num" id="LN1002">1002</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1003"><td class="num" id="LN1003">1003</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1004"><td class="num" id="LN1004">1004</td><td class="line"> <span class='keyword'>if</span> (priv->inhibitors == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1005"><td class="num" id="LN1005">1005</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1006"><td class="num" id="LN1006">1006</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1007"><td class="num" id="LN1007">1007</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1008"><td class="num" id="LN1008">1008</td><td class="line"> inhibitor = (GsmInhibitor *)gsm_store_find (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="1009"><td class="num" id="LN1009">1009</td><td class="line"> (GsmStoreFunc)inhibitor_has_flag,</td></tr> +<tr class="codeline" data-linenumber="1010"><td class="num" id="LN1010">1010</td><td class="line"> <span class='macro'>GUINT_TO_POINTER (GSM_INHIBITOR_FLAG_LOGOUT)<span class='macro_popup'>((gpointer) (gulong) (GSM_INHIBITOR_FLAG_LOGOUT))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1011"><td class="num" id="LN1011">1011</td><td class="line"> <span class='keyword'>if</span> (inhibitor == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1012"><td class="num" id="LN1012">1012</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1013"><td class="num" id="LN1013">1013</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1014"><td class="num" id="LN1014">1014</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1015"><td class="num" id="LN1015">1015</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1016"><td class="num" id="LN1016">1016</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1017"><td class="num" id="LN1017">1017</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1018"><td class="num" id="LN1018">1018</td><td class="line">gsm_manager_is_idle_inhibited (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1019"><td class="num" id="LN1019">1019</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1020"><td class="num" id="LN1020">1020</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="1021"><td class="num" id="LN1021">1021</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1022"><td class="num" id="LN1022">1022</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1023"><td class="num" id="LN1023">1023</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1024"><td class="num" id="LN1024">1024</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1025"><td class="num" id="LN1025">1025</td><td class="line"> <span class='keyword'>if</span> (priv->inhibitors == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1026"><td class="num" id="LN1026">1026</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1027"><td class="num" id="LN1027">1027</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1028"><td class="num" id="LN1028">1028</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1029"><td class="num" id="LN1029">1029</td><td class="line"> inhibitor = (GsmInhibitor *)gsm_store_find (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="1030"><td class="num" id="LN1030">1030</td><td class="line"> (GsmStoreFunc)inhibitor_has_flag,</td></tr> +<tr class="codeline" data-linenumber="1031"><td class="num" id="LN1031">1031</td><td class="line"> <span class='macro'>GUINT_TO_POINTER (GSM_INHIBITOR_FLAG_IDLE)<span class='macro_popup'>((gpointer) (gulong) (GSM_INHIBITOR_FLAG_IDLE))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1032"><td class="num" id="LN1032">1032</td><td class="line"> <span class='keyword'>if</span> (inhibitor == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1033"><td class="num" id="LN1033">1033</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1034"><td class="num" id="LN1034">1034</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1035"><td class="num" id="LN1035">1035</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1036"><td class="num" id="LN1036">1036</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1037"><td class="num" id="LN1037">1037</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1038"><td class="num" id="LN1038">1038</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1039"><td class="num" id="LN1039">1039</td><td class="line">_client_cancel_end_session (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="1040"><td class="num" id="LN1040">1040</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="1041"><td class="num" id="LN1041">1041</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1042"><td class="num" id="LN1042">1042</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1043"><td class="num" id="LN1043">1043</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="1044"><td class="num" id="LN1044">1044</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="1045"><td class="num" id="LN1045">1045</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1046"><td class="num" id="LN1046">1046</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1047"><td class="num" id="LN1047">1047</td><td class="line"> res = gsm_client_cancel_end_session (client, &error);</td></tr> +<tr class="codeline" data-linenumber="1048"><td class="num" id="LN1048">1048</td><td class="line"> <span class='keyword'>if</span> (! res) {</td></tr> +<tr class="codeline" data-linenumber="1049"><td class="num" id="LN1049">1049</td><td class="line"> g_warning (<span class='string_literal'>"Unable to cancel end session: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="1050"><td class="num" id="LN1050">1050</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="1051"><td class="num" id="LN1051">1051</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1052"><td class="num" id="LN1052">1052</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1053"><td class="num" id="LN1053">1053</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1054"><td class="num" id="LN1054">1054</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1055"><td class="num" id="LN1055">1055</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1056"><td class="num" id="LN1056">1056</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1057"><td class="num" id="LN1057">1057</td><td class="line">inhibitor_is_jit (gpointer key,</td></tr> +<tr class="codeline" data-linenumber="1058"><td class="num" id="LN1058">1058</td><td class="line"> GsmInhibitor *inhibitor,</td></tr> +<tr class="codeline" data-linenumber="1059"><td class="num" id="LN1059">1059</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1060"><td class="num" id="LN1060">1060</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1061"><td class="num" id="LN1061">1061</td><td class="line"> gboolean matches;</td></tr> +<tr class="codeline" data-linenumber="1062"><td class="num" id="LN1062">1062</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *id;</td></tr> +<tr class="codeline" data-linenumber="1063"><td class="num" id="LN1063">1063</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1064"><td class="num" id="LN1064">1064</td><td class="line"> id = gsm_inhibitor_peek_client_id (inhibitor);</td></tr> +<tr class="codeline" data-linenumber="1065"><td class="num" id="LN1065">1065</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1066"><td class="num" id="LN1066">1066</td><td class="line"> matches = (id != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> && id[0] != '\0');</td></tr> +<tr class="codeline" data-linenumber="1067"><td class="num" id="LN1067">1067</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1068"><td class="num" id="LN1068">1068</td><td class="line"> <span class='keyword'>return</span> matches;</td></tr> +<tr class="codeline" data-linenumber="1069"><td class="num" id="LN1069">1069</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1070"><td class="num" id="LN1070">1070</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1071"><td class="num" id="LN1071">1071</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1072"><td class="num" id="LN1072">1072</td><td class="line">cancel_end_session (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1073"><td class="num" id="LN1073">1073</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1074"><td class="num" id="LN1074">1074</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1075"><td class="num" id="LN1075">1075</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1076"><td class="num" id="LN1076">1076</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1077"><td class="num" id="LN1077">1077</td><td class="line"> <span class='comment'>/* just ignore if received outside of shutdown */</span></td></tr> +<tr class="codeline" data-linenumber="1078"><td class="num" id="LN1078">1078</td><td class="line"> <span class='keyword'>if</span> (priv->phase < GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="1079"><td class="num" id="LN1079">1079</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1080"><td class="num" id="LN1080">1080</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1081"><td class="num" id="LN1081">1081</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1082"><td class="num" id="LN1082">1082</td><td class="line"> <span class='comment'>/* switch back to running phase */</span></td></tr> +<tr class="codeline" data-linenumber="1083"><td class="num" id="LN1083">1083</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Cancelling the end of session"</span>);</td></tr> +<tr class="codeline" data-linenumber="1084"><td class="num" id="LN1084">1084</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1085"><td class="num" id="LN1085">1085</td><td class="line"> <span class='comment'>/* remove the dialog before we remove the inhibitors, else the dialog</span></td></tr> +<tr class="codeline" data-linenumber="1086"><td class="num" id="LN1086">1086</td><td class="line"> <span class='comment'>* will activate itself automatically when the last inhibitor will be</span></td></tr> +<tr class="codeline" data-linenumber="1087"><td class="num" id="LN1087">1087</td><td class="line"> <span class='comment'>* removed */</span></td></tr> +<tr class="codeline" data-linenumber="1088"><td class="num" id="LN1088">1088</td><td class="line"> <span class='keyword'>if</span> (priv->inhibit_dialog)</td></tr> +<tr class="codeline" data-linenumber="1089"><td class="num" id="LN1089">1089</td><td class="line"> gtk_widget_destroy (<span class='macro'>GTK_WIDGET (priv->inhibit_dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((priv->inhibit_dialog)), ((gtk_widget_get_type ())))))<br>)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1090"><td class="num" id="LN1090">1090</td><td class="line"> priv->inhibit_dialog = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1091"><td class="num" id="LN1091">1091</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1092"><td class="num" id="LN1092">1092</td><td class="line"> <span class='comment'>/* clear all JIT inhibitors */</span></td></tr> +<tr class="codeline" data-linenumber="1093"><td class="num" id="LN1093">1093</td><td class="line"> gsm_store_foreach_remove (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="1094"><td class="num" id="LN1094">1094</td><td class="line"> (GsmStoreFunc)inhibitor_is_jit,</td></tr> +<tr class="codeline" data-linenumber="1095"><td class="num" id="LN1095">1095</td><td class="line"> (gpointer)manager);</td></tr> +<tr class="codeline" data-linenumber="1096"><td class="num" id="LN1096">1096</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1097"><td class="num" id="LN1097">1097</td><td class="line"> gsm_store_foreach (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="1098"><td class="num" id="LN1098">1098</td><td class="line"> (GsmStoreFunc)_client_cancel_end_session,</td></tr> +<tr class="codeline" data-linenumber="1099"><td class="num" id="LN1099">1099</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1100"><td class="num" id="LN1100">1100</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1101"><td class="num" id="LN1101">1101</td><td class="line"> gsm_manager_set_phase (manager, GSM_MANAGER_PHASE_RUNNING);</td></tr> +<tr class="codeline" data-linenumber="1102"><td class="num" id="LN1102">1102</td><td class="line"> priv->logout_mode = GSM_MANAGER_LOGOUT_MODE_NORMAL;</td></tr> +<tr class="codeline" data-linenumber="1103"><td class="num" id="LN1103">1103</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1104"><td class="num" id="LN1104">1104</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_NONE;</td></tr> +<tr class="codeline" data-linenumber="1105"><td class="num" id="LN1105">1105</td><td class="line"> mdm_set_logout_action (MDM_LOGOUT_ACTION_NONE);</td></tr> +<tr class="codeline" data-linenumber="1106"><td class="num" id="LN1106">1106</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1107"><td class="num" id="LN1107">1107</td><td class="line"> start_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="1108"><td class="num" id="LN1108">1108</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1109"><td class="num" id="LN1109">1109</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1110"><td class="num" id="LN1110">1110</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1111"><td class="num" id="LN1111">1111</td><td class="line">process_is_running (<span class='keyword'>const</span> <span class='keyword'>char</span> * name)</td></tr> +<tr class="codeline" data-linenumber="1112"><td class="num" id="LN1112">1112</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1113"><td class="num" id="LN1113">1113</td><td class="line"> <span class='keyword'>int</span> num_processes;</td></tr> +<tr class="codeline" data-linenumber="1114"><td class="num" id="LN1114">1114</td><td class="line"> <span class='keyword'>char</span> * command = g_strdup_printf (<span class='string_literal'>"pidof %s | wc -l"</span>, name);</td></tr> +<tr class="codeline" data-linenumber="1115"><td class="num" id="LN1115">1115</td><td class="line"> FILE *fp = popen(command, <span class='string_literal'>"r"</span>);</td></tr> +<tr class="codeline" data-linenumber="1116"><td class="num" id="LN1116">1116</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1117"><td class="num" id="LN1117">1117</td><td class="line"> <span class='keyword'>if</span> (fscanf(fp, <span class='string_literal'>"%d"</span>, &num_processes) != 1)</td></tr> +<tr class="codeline" data-linenumber="1118"><td class="num" id="LN1118">1118</td><td class="line"> num_processes = 0;</td></tr> +<tr class="codeline" data-linenumber="1119"><td class="num" id="LN1119">1119</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1120"><td class="num" id="LN1120">1120</td><td class="line"> pclose(fp);</td></tr> +<tr class="codeline" data-linenumber="1121"><td class="num" id="LN1121">1121</td><td class="line"> g_free (command);</td></tr> +<tr class="codeline" data-linenumber="1122"><td class="num" id="LN1122">1122</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1123"><td class="num" id="LN1123">1123</td><td class="line"> <span class='keyword'>if</span> (num_processes > 0) {</td></tr> +<tr class="codeline" data-linenumber="1124"><td class="num" id="LN1124">1124</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1125"><td class="num" id="LN1125">1125</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1126"><td class="num" id="LN1126">1126</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1127"><td class="num" id="LN1127">1127</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1128"><td class="num" id="LN1128">1128</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1129"><td class="num" id="LN1129">1129</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1130"><td class="num" id="LN1130">1130</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1131"><td class="num" id="LN1131">1131</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1132"><td class="num" id="LN1132">1132</td><td class="line">manager_switch_user (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1133"><td class="num" id="LN1133">1133</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1134"><td class="num" id="LN1134">1134</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="1135"><td class="num" id="LN1135">1135</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="1136"><td class="num" id="LN1136">1136</td><td class="line"> <span class='keyword'>char</span> *command;</td></tr> +<tr class="codeline" data-linenumber="1137"><td class="num" id="LN1137">1137</td><td class="line"> <span class='keyword'>const</span> gchar *xdg_seat_path = g_getenv (<span class='string_literal'>"XDG_SEAT_PATH"</span>);</td></tr> +<tr class="codeline" data-linenumber="1138"><td class="num" id="LN1138">1138</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1139"><td class="num" id="LN1139">1139</td><td class="line"> <span class='comment'>/* We have to do this here and in request_switch_user() because this</span></td></tr> +<tr class="codeline" data-linenumber="1140"><td class="num" id="LN1140">1140</td><td class="line"> <span class='comment'>* function can be called at a later time, not just directly after</span></td></tr> +<tr class="codeline" data-linenumber="1141"><td class="num" id="LN1141">1141</td><td class="line"> <span class='comment'>* request_switch_user(). */</span></td></tr> +<tr class="codeline" data-linenumber="1142"><td class="num" id="LN1142">1142</td><td class="line"> <span class='keyword'>if</span> (_switch_user_is_locked_down (manager)) {</td></tr> +<tr class="codeline" data-linenumber="1143"><td class="num" id="LN1143">1143</td><td class="line"> g_warning (<span class='string_literal'>"Unable to switch user: User switching has been locked down"</span>);</td></tr> +<tr class="codeline" data-linenumber="1144"><td class="num" id="LN1144">1144</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1145"><td class="num" id="LN1145">1145</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1146"><td class="num" id="LN1146">1146</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1147"><td class="num" id="LN1147">1147</td><td class="line"> <span class='keyword'>if</span> (process_is_running(<span class='string_literal'>"mdm"</span>)) {</td></tr> +<tr class="codeline" data-linenumber="1148"><td class="num" id="LN1148">1148</td><td class="line"> <span class='comment'>/* MDM */</span></td></tr> +<tr class="codeline" data-linenumber="1149"><td class="num" id="LN1149">1149</td><td class="line"> command = g_strdup_printf (<span class='string_literal'>"%s %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="1150"><td class="num" id="LN1150">1150</td><td class="line"> <span class='macro'>MDM_FLEXISERVER_COMMAND<span class='macro_popup'>"mdmflexiserver"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1151"><td class="num" id="LN1151">1151</td><td class="line"> <span class='macro'>MDM_FLEXISERVER_ARGS<span class='macro_popup'>"--startnew Standard"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1152"><td class="num" id="LN1152">1152</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1153"><td class="num" id="LN1153">1153</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1154"><td class="num" id="LN1154">1154</td><td class="line"> res = g_spawn_command_line_sync (command, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &error);</td></tr> +<tr class="codeline" data-linenumber="1155"><td class="num" id="LN1155">1155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1156"><td class="num" id="LN1156">1156</td><td class="line"> g_free (command);</td></tr> +<tr class="codeline" data-linenumber="1157"><td class="num" id="LN1157">1157</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1158"><td class="num" id="LN1158">1158</td><td class="line"> <span class='keyword'>if</span> (! res) {</td></tr> +<tr class="codeline" data-linenumber="1159"><td class="num" id="LN1159">1159</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Unable to start MDM greeter: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="1160"><td class="num" id="LN1160">1160</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="1161"><td class="num" id="LN1161">1161</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1162"><td class="num" id="LN1162">1162</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1163"><td class="num" id="LN1163">1163</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (process_is_running(<span class='string_literal'>"gdm"</span>) || process_is_running(<span class='string_literal'>"gdm3"</span>) || process_is_running(<span class='string_literal'>"gdm-binary"</span>)) {</td></tr> +<tr class="codeline" data-linenumber="1164"><td class="num" id="LN1164">1164</td><td class="line"> <span class='comment'>/* GDM */</span></td></tr> +<tr class="codeline" data-linenumber="1165"><td class="num" id="LN1165">1165</td><td class="line"> command = g_strdup_printf (<span class='string_literal'>"%s %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="1166"><td class="num" id="LN1166">1166</td><td class="line"> <span class='macro'>GDM_FLEXISERVER_COMMAND<span class='macro_popup'>"gdmflexiserver"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1167"><td class="num" id="LN1167">1167</td><td class="line"> <span class='macro'>GDM_FLEXISERVER_ARGS<span class='macro_popup'>"--startnew Standard"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1168"><td class="num" id="LN1168">1168</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1169"><td class="num" id="LN1169">1169</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1170"><td class="num" id="LN1170">1170</td><td class="line"> res = g_spawn_command_line_sync (command, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &error);</td></tr> +<tr class="codeline" data-linenumber="1171"><td class="num" id="LN1171">1171</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1172"><td class="num" id="LN1172">1172</td><td class="line"> g_free (command);</td></tr> +<tr class="codeline" data-linenumber="1173"><td class="num" id="LN1173">1173</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1174"><td class="num" id="LN1174">1174</td><td class="line"> <span class='keyword'>if</span> (! res) {</td></tr> +<tr class="codeline" data-linenumber="1175"><td class="num" id="LN1175">1175</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Unable to start GDM greeter: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="1176"><td class="num" id="LN1176">1176</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="1177"><td class="num" id="LN1177">1177</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1178"><td class="num" id="LN1178">1178</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1179"><td class="num" id="LN1179">1179</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (xdg_seat_path != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1180"><td class="num" id="LN1180">1180</td><td class="line"> <span class='comment'>/* LightDM */</span></td></tr> +<tr class="codeline" data-linenumber="1181"><td class="num" id="LN1181">1181</td><td class="line"> GDBusProxyFlags flags = G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START;</td></tr> +<tr class="codeline" data-linenumber="1182"><td class="num" id="LN1182">1182</td><td class="line"> GDBusProxy *proxy = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1183"><td class="num" id="LN1183">1183</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1184"><td class="num" id="LN1184">1184</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1185"><td class="num" id="LN1185">1185</td><td class="line"> proxy = g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM,</td></tr> +<tr class="codeline" data-linenumber="1186"><td class="num" id="LN1186">1186</td><td class="line"> flags,</td></tr> +<tr class="codeline" data-linenumber="1187"><td class="num" id="LN1187">1187</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1188"><td class="num" id="LN1188">1188</td><td class="line"> <span class='string_literal'>"org.freedesktop.DisplayManager"</span>,</td></tr> +<tr class="codeline" data-linenumber="1189"><td class="num" id="LN1189">1189</td><td class="line"> xdg_seat_path,</td></tr> +<tr class="codeline" data-linenumber="1190"><td class="num" id="LN1190">1190</td><td class="line"> <span class='string_literal'>"org.freedesktop.DisplayManager.Seat"</span>,</td></tr> +<tr class="codeline" data-linenumber="1191"><td class="num" id="LN1191">1191</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1192"><td class="num" id="LN1192">1192</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="1193"><td class="num" id="LN1193">1193</td><td class="line"> <span class='keyword'>if</span> (proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1194"><td class="num" id="LN1194">1194</td><td class="line"> g_dbus_proxy_call_sync (proxy,</td></tr> +<tr class="codeline" data-linenumber="1195"><td class="num" id="LN1195">1195</td><td class="line"> <span class='string_literal'>"SwitchToGreeter"</span>,</td></tr> +<tr class="codeline" data-linenumber="1196"><td class="num" id="LN1196">1196</td><td class="line"> g_variant_new (<span class='string_literal'>"()"</span>),</td></tr> +<tr class="codeline" data-linenumber="1197"><td class="num" id="LN1197">1197</td><td class="line"> G_DBUS_CALL_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="1198"><td class="num" id="LN1198">1198</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="1199"><td class="num" id="LN1199">1199</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1200"><td class="num" id="LN1200">1200</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1201"><td class="num" id="LN1201">1201</td><td class="line"> g_object_unref (proxy);</td></tr> +<tr class="codeline" data-linenumber="1202"><td class="num" id="LN1202">1202</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1203"><td class="num" id="LN1203">1203</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1204"><td class="num" id="LN1204">1204</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Unable to start LightDM greeter: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="1205"><td class="num" id="LN1205">1205</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="1206"><td class="num" id="LN1206">1206</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1207"><td class="num" id="LN1207">1207</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1208"><td class="num" id="LN1208">1208</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1209"><td class="num" id="LN1209">1209</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1210"><td class="num" id="LN1210">1210</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1211"><td class="num" id="LN1211">1211</td><td class="line">sleep_lock_is_enabled (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1212"><td class="num" id="LN1212">1212</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1213"><td class="num" id="LN1213">1213</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1214"><td class="num" id="LN1214">1214</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1215"><td class="num" id="LN1215">1215</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1216"><td class="num" id="LN1216">1216</td><td class="line"> <span class='keyword'>if</span> (priv->settings_screensaver != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="1217"><td class="num" id="LN1217">1217</td><td class="line"> <span class='keyword'>return</span> g_settings_get_boolean (priv->settings_screensaver,</td></tr> +<tr class="codeline" data-linenumber="1218"><td class="num" id="LN1218">1218</td><td class="line"> <span class='macro'>KEY_SLEEP_LOCK<span class='macro_popup'>"lock-enabled"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1219"><td class="num" id="LN1219">1219</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="1220"><td class="num" id="LN1220">1220</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1221"><td class="num" id="LN1221">1221</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1222"><td class="num" id="LN1222">1222</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1223"><td class="num" id="LN1223">1223</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1224"><td class="num" id="LN1224">1224</td><td class="line">manager_perhaps_lock (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1225"><td class="num" id="LN1225">1225</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1226"><td class="num" id="LN1226">1226</td><td class="line"> gchar **screen_locker_command;</td></tr> +<tr class="codeline" data-linenumber="1227"><td class="num" id="LN1227">1227</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1228"><td class="num" id="LN1228">1228</td><td class="line"> <span class='keyword'>if</span> ((screen_locker_command = gsm_get_screen_locker_command ()) != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1229"><td class="num" id="LN1229">1229</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1230"><td class="num" id="LN1230">1230</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1231"><td class="num" id="LN1231">1231</td><td class="line"> <span class='comment'>/* only lock if mate-screensaver is set to lock */</span></td></tr> +<tr class="codeline" data-linenumber="1232"><td class="num" id="LN1232">1232</td><td class="line"> <span class='keyword'>if</span> (!g_strcmp0 (screen_locker_command[0], <span class='string_literal'>"mate-screensaver-command"</span>) &&</td></tr> +<tr class="codeline" data-linenumber="1233"><td class="num" id="LN1233">1233</td><td class="line"> !sleep_lock_is_enabled (manager)) {</td></tr> +<tr class="codeline" data-linenumber="1234"><td class="num" id="LN1234">1234</td><td class="line"> <span class='keyword'>goto</span> clear_screen_locker_command;</td></tr> +<tr class="codeline" data-linenumber="1235"><td class="num" id="LN1235">1235</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1236"><td class="num" id="LN1236">1236</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1237"><td class="num" id="LN1237">1237</td><td class="line"> <span class='comment'>/* do this sync to ensure it's on the screen when we start suspending */</span></td></tr> +<tr class="codeline" data-linenumber="1238"><td class="num" id="LN1238">1238</td><td class="line"> g_spawn_sync (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, screen_locker_command, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1239"><td class="num" id="LN1239">1239</td><td class="line"> G_SPAWN_DEFAULT | G_SPAWN_SEARCH_PATH,</td></tr> +<tr class="codeline" data-linenumber="1240"><td class="num" id="LN1240">1240</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &error);</td></tr> +<tr class="codeline" data-linenumber="1241"><td class="num" id="LN1241">1241</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1242"><td class="num" id="LN1242">1242</td><td class="line"> <span class='keyword'>if</span> (error) {</td></tr> +<tr class="codeline" data-linenumber="1243"><td class="num" id="LN1243">1243</td><td class="line"> g_warning (<span class='string_literal'>"Couldn't lock screen: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="1244"><td class="num" id="LN1244">1244</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="1245"><td class="num" id="LN1245">1245</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1246"><td class="num" id="LN1246">1246</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1247"><td class="num" id="LN1247">1247</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1248"><td class="num" id="LN1248">1248</td><td class="line"> g_warning (<span class='string_literal'>"Couldn't find any screen locker"</span>);</td></tr> +<tr class="codeline" data-linenumber="1249"><td class="num" id="LN1249">1249</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1250"><td class="num" id="LN1250">1250</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1251"><td class="num" id="LN1251">1251</td><td class="line">clear_screen_locker_command:</td></tr> +<tr class="codeline" data-linenumber="1252"><td class="num" id="LN1252">1252</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1253"><td class="num" id="LN1253">1253</td><td class="line"> g_strfreev (screen_locker_command);</td></tr> +<tr class="codeline" data-linenumber="1254"><td class="num" id="LN1254">1254</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1255"><td class="num" id="LN1255">1255</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1256"><td class="num" id="LN1256">1256</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1257"><td class="num" id="LN1257">1257</td><td class="line">manager_attempt_hibernate (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1258"><td class="num" id="LN1258">1258</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1259"><td class="num" id="LN1259">1259</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="1260"><td class="num" id="LN1260">1260</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1261"><td class="num" id="LN1261">1261</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1262"><td class="num" id="LN1262">1262</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="1263"><td class="num" id="LN1263">1263</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1264"><td class="num" id="LN1264">1264</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="1265"><td class="num" id="LN1265">1265</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1266"><td class="num" id="LN1266">1266</td><td class="line"> <span class='comment'>/* lock the screen before we suspend */</span></td></tr> +<tr class="codeline" data-linenumber="1267"><td class="num" id="LN1267">1267</td><td class="line"> manager_perhaps_lock (manager);</td></tr> +<tr class="codeline" data-linenumber="1268"><td class="num" id="LN1268">1268</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1269"><td class="num" id="LN1269">1269</td><td class="line"> gsm_systemd_attempt_hibernate (systemd);</td></tr> +<tr class="codeline" data-linenumber="1270"><td class="num" id="LN1270">1270</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1271"><td class="num" id="LN1271">1271</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1272"><td class="num" id="LN1272">1272</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="1273"><td class="num" id="LN1273">1273</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="1274"><td class="num" id="LN1274">1274</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="1275"><td class="num" id="LN1275">1275</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1276"><td class="num" id="LN1276">1276</td><td class="line"> gboolean can_hibernate = gsm_consolekit_can_hibernate (consolekit);</td></tr> +<tr class="codeline" data-linenumber="1277"><td class="num" id="LN1277">1277</td><td class="line"> <span class='keyword'>if</span> (can_hibernate) {</td></tr> +<tr class="codeline" data-linenumber="1278"><td class="num" id="LN1278">1278</td><td class="line"> <span class='comment'>/* lock the screen before we suspend */</span></td></tr> +<tr class="codeline" data-linenumber="1279"><td class="num" id="LN1279">1279</td><td class="line"> manager_perhaps_lock (manager);</td></tr> +<tr class="codeline" data-linenumber="1280"><td class="num" id="LN1280">1280</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1281"><td class="num" id="LN1281">1281</td><td class="line"> gsm_consolekit_attempt_hibernate (consolekit);</td></tr> +<tr class="codeline" data-linenumber="1282"><td class="num" id="LN1282">1282</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1283"><td class="num" id="LN1283">1283</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="1284"><td class="num" id="LN1284">1284</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1285"><td class="num" id="LN1285">1285</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="1286"><td class="num" id="LN1286">1286</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1287"><td class="num" id="LN1287">1287</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1288"><td class="num" id="LN1288">1288</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1289"><td class="num" id="LN1289">1289</td><td class="line">manager_attempt_suspend (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1290"><td class="num" id="LN1290">1290</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1291"><td class="num" id="LN1291">1291</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="1292"><td class="num" id="LN1292">1292</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1293"><td class="num" id="LN1293">1293</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1294"><td class="num" id="LN1294">1294</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="1295"><td class="num" id="LN1295">1295</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1296"><td class="num" id="LN1296">1296</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="1297"><td class="num" id="LN1297">1297</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1298"><td class="num" id="LN1298">1298</td><td class="line"> <span class='comment'>/* lock the screen before we suspend */</span></td></tr> +<tr class="codeline" data-linenumber="1299"><td class="num" id="LN1299">1299</td><td class="line"> manager_perhaps_lock (manager);</td></tr> +<tr class="codeline" data-linenumber="1300"><td class="num" id="LN1300">1300</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1301"><td class="num" id="LN1301">1301</td><td class="line"> gsm_systemd_attempt_suspend (systemd);</td></tr> +<tr class="codeline" data-linenumber="1302"><td class="num" id="LN1302">1302</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1303"><td class="num" id="LN1303">1303</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1304"><td class="num" id="LN1304">1304</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="1305"><td class="num" id="LN1305">1305</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="1306"><td class="num" id="LN1306">1306</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="1307"><td class="num" id="LN1307">1307</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1308"><td class="num" id="LN1308">1308</td><td class="line"> gboolean can_suspend = gsm_consolekit_can_suspend (consolekit);</td></tr> +<tr class="codeline" data-linenumber="1309"><td class="num" id="LN1309">1309</td><td class="line"> <span class='keyword'>if</span> (can_suspend) {</td></tr> +<tr class="codeline" data-linenumber="1310"><td class="num" id="LN1310">1310</td><td class="line"> <span class='comment'>/* lock the screen before we suspend */</span></td></tr> +<tr class="codeline" data-linenumber="1311"><td class="num" id="LN1311">1311</td><td class="line"> manager_perhaps_lock (manager);</td></tr> +<tr class="codeline" data-linenumber="1312"><td class="num" id="LN1312">1312</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1313"><td class="num" id="LN1313">1313</td><td class="line"> gsm_consolekit_attempt_suspend (consolekit);</td></tr> +<tr class="codeline" data-linenumber="1314"><td class="num" id="LN1314">1314</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1315"><td class="num" id="LN1315">1315</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="1316"><td class="num" id="LN1316">1316</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1317"><td class="num" id="LN1317">1317</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="1318"><td class="num" id="LN1318">1318</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1319"><td class="num" id="LN1319">1319</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1320"><td class="num" id="LN1320">1320</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1321"><td class="num" id="LN1321">1321</td><td class="line">do_inhibit_dialog_action (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="1322"><td class="num" id="LN1322">1322</td><td class="line"> <span class='keyword'>int</span> action)</td></tr> +<tr class="codeline" data-linenumber="1323"><td class="num" id="LN1323">1323</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1324"><td class="num" id="LN1324">1324</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1325"><td class="num" id="LN1325">1325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1326"><td class="num" id="LN1326">1326</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1327"><td class="num" id="LN1327">1327</td><td class="line"> <span class='keyword'>switch</span> (action) {</td></tr> +<tr class="codeline" data-linenumber="1328"><td class="num" id="LN1328">1328</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_ACTION_SWITCH_USER:</td></tr> +<tr class="codeline" data-linenumber="1329"><td class="num" id="LN1329">1329</td><td class="line"> manager_switch_user (manager);</td></tr> +<tr class="codeline" data-linenumber="1330"><td class="num" id="LN1330">1330</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1331"><td class="num" id="LN1331">1331</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_ACTION_HIBERNATE:</td></tr> +<tr class="codeline" data-linenumber="1332"><td class="num" id="LN1332">1332</td><td class="line"> manager_attempt_hibernate (manager);</td></tr> +<tr class="codeline" data-linenumber="1333"><td class="num" id="LN1333">1333</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1334"><td class="num" id="LN1334">1334</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_ACTION_SLEEP:</td></tr> +<tr class="codeline" data-linenumber="1335"><td class="num" id="LN1335">1335</td><td class="line"> manager_attempt_suspend (manager);</td></tr> +<tr class="codeline" data-linenumber="1336"><td class="num" id="LN1336">1336</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1337"><td class="num" id="LN1337">1337</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_ACTION_SHUTDOWN:</td></tr> +<tr class="codeline" data-linenumber="1338"><td class="num" id="LN1338">1338</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_ACTION_REBOOT:</td></tr> +<tr class="codeline" data-linenumber="1339"><td class="num" id="LN1339">1339</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_ACTION_LOGOUT:</td></tr> +<tr class="codeline" data-linenumber="1340"><td class="num" id="LN1340">1340</td><td class="line"> priv->logout_mode = GSM_MANAGER_LOGOUT_MODE_FORCE;</td></tr> +<tr class="codeline" data-linenumber="1341"><td class="num" id="LN1341">1341</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="1342"><td class="num" id="LN1342">1342</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1343"><td class="num" id="LN1343">1343</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="1344"><td class="num" id="LN1344">1344</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-manager.c",<br> 1344, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1345"><td class="num" id="LN1345">1345</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1346"><td class="num" id="LN1346">1346</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1347"><td class="num" id="LN1347">1347</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1348"><td class="num" id="LN1348">1348</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1349"><td class="num" id="LN1349">1349</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1350"><td class="num" id="LN1350">1350</td><td class="line">inhibit_dialog_response (GsmInhibitDialog *dialog,</td></tr> +<tr class="codeline" data-linenumber="1351"><td class="num" id="LN1351">1351</td><td class="line"> guint response_id,</td></tr> +<tr class="codeline" data-linenumber="1352"><td class="num" id="LN1352">1352</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1353"><td class="num" id="LN1353">1353</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1354"><td class="num" id="LN1354">1354</td><td class="line"> <span class='keyword'>int</span> action;</td></tr> +<tr class="codeline" data-linenumber="1355"><td class="num" id="LN1355">1355</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1356"><td class="num" id="LN1356">1356</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1357"><td class="num" id="LN1357">1357</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Inhibit dialog response: %d"</span>, response_id);</td></tr> +<tr class="codeline" data-linenumber="1358"><td class="num" id="LN1358">1358</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1359"><td class="num" id="LN1359">1359</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1360"><td class="num" id="LN1360">1360</td><td class="line"> <span class='comment'>/* must destroy dialog before cancelling since we'll</span></td></tr> +<tr class="codeline" data-linenumber="1361"><td class="num" id="LN1361">1361</td><td class="line"> <span class='comment'>remove JIT inhibitors and we don't want to trigger</span></td></tr> +<tr class="codeline" data-linenumber="1362"><td class="num" id="LN1362">1362</td><td class="line"> <span class='comment'>action. */</span></td></tr> +<tr class="codeline" data-linenumber="1363"><td class="num" id="LN1363">1363</td><td class="line"> g_object_get (dialog, <span class='string_literal'>"action"</span>, &action, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1364"><td class="num" id="LN1364">1364</td><td class="line"> gtk_widget_destroy (<span class='macro'>GTK_WIDGET (dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_widget_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1365"><td class="num" id="LN1365">1365</td><td class="line"> priv->inhibit_dialog = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1366"><td class="num" id="LN1366">1366</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1367"><td class="num" id="LN1367">1367</td><td class="line"> <span class='comment'>/* In case of dialog cancel, switch user, hibernate and</span></td></tr> +<tr class="codeline" data-linenumber="1368"><td class="num" id="LN1368">1368</td><td class="line"> <span class='comment'>* suspend, we just perform the respective action and return,</span></td></tr> +<tr class="codeline" data-linenumber="1369"><td class="num" id="LN1369">1369</td><td class="line"> <span class='comment'>* without shutting down the session. */</span></td></tr> +<tr class="codeline" data-linenumber="1370"><td class="num" id="LN1370">1370</td><td class="line"> <span class='keyword'>switch</span> (response_id) {</td></tr> +<tr class="codeline" data-linenumber="1371"><td class="num" id="LN1371">1371</td><td class="line"> <span class='keyword'>case</span> GTK_RESPONSE_CANCEL:</td></tr> +<tr class="codeline" data-linenumber="1372"><td class="num" id="LN1372">1372</td><td class="line"> <span class='keyword'>case</span> GTK_RESPONSE_NONE:</td></tr> +<tr class="codeline" data-linenumber="1373"><td class="num" id="LN1373">1373</td><td class="line"> <span class='keyword'>case</span> GTK_RESPONSE_DELETE_EVENT:</td></tr> +<tr class="codeline" data-linenumber="1374"><td class="num" id="LN1374">1374</td><td class="line"> <span class='keyword'>if</span> (action == GSM_LOGOUT_ACTION_LOGOUT</td></tr> +<tr class="codeline" data-linenumber="1375"><td class="num" id="LN1375">1375</td><td class="line"> || action == GSM_LOGOUT_ACTION_SHUTDOWN</td></tr> +<tr class="codeline" data-linenumber="1376"><td class="num" id="LN1376">1376</td><td class="line"> || action == GSM_LOGOUT_ACTION_REBOOT) {</td></tr> +<tr class="codeline" data-linenumber="1377"><td class="num" id="LN1377">1377</td><td class="line"> cancel_end_session (manager);</td></tr> +<tr class="codeline" data-linenumber="1378"><td class="num" id="LN1378">1378</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1379"><td class="num" id="LN1379">1379</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1380"><td class="num" id="LN1380">1380</td><td class="line"> <span class='keyword'>case</span> GTK_RESPONSE_ACCEPT:</td></tr> +<tr class="codeline" data-linenumber="1381"><td class="num" id="LN1381">1381</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: doing action %d"</span>, action);</td></tr> +<tr class="codeline" data-linenumber="1382"><td class="num" id="LN1382">1382</td><td class="line"> do_inhibit_dialog_action (manager, action);</td></tr> +<tr class="codeline" data-linenumber="1383"><td class="num" id="LN1383">1383</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1384"><td class="num" id="LN1384">1384</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="1385"><td class="num" id="LN1385">1385</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-manager.c",<br> 1385, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1386"><td class="num" id="LN1386">1386</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1387"><td class="num" id="LN1387">1387</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1388"><td class="num" id="LN1388">1388</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1389"><td class="num" id="LN1389">1389</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1390"><td class="num" id="LN1390">1390</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1391"><td class="num" id="LN1391">1391</td><td class="line">query_end_session_complete (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1392"><td class="num" id="LN1392">1392</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1393"><td class="num" id="LN1393">1393</td><td class="line"> GsmLogoutAction action;</td></tr> +<tr class="codeline" data-linenumber="1394"><td class="num" id="LN1394">1394</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1395"><td class="num" id="LN1395">1395</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1396"><td class="num" id="LN1396">1396</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1397"><td class="num" id="LN1397">1397</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1398"><td class="num" id="LN1398">1398</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: query end session complete"</span>);</td></tr> +<tr class="codeline" data-linenumber="1399"><td class="num" id="LN1399">1399</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1400"><td class="num" id="LN1400">1400</td><td class="line"> <span class='comment'>/* Remove the timeout since this can be called from outside the timer</span></td></tr> +<tr class="codeline" data-linenumber="1401"><td class="num" id="LN1401">1401</td><td class="line"> <span class='comment'>* and we don't want to have it called twice */</span></td></tr> +<tr class="codeline" data-linenumber="1402"><td class="num" id="LN1402">1402</td><td class="line"> <span class='keyword'>if</span> (priv->query_timeout_id > 0) {</td></tr> +<tr class="codeline" data-linenumber="1403"><td class="num" id="LN1403">1403</td><td class="line"> g_source_remove (priv->query_timeout_id);</td></tr> +<tr class="codeline" data-linenumber="1404"><td class="num" id="LN1404">1404</td><td class="line"> priv->query_timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="1405"><td class="num" id="LN1405">1405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1406"><td class="num" id="LN1406">1406</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1407"><td class="num" id="LN1407">1407</td><td class="line"> <span class='keyword'>if</span> (! gsm_manager_is_logout_inhibited (manager)) {</td></tr> +<tr class="codeline" data-linenumber="1408"><td class="num" id="LN1408">1408</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="1409"><td class="num" id="LN1409">1409</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1410"><td class="num" id="LN1410">1410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1411"><td class="num" id="LN1411">1411</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1412"><td class="num" id="LN1412">1412</td><td class="line"> <span class='keyword'>if</span> (priv->inhibit_dialog != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1413"><td class="num" id="LN1413">1413</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: inhibit dialog already up"</span>);</td></tr> +<tr class="codeline" data-linenumber="1414"><td class="num" id="LN1414">1414</td><td class="line"> gtk_window_present (<span class='macro'>GTK_WINDOW (priv->inhibit_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((priv->inhibit_dialog)), ((gtk_window_get_type ())))))<br>)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1415"><td class="num" id="LN1415">1415</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1416"><td class="num" id="LN1416">1416</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1417"><td class="num" id="LN1417">1417</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1418"><td class="num" id="LN1418">1418</td><td class="line"> <span class='keyword'>switch</span> (priv->logout_type) {</td></tr> +<tr class="codeline" data-linenumber="1419"><td class="num" id="LN1419">1419</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_LOGOUT:</td></tr> +<tr class="codeline" data-linenumber="1420"><td class="num" id="LN1420">1420</td><td class="line"> action = GSM_LOGOUT_ACTION_LOGOUT;</td></tr> +<tr class="codeline" data-linenumber="1421"><td class="num" id="LN1421">1421</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1422"><td class="num" id="LN1422">1422</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_REBOOT:</td></tr> +<tr class="codeline" data-linenumber="1423"><td class="num" id="LN1423">1423</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_REBOOT_INTERACT:</td></tr> +<tr class="codeline" data-linenumber="1424"><td class="num" id="LN1424">1424</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_REBOOT_MDM:</td></tr> +<tr class="codeline" data-linenumber="1425"><td class="num" id="LN1425">1425</td><td class="line"> action = GSM_LOGOUT_ACTION_REBOOT;</td></tr> +<tr class="codeline" data-linenumber="1426"><td class="num" id="LN1426">1426</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1427"><td class="num" id="LN1427">1427</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_SHUTDOWN:</td></tr> +<tr class="codeline" data-linenumber="1428"><td class="num" id="LN1428">1428</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_SHUTDOWN_INTERACT:</td></tr> +<tr class="codeline" data-linenumber="1429"><td class="num" id="LN1429">1429</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_SHUTDOWN_MDM:</td></tr> +<tr class="codeline" data-linenumber="1430"><td class="num" id="LN1430">1430</td><td class="line"> action = GSM_LOGOUT_ACTION_SHUTDOWN;</td></tr> +<tr class="codeline" data-linenumber="1431"><td class="num" id="LN1431">1431</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1432"><td class="num" id="LN1432">1432</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="1433"><td class="num" id="LN1433">1433</td><td class="line"> g_warning (<span class='string_literal'>"Unexpected logout type %d when creating inhibit dialog"</span>,</td></tr> +<tr class="codeline" data-linenumber="1434"><td class="num" id="LN1434">1434</td><td class="line"> priv->logout_type);</td></tr> +<tr class="codeline" data-linenumber="1435"><td class="num" id="LN1435">1435</td><td class="line"> action = GSM_LOGOUT_ACTION_LOGOUT;</td></tr> +<tr class="codeline" data-linenumber="1436"><td class="num" id="LN1436">1436</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1437"><td class="num" id="LN1437">1437</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1438"><td class="num" id="LN1438">1438</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1439"><td class="num" id="LN1439">1439</td><td class="line"> <span class='comment'>/* Note: GSM_LOGOUT_ACTION_SHUTDOWN and GSM_LOGOUT_ACTION_REBOOT are</span></td></tr> +<tr class="codeline" data-linenumber="1440"><td class="num" id="LN1440">1440</td><td class="line"> <span class='comment'>* actually handled the same way as GSM_LOGOUT_ACTION_LOGOUT in the</span></td></tr> +<tr class="codeline" data-linenumber="1441"><td class="num" id="LN1441">1441</td><td class="line"> <span class='comment'>* inhibit dialog; the action, if the button is clicked, will be to</span></td></tr> +<tr class="codeline" data-linenumber="1442"><td class="num" id="LN1442">1442</td><td class="line"> <span class='comment'>* simply go to the next phase. */</span></td></tr> +<tr class="codeline" data-linenumber="1443"><td class="num" id="LN1443">1443</td><td class="line"> priv->inhibit_dialog = gsm_inhibit_dialog_new (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="1444"><td class="num" id="LN1444">1444</td><td class="line"> priv->clients,</td></tr> +<tr class="codeline" data-linenumber="1445"><td class="num" id="LN1445">1445</td><td class="line"> action);</td></tr> +<tr class="codeline" data-linenumber="1446"><td class="num" id="LN1446">1446</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1447"><td class="num" id="LN1447">1447</td><td class="line"> <span class='macro'>g_signal_connect (priv->inhibit_dialog,<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="1448"><td class="num" id="LN1448">1448</td><td class="line"> <span class='string_literal'><span class='macro'>"response"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="1449"><td class="num" id="LN1449">1449</td><td class="line"> <span class='macro'>G_CALLBACK (inhibit_dialog_response),<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="1450"><td class="num" id="LN1450">1450</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1451"><td class="num" id="LN1451">1451</td><td class="line"> gtk_widget_show (priv->inhibit_dialog);</td></tr> +<tr class="codeline" data-linenumber="1452"><td class="num" id="LN1452">1452</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1453"><td class="num" id="LN1453">1453</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1454"><td class="num" id="LN1454">1454</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1455"><td class="num" id="LN1455">1455</td><td class="line"><span class='keyword'>static</span> guint32</td></tr> +<tr class="codeline" data-linenumber="1456"><td class="num" id="LN1456">1456</td><td class="line">generate_cookie (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="1457"><td class="num" id="LN1457">1457</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1458"><td class="num" id="LN1458">1458</td><td class="line"> guint32 cookie;</td></tr> +<tr class="codeline" data-linenumber="1459"><td class="num" id="LN1459">1459</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1460"><td class="num" id="LN1460">1460</td><td class="line"> cookie = (guint32)g_random_int_range (1, <span class='macro'>G_MAXINT32<span class='macro_popup'>((gint32) 0x7fffffff)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1461"><td class="num" id="LN1461">1461</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1462"><td class="num" id="LN1462">1462</td><td class="line"> <span class='keyword'>return</span> cookie;</td></tr> +<tr class="codeline" data-linenumber="1463"><td class="num" id="LN1463">1463</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1464"><td class="num" id="LN1464">1464</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1465"><td class="num" id="LN1465">1465</td><td class="line"><span class='keyword'>static</span> guint32</td></tr> +<tr class="codeline" data-linenumber="1466"><td class="num" id="LN1466">1466</td><td class="line">_generate_unique_cookie (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1467"><td class="num" id="LN1467">1467</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1468"><td class="num" id="LN1468">1468</td><td class="line"> guint32 cookie;</td></tr> +<tr class="codeline" data-linenumber="1469"><td class="num" id="LN1469">1469</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1470"><td class="num" id="LN1470">1470</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1471"><td class="num" id="LN1471">1471</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1472"><td class="num" id="LN1472">1472</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1473"><td class="num" id="LN1473">1473</td><td class="line"> <span class='keyword'>do</span> {</td></tr> +<tr class="codeline" data-linenumber="1474"><td class="num" id="LN1474">1474</td><td class="line"> cookie = generate_cookie ();</td></tr> +<tr class="codeline" data-linenumber="1475"><td class="num" id="LN1475">1475</td><td class="line"> } <span class='keyword'>while</span> (gsm_store_find (priv->inhibitors, (GsmStoreFunc)_find_by_cookie, &cookie) != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1476"><td class="num" id="LN1476">1476</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1477"><td class="num" id="LN1477">1477</td><td class="line"> <span class='keyword'>return</span> cookie;</td></tr> +<tr class="codeline" data-linenumber="1478"><td class="num" id="LN1478">1478</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1479"><td class="num" id="LN1479">1479</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1480"><td class="num" id="LN1480">1480</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1481"><td class="num" id="LN1481">1481</td><td class="line">_on_query_end_session_timeout (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1482"><td class="num" id="LN1482">1482</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1483"><td class="num" id="LN1483">1483</td><td class="line"> GSList *l;</td></tr> +<tr class="codeline" data-linenumber="1484"><td class="num" id="LN1484">1484</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1485"><td class="num" id="LN1485">1485</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1486"><td class="num" id="LN1486">1486</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1487"><td class="num" id="LN1487">1487</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1488"><td class="num" id="LN1488">1488</td><td class="line"> priv->query_timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="1489"><td class="num" id="LN1489">1489</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1490"><td class="num" id="LN1490">1490</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: query end session timed out"</span>);</td></tr> +<tr class="codeline" data-linenumber="1491"><td class="num" id="LN1491">1491</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1492"><td class="num" id="LN1492">1492</td><td class="line"> <span class='keyword'>for</span> (l = priv->query_clients; l != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; l = l->next) {</td></tr> +<tr class="codeline" data-linenumber="1493"><td class="num" id="LN1493">1493</td><td class="line"> guint cookie;</td></tr> +<tr class="codeline" data-linenumber="1494"><td class="num" id="LN1494">1494</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="1495"><td class="num" id="LN1495">1495</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *bus_name;</td></tr> +<tr class="codeline" data-linenumber="1496"><td class="num" id="LN1496">1496</td><td class="line"> <span class='keyword'>char</span> *app_id;</td></tr> +<tr class="codeline" data-linenumber="1497"><td class="num" id="LN1497">1497</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1498"><td class="num" id="LN1498">1498</td><td class="line"> g_warning (<span class='string_literal'>"Client '%s' failed to reply before timeout"</span>,</td></tr> +<tr class="codeline" data-linenumber="1499"><td class="num" id="LN1499">1499</td><td class="line"> gsm_client_peek_id (l->data));</td></tr> +<tr class="codeline" data-linenumber="1500"><td class="num" id="LN1500">1500</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1501"><td class="num" id="LN1501">1501</td><td class="line"> <span class='comment'>/* Don't add "not responding" inhibitors if logout is forced</span></td></tr> +<tr class="codeline" data-linenumber="1502"><td class="num" id="LN1502">1502</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1503"><td class="num" id="LN1503">1503</td><td class="line"> <span class='keyword'>if</span> (priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_FORCE) {</td></tr> +<tr class="codeline" data-linenumber="1504"><td class="num" id="LN1504">1504</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="1505"><td class="num" id="LN1505">1505</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1506"><td class="num" id="LN1506">1506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1507"><td class="num" id="LN1507">1507</td><td class="line"> <span class='comment'>/* Add JIT inhibit for unresponsive client */</span></td></tr> +<tr class="codeline" data-linenumber="1508"><td class="num" id="LN1508">1508</td><td class="line"> <span class='keyword'>if</span> (GSM_IS_DBUS_CLIENT (l->data)) {</td></tr> +<tr class="codeline" data-linenumber="1509"><td class="num" id="LN1509">1509</td><td class="line"> bus_name = gsm_dbus_client_get_bus_name (l->data);</td></tr> +<tr class="codeline" data-linenumber="1510"><td class="num" id="LN1510">1510</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1511"><td class="num" id="LN1511">1511</td><td class="line"> bus_name = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1512"><td class="num" id="LN1512">1512</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1513"><td class="num" id="LN1513">1513</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1514"><td class="num" id="LN1514">1514</td><td class="line"> app_id = <span class='macro'>g_strdup (gsm_client_peek_app_id (l->data))<span class='macro_popup'>g_strdup_inline (gsm_client_peek_app_id (l->data))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1515"><td class="num" id="LN1515">1515</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (app_id)<span class='macro_popup'>((app_id)==((void*)0)||(app_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1516"><td class="num" id="LN1516">1516</td><td class="line"> <span class='comment'>/* XSMP clients don't give us an app id unless we start them */</span></td></tr> +<tr class="codeline" data-linenumber="1517"><td class="num" id="LN1517">1517</td><td class="line"> g_free (app_id);</td></tr> +<tr class="codeline" data-linenumber="1518"><td class="num" id="LN1518">1518</td><td class="line"> app_id = gsm_client_get_app_name (l->data);</td></tr> +<tr class="codeline" data-linenumber="1519"><td class="num" id="LN1519">1519</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1520"><td class="num" id="LN1520">1520</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1521"><td class="num" id="LN1521">1521</td><td class="line"> cookie = _generate_unique_cookie (manager);</td></tr> +<tr class="codeline" data-linenumber="1522"><td class="num" id="LN1522">1522</td><td class="line"> inhibitor = gsm_inhibitor_new_for_client (gsm_client_peek_id (l->data),</td></tr> +<tr class="codeline" data-linenumber="1523"><td class="num" id="LN1523">1523</td><td class="line"> app_id,</td></tr> +<tr class="codeline" data-linenumber="1524"><td class="num" id="LN1524">1524</td><td class="line"> GSM_INHIBITOR_FLAG_LOGOUT,</td></tr> +<tr class="codeline" data-linenumber="1525"><td class="num" id="LN1525">1525</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Not responding"</span>)<span class='macro_popup'>gettext ("Not responding")</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1526"><td class="num" id="LN1526">1526</td><td class="line"> bus_name,</td></tr> +<tr class="codeline" data-linenumber="1527"><td class="num" id="LN1527">1527</td><td class="line"> cookie);</td></tr> +<tr class="codeline" data-linenumber="1528"><td class="num" id="LN1528">1528</td><td class="line"> g_free (app_id);</td></tr> +<tr class="codeline" data-linenumber="1529"><td class="num" id="LN1529">1529</td><td class="line"> gsm_store_add (priv->inhibitors, gsm_inhibitor_peek_id (inhibitor), <span class='macro'>G_OBJECT (inhibitor)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((inhibitor)), (((GType) ((20) << (2))))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1530"><td class="num" id="LN1530">1530</td><td class="line"> g_object_unref (inhibitor);</td></tr> +<tr class="codeline" data-linenumber="1531"><td class="num" id="LN1531">1531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1532"><td class="num" id="LN1532">1532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1533"><td class="num" id="LN1533">1533</td><td class="line"> g_slist_free (priv->query_clients);</td></tr> +<tr class="codeline" data-linenumber="1534"><td class="num" id="LN1534">1534</td><td class="line"> priv->query_clients = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1535"><td class="num" id="LN1535">1535</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1536"><td class="num" id="LN1536">1536</td><td class="line"> query_end_session_complete (manager);</td></tr> +<tr class="codeline" data-linenumber="1537"><td class="num" id="LN1537">1537</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1538"><td class="num" id="LN1538">1538</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1539"><td class="num" id="LN1539">1539</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1540"><td class="num" id="LN1540">1540</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1541"><td class="num" id="LN1541">1541</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1542"><td class="num" id="LN1542">1542</td><td class="line">do_phase_query_end_session (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1543"><td class="num" id="LN1543">1543</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1544"><td class="num" id="LN1544">1544</td><td class="line"> ClientEndSessionData data;</td></tr> +<tr class="codeline" data-linenumber="1545"><td class="num" id="LN1545">1545</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1546"><td class="num" id="LN1546">1546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1547"><td class="num" id="LN1547">1547</td><td class="line"> data.manager = manager;</td></tr> +<tr class="codeline" data-linenumber="1548"><td class="num" id="LN1548">1548</td><td class="line"> data.flags = 0;</td></tr> +<tr class="codeline" data-linenumber="1549"><td class="num" id="LN1549">1549</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1550"><td class="num" id="LN1550">1550</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1551"><td class="num" id="LN1551">1551</td><td class="line"> <span class='keyword'>if</span> (priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_FORCE) {</td></tr> +<tr class="codeline" data-linenumber="1552"><td class="num" id="LN1552">1552</td><td class="line"> data.flags |= GSM_CLIENT_END_SESSION_FLAG_FORCEFUL;</td></tr> +<tr class="codeline" data-linenumber="1553"><td class="num" id="LN1553">1553</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1554"><td class="num" id="LN1554">1554</td><td class="line"> <span class='comment'>/* We only query if an app is ready to log out, so we don't use</span></td></tr> +<tr class="codeline" data-linenumber="1555"><td class="num" id="LN1555">1555</td><td class="line"> <span class='comment'>* GSM_CLIENT_END_SESSION_FLAG_SAVE here.</span></td></tr> +<tr class="codeline" data-linenumber="1556"><td class="num" id="LN1556">1556</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1557"><td class="num" id="LN1557">1557</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1558"><td class="num" id="LN1558">1558</td><td class="line"> debug_clients (manager);</td></tr> +<tr class="codeline" data-linenumber="1559"><td class="num" id="LN1559">1559</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: sending query-end-session to clients (logout mode: %s)"</span>,</td></tr> +<tr class="codeline" data-linenumber="1560"><td class="num" id="LN1560">1560</td><td class="line"> priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_NORMAL? <span class='string_literal'>"normal"</span> :</td></tr> +<tr class="codeline" data-linenumber="1561"><td class="num" id="LN1561">1561</td><td class="line"> priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_FORCE? <span class='string_literal'>"forceful"</span>:</td></tr> +<tr class="codeline" data-linenumber="1562"><td class="num" id="LN1562">1562</td><td class="line"> <span class='string_literal'>"no confirmation"</span>);</td></tr> +<tr class="codeline" data-linenumber="1563"><td class="num" id="LN1563">1563</td><td class="line"> gsm_store_foreach (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="1564"><td class="num" id="LN1564">1564</td><td class="line"> (GsmStoreFunc)_client_query_end_session,</td></tr> +<tr class="codeline" data-linenumber="1565"><td class="num" id="LN1565">1565</td><td class="line"> &data);</td></tr> +<tr class="codeline" data-linenumber="1566"><td class="num" id="LN1566">1566</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1567"><td class="num" id="LN1567">1567</td><td class="line"> <span class='comment'>/* This phase doesn't time out unless logout is forced. Typically, this</span></td></tr> +<tr class="codeline" data-linenumber="1568"><td class="num" id="LN1568">1568</td><td class="line"> <span class='comment'>* separate timer is only used to show UI. */</span></td></tr> +<tr class="codeline" data-linenumber="1569"><td class="num" id="LN1569">1569</td><td class="line"> priv->query_timeout_id = g_timeout_add_seconds (1, (GSourceFunc)_on_query_end_session_timeout, manager);</td></tr> +<tr class="codeline" data-linenumber="1570"><td class="num" id="LN1570">1570</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1571"><td class="num" id="LN1571">1571</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1572"><td class="num" id="LN1572">1572</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1573"><td class="num" id="LN1573">1573</td><td class="line">update_idle (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1574"><td class="num" id="LN1574">1574</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1575"><td class="num" id="LN1575">1575</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1576"><td class="num" id="LN1576">1576</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1577"><td class="num" id="LN1577">1577</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1578"><td class="num" id="LN1578">1578</td><td class="line"> <span class='keyword'>if</span> (gsm_manager_is_idle_inhibited (manager)) {</td></tr> +<tr class="codeline" data-linenumber="1579"><td class="num" id="LN1579">1579</td><td class="line"> gsm_presence_set_idle_enabled (priv->presence, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1580"><td class="num" id="LN1580">1580</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1581"><td class="num" id="LN1581">1581</td><td class="line"> gsm_presence_set_idle_enabled (priv->presence, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1582"><td class="num" id="LN1582">1582</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1583"><td class="num" id="LN1583">1583</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1584"><td class="num" id="LN1584">1584</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1585"><td class="num" id="LN1585">1585</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1586"><td class="num" id="LN1586">1586</td><td class="line">start_phase (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1587"><td class="num" id="LN1587">1587</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1588"><td class="num" id="LN1588">1588</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1589"><td class="num" id="LN1589">1589</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1590"><td class="num" id="LN1590">1590</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1591"><td class="num" id="LN1591">1591</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1592"><td class="num" id="LN1592">1592</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: starting phase %s\n"</span>,</td></tr> +<tr class="codeline" data-linenumber="1593"><td class="num" id="LN1593">1593</td><td class="line"> phase_num_to_name (priv->phase));</td></tr> +<tr class="codeline" data-linenumber="1594"><td class="num" id="LN1594">1594</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1595"><td class="num" id="LN1595">1595</td><td class="line"> <span class='comment'>/* reset state */</span></td></tr> +<tr class="codeline" data-linenumber="1596"><td class="num" id="LN1596">1596</td><td class="line"> g_slist_free (priv->pending_apps);</td></tr> +<tr class="codeline" data-linenumber="1597"><td class="num" id="LN1597">1597</td><td class="line"> priv->pending_apps = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1598"><td class="num" id="LN1598">1598</td><td class="line"> g_slist_free (priv->query_clients);</td></tr> +<tr class="codeline" data-linenumber="1599"><td class="num" id="LN1599">1599</td><td class="line"> priv->query_clients = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1600"><td class="num" id="LN1600">1600</td><td class="line"> g_slist_free (priv->next_query_clients);</td></tr> +<tr class="codeline" data-linenumber="1601"><td class="num" id="LN1601">1601</td><td class="line"> priv->next_query_clients = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1602"><td class="num" id="LN1602">1602</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1603"><td class="num" id="LN1603">1603</td><td class="line"> <span class='keyword'>if</span> (priv->query_timeout_id > 0) {</td></tr> +<tr class="codeline" data-linenumber="1604"><td class="num" id="LN1604">1604</td><td class="line"> g_source_remove (priv->query_timeout_id);</td></tr> +<tr class="codeline" data-linenumber="1605"><td class="num" id="LN1605">1605</td><td class="line"> priv->query_timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="1606"><td class="num" id="LN1606">1606</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1607"><td class="num" id="LN1607">1607</td><td class="line"> <span class='keyword'>if</span> (priv->phase_timeout_id > 0) {</td></tr> +<tr class="codeline" data-linenumber="1608"><td class="num" id="LN1608">1608</td><td class="line"> g_source_remove (priv->phase_timeout_id);</td></tr> +<tr class="codeline" data-linenumber="1609"><td class="num" id="LN1609">1609</td><td class="line"> priv->phase_timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="1610"><td class="num" id="LN1610">1610</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1611"><td class="num" id="LN1611">1611</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1612"><td class="num" id="LN1612">1612</td><td class="line"> <span class='keyword'>switch</span> (priv->phase) {</td></tr> +<tr class="codeline" data-linenumber="1613"><td class="num" id="LN1613">1613</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_STARTUP:</td></tr> +<tr class="codeline" data-linenumber="1614"><td class="num" id="LN1614">1614</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_INITIALIZATION:</td></tr> +<tr class="codeline" data-linenumber="1615"><td class="num" id="LN1615">1615</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_WINDOW_MANAGER:</td></tr> +<tr class="codeline" data-linenumber="1616"><td class="num" id="LN1616">1616</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_PANEL:</td></tr> +<tr class="codeline" data-linenumber="1617"><td class="num" id="LN1617">1617</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_DESKTOP:</td></tr> +<tr class="codeline" data-linenumber="1618"><td class="num" id="LN1618">1618</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_APPLICATION:</td></tr> +<tr class="codeline" data-linenumber="1619"><td class="num" id="LN1619">1619</td><td class="line"> do_phase_startup (manager);</td></tr> +<tr class="codeline" data-linenumber="1620"><td class="num" id="LN1620">1620</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1621"><td class="num" id="LN1621">1621</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_RUNNING:</td></tr> +<tr class="codeline" data-linenumber="1622"><td class="num" id="LN1622">1622</td><td class="line"> g_signal_emit (manager, signals[SESSION_RUNNING], 0);</td></tr> +<tr class="codeline" data-linenumber="1623"><td class="num" id="LN1623">1623</td><td class="line"> update_idle (manager);</td></tr> +<tr class="codeline" data-linenumber="1624"><td class="num" id="LN1624">1624</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1625"><td class="num" id="LN1625">1625</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_QUERY_END_SESSION:</td></tr> +<tr class="codeline" data-linenumber="1626"><td class="num" id="LN1626">1626</td><td class="line"> do_phase_query_end_session (manager);</td></tr> +<tr class="codeline" data-linenumber="1627"><td class="num" id="LN1627">1627</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1628"><td class="num" id="LN1628">1628</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_END_SESSION:</td></tr> +<tr class="codeline" data-linenumber="1629"><td class="num" id="LN1629">1629</td><td class="line"> do_phase_end_session (manager);</td></tr> +<tr class="codeline" data-linenumber="1630"><td class="num" id="LN1630">1630</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1631"><td class="num" id="LN1631">1631</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_EXIT:</td></tr> +<tr class="codeline" data-linenumber="1632"><td class="num" id="LN1632">1632</td><td class="line"> do_phase_exit (manager);</td></tr> +<tr class="codeline" data-linenumber="1633"><td class="num" id="LN1633">1633</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1634"><td class="num" id="LN1634">1634</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="1635"><td class="num" id="LN1635">1635</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-manager.c",<br> 1635, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1636"><td class="num" id="LN1636">1636</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1637"><td class="num" id="LN1637">1637</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1638"><td class="num" id="LN1638">1638</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1639"><td class="num" id="LN1639">1639</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1640"><td class="num" id="LN1640">1640</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1641"><td class="num" id="LN1641">1641</td><td class="line">_debug_app_for_phase (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="1642"><td class="num" id="LN1642">1642</td><td class="line"> GsmApp *app,</td></tr> +<tr class="codeline" data-linenumber="1643"><td class="num" id="LN1643">1643</td><td class="line"> gpointer data)</td></tr> +<tr class="codeline" data-linenumber="1644"><td class="num" id="LN1644">1644</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1645"><td class="num" id="LN1645">1645</td><td class="line"> guint phase;</td></tr> +<tr class="codeline" data-linenumber="1646"><td class="num" id="LN1646">1646</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1647"><td class="num" id="LN1647">1647</td><td class="line"> phase = <span class='macro'>GPOINTER_TO_UINT (data)<span class='macro_popup'>((guint) (gulong) (data))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1648"><td class="num" id="LN1648">1648</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1649"><td class="num" id="LN1649">1649</td><td class="line"> <span class='keyword'>if</span> (gsm_app_peek_phase (app) != phase) {</td></tr> +<tr class="codeline" data-linenumber="1650"><td class="num" id="LN1650">1650</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1651"><td class="num" id="LN1651">1651</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1652"><td class="num" id="LN1652">1652</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1653"><td class="num" id="LN1653">1653</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager:\tID: %s\tapp-id:%s\tis-disabled:%d\tis-conditionally-disabled:%d\tis-delayed:%d"</span>,</td></tr> +<tr class="codeline" data-linenumber="1654"><td class="num" id="LN1654">1654</td><td class="line"> gsm_app_peek_id (app),</td></tr> +<tr class="codeline" data-linenumber="1655"><td class="num" id="LN1655">1655</td><td class="line"> gsm_app_peek_app_id (app),</td></tr> +<tr class="codeline" data-linenumber="1656"><td class="num" id="LN1656">1656</td><td class="line"> gsm_app_peek_is_disabled (app),</td></tr> +<tr class="codeline" data-linenumber="1657"><td class="num" id="LN1657">1657</td><td class="line"> gsm_app_peek_is_conditionally_disabled (app),</td></tr> +<tr class="codeline" data-linenumber="1658"><td class="num" id="LN1658">1658</td><td class="line"> (gsm_app_peek_autostart_delay (app) > 0));</td></tr> +<tr class="codeline" data-linenumber="1659"><td class="num" id="LN1659">1659</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1660"><td class="num" id="LN1660">1660</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1661"><td class="num" id="LN1661">1661</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1662"><td class="num" id="LN1662">1662</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1663"><td class="num" id="LN1663">1663</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1664"><td class="num" id="LN1664">1664</td><td class="line">debug_app_summary (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1665"><td class="num" id="LN1665">1665</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1666"><td class="num" id="LN1666">1666</td><td class="line"> guint phase;</td></tr> +<tr class="codeline" data-linenumber="1667"><td class="num" id="LN1667">1667</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1668"><td class="num" id="LN1668">1668</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1669"><td class="num" id="LN1669">1669</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1670"><td class="num" id="LN1670">1670</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1671"><td class="num" id="LN1671">1671</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: App startup summary"</span>);</td></tr> +<tr class="codeline" data-linenumber="1672"><td class="num" id="LN1672">1672</td><td class="line"> <span class='keyword'>for</span> (phase = GSM_MANAGER_PHASE_INITIALIZATION; phase < GSM_MANAGER_PHASE_RUNNING; phase++) {</td></tr> +<tr class="codeline" data-linenumber="1673"><td class="num" id="LN1673">1673</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Phase %s"</span>, phase_num_to_name (phase));</td></tr> +<tr class="codeline" data-linenumber="1674"><td class="num" id="LN1674">1674</td><td class="line"> gsm_store_foreach (priv->apps,</td></tr> +<tr class="codeline" data-linenumber="1675"><td class="num" id="LN1675">1675</td><td class="line"> (GsmStoreFunc)_debug_app_for_phase,</td></tr> +<tr class="codeline" data-linenumber="1676"><td class="num" id="LN1676">1676</td><td class="line"> <span class='macro'>GUINT_TO_POINTER (phase)<span class='macro_popup'>((gpointer) (gulong) (phase))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1677"><td class="num" id="LN1677">1677</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1678"><td class="num" id="LN1678">1678</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1679"><td class="num" id="LN1679">1679</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1680"><td class="num" id="LN1680">1680</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1681"><td class="num" id="LN1681">1681</td><td class="line">gsm_manager_start (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1682"><td class="num" id="LN1682">1682</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1683"><td class="num" id="LN1683">1683</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: GSM starting to manage"</span>);</td></tr> +<tr class="codeline" data-linenumber="1684"><td class="num" id="LN1684">1684</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1685"><td class="num" id="LN1685">1685</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_MANAGER (manager))<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1686"><td class="num" id="LN1686">1686</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1687"><td class="num" id="LN1687">1687</td><td class="line"> gsm_manager_set_phase (manager, GSM_MANAGER_PHASE_INITIALIZATION);</td></tr> +<tr class="codeline" data-linenumber="1688"><td class="num" id="LN1688">1688</td><td class="line"> debug_app_summary (manager);</td></tr> +<tr class="codeline" data-linenumber="1689"><td class="num" id="LN1689">1689</td><td class="line"> start_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="1690"><td class="num" id="LN1690">1690</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1691"><td class="num" id="LN1691">1691</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1692"><td class="num" id="LN1692">1692</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1693"><td class="num" id="LN1693">1693</td><td class="line">_gsm_manager_set_renderer (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="1694"><td class="num" id="LN1694">1694</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *renderer)</td></tr> +<tr class="codeline" data-linenumber="1695"><td class="num" id="LN1695">1695</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1696"><td class="num" id="LN1696">1696</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1697"><td class="num" id="LN1697">1697</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1698"><td class="num" id="LN1698">1698</td><td class="line"> g_free (priv->renderer);</td></tr> +<tr class="codeline" data-linenumber="1699"><td class="num" id="LN1699">1699</td><td class="line"> priv->renderer = <span class='macro'>g_strdup (renderer)<span class='macro_popup'>g_strdup_inline (renderer)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1700"><td class="num" id="LN1700">1700</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1701"><td class="num" id="LN1701">1701</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1702"><td class="num" id="LN1702">1702</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1703"><td class="num" id="LN1703">1703</td><td class="line">_app_has_app_id (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="1704"><td class="num" id="LN1704">1704</td><td class="line"> GsmApp *app,</td></tr> +<tr class="codeline" data-linenumber="1705"><td class="num" id="LN1705">1705</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *app_id_a)</td></tr> +<tr class="codeline" data-linenumber="1706"><td class="num" id="LN1706">1706</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1707"><td class="num" id="LN1707">1707</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *app_id_b;</td></tr> +<tr class="codeline" data-linenumber="1708"><td class="num" id="LN1708">1708</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1709"><td class="num" id="LN1709">1709</td><td class="line"> app_id_b = gsm_app_peek_app_id (app);</td></tr> +<tr class="codeline" data-linenumber="1710"><td class="num" id="LN1710">1710</td><td class="line"> <span class='keyword'>return</span> (app_id_b != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> && strcmp (app_id_a, app_id_b) == 0);</td></tr> +<tr class="codeline" data-linenumber="1711"><td class="num" id="LN1711">1711</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1712"><td class="num" id="LN1712">1712</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1713"><td class="num" id="LN1713">1713</td><td class="line"><span class='keyword'>static</span> GsmApp *</td></tr> +<tr class="codeline" data-linenumber="1714"><td class="num" id="LN1714">1714</td><td class="line">find_app_for_app_id (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="1715"><td class="num" id="LN1715">1715</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *app_id)</td></tr> +<tr class="codeline" data-linenumber="1716"><td class="num" id="LN1716">1716</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1717"><td class="num" id="LN1717">1717</td><td class="line"> GsmApp *app;</td></tr> +<tr class="codeline" data-linenumber="1718"><td class="num" id="LN1718">1718</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1719"><td class="num" id="LN1719">1719</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1720"><td class="num" id="LN1720">1720</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1721"><td class="num" id="LN1721">1721</td><td class="line"> app = (GsmApp *)gsm_store_find (priv->apps,</td></tr> +<tr class="codeline" data-linenumber="1722"><td class="num" id="LN1722">1722</td><td class="line"> (GsmStoreFunc)_app_has_app_id,</td></tr> +<tr class="codeline" data-linenumber="1723"><td class="num" id="LN1723">1723</td><td class="line"> (<span class='keyword'>char</span> *)app_id);</td></tr> +<tr class="codeline" data-linenumber="1724"><td class="num" id="LN1724">1724</td><td class="line"> <span class='keyword'>return</span> app;</td></tr> +<tr class="codeline" data-linenumber="1725"><td class="num" id="LN1725">1725</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1726"><td class="num" id="LN1726">1726</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1727"><td class="num" id="LN1727">1727</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1728"><td class="num" id="LN1728">1728</td><td class="line">inhibitor_has_client_id (gpointer key,</td></tr> +<tr class="codeline" data-linenumber="1729"><td class="num" id="LN1729">1729</td><td class="line"> GsmInhibitor *inhibitor,</td></tr> +<tr class="codeline" data-linenumber="1730"><td class="num" id="LN1730">1730</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *client_id_a)</td></tr> +<tr class="codeline" data-linenumber="1731"><td class="num" id="LN1731">1731</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1732"><td class="num" id="LN1732">1732</td><td class="line"> gboolean matches;</td></tr> +<tr class="codeline" data-linenumber="1733"><td class="num" id="LN1733">1733</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *client_id_b;</td></tr> +<tr class="codeline" data-linenumber="1734"><td class="num" id="LN1734">1734</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1735"><td class="num" id="LN1735">1735</td><td class="line"> client_id_b = gsm_inhibitor_peek_client_id (inhibitor);</td></tr> +<tr class="codeline" data-linenumber="1736"><td class="num" id="LN1736">1736</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1737"><td class="num" id="LN1737">1737</td><td class="line"> matches = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1738"><td class="num" id="LN1738">1738</td><td class="line"> <span class='keyword'>if</span> (! <span class='macro'>IS_STRING_EMPTY (client_id_a)<span class='macro_popup'>((client_id_a)==((void*)0)||(client_id_a)[0]=='\0')</span></span> && ! <span class='macro'>IS_STRING_EMPTY (client_id_b)<span class='macro_popup'>((client_id_b)==((void*)0)||(client_id_b)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1739"><td class="num" id="LN1739">1739</td><td class="line"> matches = (strcmp (client_id_a, client_id_b) == 0);</td></tr> +<tr class="codeline" data-linenumber="1740"><td class="num" id="LN1740">1740</td><td class="line"> <span class='keyword'>if</span> (matches) {</td></tr> +<tr class="codeline" data-linenumber="1741"><td class="num" id="LN1741">1741</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: removing JIT inhibitor for %s for reason '%s'"</span>,</td></tr> +<tr class="codeline" data-linenumber="1742"><td class="num" id="LN1742">1742</td><td class="line"> gsm_inhibitor_peek_client_id (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="1743"><td class="num" id="LN1743">1743</td><td class="line"> gsm_inhibitor_peek_reason (inhibitor));</td></tr> +<tr class="codeline" data-linenumber="1744"><td class="num" id="LN1744">1744</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1745"><td class="num" id="LN1745">1745</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1746"><td class="num" id="LN1746">1746</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1747"><td class="num" id="LN1747">1747</td><td class="line"> <span class='keyword'>return</span> matches;</td></tr> +<tr class="codeline" data-linenumber="1748"><td class="num" id="LN1748">1748</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1749"><td class="num" id="LN1749">1749</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1750"><td class="num" id="LN1750">1750</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1751"><td class="num" id="LN1751">1751</td><td class="line">_app_has_startup_id (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="1752"><td class="num" id="LN1752">1752</td><td class="line"> GsmApp *app,</td></tr> +<tr class="codeline" data-linenumber="1753"><td class="num" id="LN1753">1753</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id_a)</td></tr> +<tr class="codeline" data-linenumber="1754"><td class="num" id="LN1754">1754</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1755"><td class="num" id="LN1755">1755</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id_b;</td></tr> +<tr class="codeline" data-linenumber="1756"><td class="num" id="LN1756">1756</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1757"><td class="num" id="LN1757">1757</td><td class="line"> startup_id_b = gsm_app_peek_startup_id (app);</td></tr> +<tr class="codeline" data-linenumber="1758"><td class="num" id="LN1758">1758</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1759"><td class="num" id="LN1759">1759</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (startup_id_b)<span class='macro_popup'>((startup_id_b)==((void*)0)||(startup_id_b)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1760"><td class="num" id="LN1760">1760</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1761"><td class="num" id="LN1761">1761</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1762"><td class="num" id="LN1762">1762</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1763"><td class="num" id="LN1763">1763</td><td class="line"> <span class='keyword'>return</span> (strcmp (startup_id_a, startup_id_b) == 0);</td></tr> +<tr class="codeline" data-linenumber="1764"><td class="num" id="LN1764">1764</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1765"><td class="num" id="LN1765">1765</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1766"><td class="num" id="LN1766">1766</td><td class="line"><span class='keyword'>static</span> GsmApp *</td></tr> +<tr class="codeline" data-linenumber="1767"><td class="num" id="LN1767">1767</td><td class="line">find_app_for_startup_id (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="1768"><td class="num" id="LN1768">1768</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id)</td></tr> +<tr class="codeline" data-linenumber="1769"><td class="num" id="LN1769">1769</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1770"><td class="num" id="LN1770">1770</td><td class="line"> GsmApp *found_app;</td></tr> +<tr class="codeline" data-linenumber="1771"><td class="num" id="LN1771">1771</td><td class="line"> GSList *a;</td></tr> +<tr class="codeline" data-linenumber="1772"><td class="num" id="LN1772">1772</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1773"><td class="num" id="LN1773">1773</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1774"><td class="num" id="LN1774">1774</td><td class="line"> found_app = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1775"><td class="num" id="LN1775">1775</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1776"><td class="num" id="LN1776">1776</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1777"><td class="num" id="LN1777">1777</td><td class="line"> <span class='comment'>/* If we're starting up the session, try to match the new client</span></td></tr> +<tr class="codeline" data-linenumber="1778"><td class="num" id="LN1778">1778</td><td class="line"> <span class='comment'>* with one pending apps for the current phase. If not, try to match</span></td></tr> +<tr class="codeline" data-linenumber="1779"><td class="num" id="LN1779">1779</td><td class="line"> <span class='comment'>* with any of the autostarted apps. */</span></td></tr> +<tr class="codeline" data-linenumber="1780"><td class="num" id="LN1780">1780</td><td class="line"> <span class='keyword'>if</span> (priv->phase < GSM_MANAGER_PHASE_APPLICATION) {</td></tr> +<tr class="codeline" data-linenumber="1781"><td class="num" id="LN1781">1781</td><td class="line"> <span class='keyword'>for</span> (a = priv->pending_apps; a != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; a = a->next) {</td></tr> +<tr class="codeline" data-linenumber="1782"><td class="num" id="LN1782">1782</td><td class="line"> GsmApp *app = GSM_APP (a->data);</td></tr> +<tr class="codeline" data-linenumber="1783"><td class="num" id="LN1783">1783</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1784"><td class="num" id="LN1784">1784</td><td class="line"> <span class='keyword'>if</span> (strcmp (startup_id, gsm_app_peek_startup_id (app)) == 0) {</td></tr> +<tr class="codeline" data-linenumber="1785"><td class="num" id="LN1785">1785</td><td class="line"> found_app = app;</td></tr> +<tr class="codeline" data-linenumber="1786"><td class="num" id="LN1786">1786</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1787"><td class="num" id="LN1787">1787</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1788"><td class="num" id="LN1788">1788</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1789"><td class="num" id="LN1789">1789</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1790"><td class="num" id="LN1790">1790</td><td class="line"> GsmApp *app;</td></tr> +<tr class="codeline" data-linenumber="1791"><td class="num" id="LN1791">1791</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1792"><td class="num" id="LN1792">1792</td><td class="line"> app = (GsmApp *)gsm_store_find (priv->apps,</td></tr> +<tr class="codeline" data-linenumber="1793"><td class="num" id="LN1793">1793</td><td class="line"> (GsmStoreFunc)_app_has_startup_id,</td></tr> +<tr class="codeline" data-linenumber="1794"><td class="num" id="LN1794">1794</td><td class="line"> (<span class='keyword'>char</span> *)startup_id);</td></tr> +<tr class="codeline" data-linenumber="1795"><td class="num" id="LN1795">1795</td><td class="line"> <span class='keyword'>if</span> (app != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1796"><td class="num" id="LN1796">1796</td><td class="line"> found_app = app;</td></tr> +<tr class="codeline" data-linenumber="1797"><td class="num" id="LN1797">1797</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1798"><td class="num" id="LN1798">1798</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1799"><td class="num" id="LN1799">1799</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1800"><td class="num" id="LN1800">1800</td><td class="line"> out:</td></tr> +<tr class="codeline" data-linenumber="1801"><td class="num" id="LN1801">1801</td><td class="line"> <span class='keyword'>return</span> found_app;</td></tr> +<tr class="codeline" data-linenumber="1802"><td class="num" id="LN1802">1802</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1803"><td class="num" id="LN1803">1803</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1804"><td class="num" id="LN1804">1804</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1805"><td class="num" id="LN1805">1805</td><td class="line">_disconnect_client (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="1806"><td class="num" id="LN1806">1806</td><td class="line"> GsmClient *client)</td></tr> +<tr class="codeline" data-linenumber="1807"><td class="num" id="LN1807">1807</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1808"><td class="num" id="LN1808">1808</td><td class="line"> gboolean is_condition_client;</td></tr> +<tr class="codeline" data-linenumber="1809"><td class="num" id="LN1809">1809</td><td class="line"> GsmApp *app;</td></tr> +<tr class="codeline" data-linenumber="1810"><td class="num" id="LN1810">1810</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="1811"><td class="num" id="LN1811">1811</td><td class="line"> gboolean <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> res;</td></tr> +<tr class="codeline" data-linenumber="1812"><td class="num" id="LN1812">1812</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *app_id;</td></tr> +<tr class="codeline" data-linenumber="1813"><td class="num" id="LN1813">1813</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id;</td></tr> +<tr class="codeline" data-linenumber="1814"><td class="num" id="LN1814">1814</td><td class="line"> gboolean app_restart;</td></tr> +<tr class="codeline" data-linenumber="1815"><td class="num" id="LN1815">1815</td><td class="line"> GsmClientRestartStyle client_restart_hint;</td></tr> +<tr class="codeline" data-linenumber="1816"><td class="num" id="LN1816">1816</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1817"><td class="num" id="LN1817">1817</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1818"><td class="num" id="LN1818">1818</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: disconnect client: %s"</span>, gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="1819"><td class="num" id="LN1819">1819</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1820"><td class="num" id="LN1820">1820</td><td class="line"> <span class='comment'>/* take a ref so it doesn't get finalized */</span></td></tr> +<tr class="codeline" data-linenumber="1821"><td class="num" id="LN1821">1821</td><td class="line"> <span class='macro'>g_object_ref (client)<span class='macro_popup'>((__typeof__ (client)) (g_object_ref) (client))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1822"><td class="num" id="LN1822">1822</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1823"><td class="num" id="LN1823">1823</td><td class="line"> gsm_client_set_status (client, GSM_CLIENT_FINISHED);</td></tr> +<tr class="codeline" data-linenumber="1824"><td class="num" id="LN1824">1824</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1825"><td class="num" id="LN1825">1825</td><td class="line"> is_condition_client = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1826"><td class="num" id="LN1826">1826</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1827"><td class="num" id="LN1827">1827</td><td class="line"> <span class='keyword'>if</span> (g_slist_find (priv->condition_clients, client)) {</td></tr> +<tr class="codeline" data-linenumber="1828"><td class="num" id="LN1828">1828</td><td class="line"> priv->condition_clients = g_slist_remove (priv->condition_clients, client);</td></tr> +<tr class="codeline" data-linenumber="1829"><td class="num" id="LN1829">1829</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1830"><td class="num" id="LN1830">1830</td><td class="line"> is_condition_client = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1831"><td class="num" id="LN1831">1831</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1832"><td class="num" id="LN1832">1832</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1833"><td class="num" id="LN1833">1833</td><td class="line"> <span class='comment'>/* remove any inhibitors for this client */</span></td></tr> +<tr class="codeline" data-linenumber="1834"><td class="num" id="LN1834">1834</td><td class="line"> gsm_store_foreach_remove (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="1835"><td class="num" id="LN1835">1835</td><td class="line"> (GsmStoreFunc)inhibitor_has_client_id,</td></tr> +<tr class="codeline" data-linenumber="1836"><td class="num" id="LN1836">1836</td><td class="line"> (gpointer)gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="1837"><td class="num" id="LN1837">1837</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1838"><td class="num" id="LN1838">1838</td><td class="line"> app = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1839"><td class="num" id="LN1839">1839</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1840"><td class="num" id="LN1840">1840</td><td class="line"> <span class='comment'>/* first try to match on startup ID */</span></td></tr> +<tr class="codeline" data-linenumber="1841"><td class="num" id="LN1841">1841</td><td class="line"> startup_id = gsm_client_peek_startup_id (client);</td></tr> +<tr class="codeline" data-linenumber="1842"><td class="num" id="LN1842">1842</td><td class="line"> <span class='keyword'>if</span> (! <span class='macro'>IS_STRING_EMPTY (startup_id)<span class='macro_popup'>((startup_id)==((void*)0)||(startup_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1843"><td class="num" id="LN1843">1843</td><td class="line"> app = find_app_for_startup_id (manager, startup_id);</td></tr> +<tr class="codeline" data-linenumber="1844"><td class="num" id="LN1844">1844</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1845"><td class="num" id="LN1845">1845</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1846"><td class="num" id="LN1846">1846</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1847"><td class="num" id="LN1847">1847</td><td class="line"> <span class='comment'>/* then try to find matching app-id */</span></td></tr> +<tr class="codeline" data-linenumber="1848"><td class="num" id="LN1848">1848</td><td class="line"> <span class='keyword'>if</span> (app == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1849"><td class="num" id="LN1849">1849</td><td class="line"> app_id = gsm_client_peek_app_id (client);</td></tr> +<tr class="codeline" data-linenumber="1850"><td class="num" id="LN1850">1850</td><td class="line"> <span class='keyword'>if</span> (! <span class='macro'>IS_STRING_EMPTY (app_id)<span class='macro_popup'>((app_id)==((void*)0)||(app_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1851"><td class="num" id="LN1851">1851</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: disconnect for app '%s'"</span>, app_id);</td></tr> +<tr class="codeline" data-linenumber="1852"><td class="num" id="LN1852">1852</td><td class="line"> app = find_app_for_app_id (manager, app_id);</td></tr> +<tr class="codeline" data-linenumber="1853"><td class="num" id="LN1853">1853</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1854"><td class="num" id="LN1854">1854</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1855"><td class="num" id="LN1855">1855</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1856"><td class="num" id="LN1856">1856</td><td class="line"> <span class='keyword'>if</span> (priv->phase == GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="1857"><td class="num" id="LN1857">1857</td><td class="line"> <span class='comment'>/* Instead of answering our end session query, the client just exited.</span></td></tr> +<tr class="codeline" data-linenumber="1858"><td class="num" id="LN1858">1858</td><td class="line"> <span class='comment'>* Treat that as an "okay, end the session" answer.</span></td></tr> +<tr class="codeline" data-linenumber="1859"><td class="num" id="LN1859">1859</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="1860"><td class="num" id="LN1860">1860</td><td class="line"> <span class='comment'>* This call implicitly removes any inhibitors for the client, along</span></td></tr> +<tr class="codeline" data-linenumber="1861"><td class="num" id="LN1861">1861</td><td class="line"> <span class='comment'>* with removing the client from the pending query list.</span></td></tr> +<tr class="codeline" data-linenumber="1862"><td class="num" id="LN1862">1862</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1863"><td class="num" id="LN1863">1863</td><td class="line"> _handle_client_end_session_response (manager,</td></tr> +<tr class="codeline" data-linenumber="1864"><td class="num" id="LN1864">1864</td><td class="line"> client,</td></tr> +<tr class="codeline" data-linenumber="1865"><td class="num" id="LN1865">1865</td><td class="line"> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1866"><td class="num" id="LN1866">1866</td><td class="line"> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1867"><td class="num" id="LN1867">1867</td><td class="line"> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1868"><td class="num" id="LN1868">1868</td><td class="line"> <span class='string_literal'>"Client exited in "</span></td></tr> +<tr class="codeline" data-linenumber="1869"><td class="num" id="LN1869">1869</td><td class="line"> <span class='string_literal'>"query end session phase "</span></td></tr> +<tr class="codeline" data-linenumber="1870"><td class="num" id="LN1870">1870</td><td class="line"> <span class='string_literal'>"instead of end session "</span></td></tr> +<tr class="codeline" data-linenumber="1871"><td class="num" id="LN1871">1871</td><td class="line"> <span class='string_literal'>"phase"</span>);</td></tr> +<tr class="codeline" data-linenumber="1872"><td class="num" id="LN1872">1872</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1873"><td class="num" id="LN1873">1873</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1874"><td class="num" id="LN1874">1874</td><td class="line"> <span class='keyword'>if</span> (priv->dbus_disconnected && GSM_IS_DBUS_CLIENT (client)) {</td></tr> +<tr class="codeline" data-linenumber="1875"><td class="num" id="LN1875">1875</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: dbus disconnected, not restarting application"</span>);</td></tr> +<tr class="codeline" data-linenumber="1876"><td class="num" id="LN1876">1876</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1877"><td class="num" id="LN1877">1877</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1878"><td class="num" id="LN1878">1878</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1879"><td class="num" id="LN1879">1879</td><td class="line"> <span class='keyword'>if</span> (app == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1880"><td class="num" id="LN1880">1880</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: unable to find application for client - not restarting"</span>);</td></tr> +<tr class="codeline" data-linenumber="1881"><td class="num" id="LN1881">1881</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1882"><td class="num" id="LN1882">1882</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1883"><td class="num" id="LN1883">1883</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1884"><td class="num" id="LN1884">1884</td><td class="line"> <span class='keyword'>if</span> (priv->phase >= GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="1885"><td class="num" id="LN1885">1885</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: in shutdown, not restarting application"</span>);</td></tr> +<tr class="codeline" data-linenumber="1886"><td class="num" id="LN1886">1886</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1887"><td class="num" id="LN1887">1887</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1888"><td class="num" id="LN1888">1888</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1889"><td class="num" id="LN1889">1889</td><td class="line"> app_restart = gsm_app_peek_autorestart (app);</td></tr> +<tr class="codeline" data-linenumber="1890"><td class="num" id="LN1890">1890</td><td class="line"> client_restart_hint = gsm_client_peek_restart_style_hint (client);</td></tr> +<tr class="codeline" data-linenumber="1891"><td class="num" id="LN1891">1891</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1892"><td class="num" id="LN1892">1892</td><td class="line"> <span class='comment'>/* allow legacy clients to override the app info */</span></td></tr> +<tr class="codeline" data-linenumber="1893"><td class="num" id="LN1893">1893</td><td class="line"> <span class='keyword'>if</span> (! app_restart</td></tr> +<tr class="codeline" data-linenumber="1894"><td class="num" id="LN1894">1894</td><td class="line"> && client_restart_hint != GSM_CLIENT_RESTART_IMMEDIATELY) {</td></tr> +<tr class="codeline" data-linenumber="1895"><td class="num" id="LN1895">1895</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: autorestart not set, not restarting application"</span>);</td></tr> +<tr class="codeline" data-linenumber="1896"><td class="num" id="LN1896">1896</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1897"><td class="num" id="LN1897">1897</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1898"><td class="num" id="LN1898">1898</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1899"><td class="num" id="LN1899">1899</td><td class="line"> <span class='keyword'>if</span> (is_condition_client) {</td></tr> +<tr class="codeline" data-linenumber="1900"><td class="num" id="LN1900">1900</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: app conditionally disabled, not restarting application"</span>);</td></tr> +<tr class="codeline" data-linenumber="1901"><td class="num" id="LN1901">1901</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1902"><td class="num" id="LN1902">1902</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1903"><td class="num" id="LN1903">1903</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1904"><td class="num" id="LN1904">1904</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: restarting app"</span>);</td></tr> +<tr class="codeline" data-linenumber="1905"><td class="num" id="LN1905">1905</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1906"><td class="num" id="LN1906">1906</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1907"><td class="num" id="LN1907">1907</td><td class="line"> res = gsm_app_restart (app, &error);</td></tr> +<tr class="codeline" data-linenumber="1908"><td class="num" id="LN1908">1908</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1909"><td class="num" id="LN1909">1909</td><td class="line"> g_warning (<span class='string_literal'>"Error on restarting session managed app: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="1910"><td class="num" id="LN1910">1910</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="1911"><td class="num" id="LN1911">1911</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1912"><td class="num" id="LN1912">1912</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1913"><td class="num" id="LN1913">1913</td><td class="line"> out:</td></tr> +<tr class="codeline" data-linenumber="1914"><td class="num" id="LN1914">1914</td><td class="line"> g_object_unref (client);</td></tr> +<tr class="codeline" data-linenumber="1915"><td class="num" id="LN1915">1915</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1916"><td class="num" id="LN1916">1916</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1917"><td class="num" id="LN1917">1917</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span> {</td></tr> +<tr class="codeline" data-linenumber="1918"><td class="num" id="LN1918">1918</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *service_name;</td></tr> +<tr class="codeline" data-linenumber="1919"><td class="num" id="LN1919">1919</td><td class="line"> GsmManager *manager;</td></tr> +<tr class="codeline" data-linenumber="1920"><td class="num" id="LN1920">1920</td><td class="line">} RemoveClientData;</td></tr> +<tr class="codeline" data-linenumber="1921"><td class="num" id="LN1921">1921</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1922"><td class="num" id="LN1922">1922</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1923"><td class="num" id="LN1923">1923</td><td class="line">_disconnect_dbus_client (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="1924"><td class="num" id="LN1924">1924</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="1925"><td class="num" id="LN1925">1925</td><td class="line"> RemoveClientData *data)</td></tr> +<tr class="codeline" data-linenumber="1926"><td class="num" id="LN1926">1926</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1927"><td class="num" id="LN1927">1927</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *name;</td></tr> +<tr class="codeline" data-linenumber="1928"><td class="num" id="LN1928">1928</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1929"><td class="num" id="LN1929">1929</td><td class="line"> <span class='keyword'>if</span> (! GSM_IS_DBUS_CLIENT (client)) {</td></tr> +<tr class="codeline" data-linenumber="1930"><td class="num" id="LN1930">1930</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1931"><td class="num" id="LN1931">1931</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1932"><td class="num" id="LN1932">1932</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1933"><td class="num" id="LN1933">1933</td><td class="line"> <span class='comment'>/* If no service name, then we simply disconnect all clients */</span></td></tr> +<tr class="codeline" data-linenumber="1934"><td class="num" id="LN1934">1934</td><td class="line"> <span class='keyword'>if</span> (!data->service_name) {</td></tr> +<tr class="codeline" data-linenumber="1935"><td class="num" id="LN1935">1935</td><td class="line"> _disconnect_client (data->manager, client);</td></tr> +<tr class="codeline" data-linenumber="1936"><td class="num" id="LN1936">1936</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1937"><td class="num" id="LN1937">1937</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1938"><td class="num" id="LN1938">1938</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1939"><td class="num" id="LN1939">1939</td><td class="line"> name = gsm_dbus_client_get_bus_name (GSM_DBUS_CLIENT (client));</td></tr> +<tr class="codeline" data-linenumber="1940"><td class="num" id="LN1940">1940</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (name)<span class='macro_popup'>((name)==((void*)0)||(name)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1941"><td class="num" id="LN1941">1941</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1942"><td class="num" id="LN1942">1942</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1943"><td class="num" id="LN1943">1943</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1944"><td class="num" id="LN1944">1944</td><td class="line"> <span class='keyword'>if</span> (strcmp (data->service_name, name) == 0) {</td></tr> +<tr class="codeline" data-linenumber="1945"><td class="num" id="LN1945">1945</td><td class="line"> _disconnect_client (data->manager, client);</td></tr> +<tr class="codeline" data-linenumber="1946"><td class="num" id="LN1946">1946</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1947"><td class="num" id="LN1947">1947</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1948"><td class="num" id="LN1948">1948</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1949"><td class="num" id="LN1949">1949</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1950"><td class="num" id="LN1950">1950</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1951"><td class="num" id="LN1951">1951</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1952"><td class="num" id="LN1952">1952</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="1953"><td class="num" id="LN1953">1953</td><td class="line"> <span class='comment'>* remove_clients_for_connection:</span></td></tr> +<tr class="codeline" data-linenumber="1954"><td class="num" id="LN1954">1954</td><td class="line"> <span class='comment'>* @manager: a #GsmManager</span></td></tr> +<tr class="codeline" data-linenumber="1955"><td class="num" id="LN1955">1955</td><td class="line"> <span class='comment'>* @service_name: a service name</span></td></tr> +<tr class="codeline" data-linenumber="1956"><td class="num" id="LN1956">1956</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="1957"><td class="num" id="LN1957">1957</td><td class="line"> <span class='comment'>* Disconnects clients that own @service_name.</span></td></tr> +<tr class="codeline" data-linenumber="1958"><td class="num" id="LN1958">1958</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="1959"><td class="num" id="LN1959">1959</td><td class="line"> <span class='comment'>* If @service_name is NULL, then disconnects all clients for the connection.</span></td></tr> +<tr class="codeline" data-linenumber="1960"><td class="num" id="LN1960">1960</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1961"><td class="num" id="LN1961">1961</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1962"><td class="num" id="LN1962">1962</td><td class="line">remove_clients_for_connection (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="1963"><td class="num" id="LN1963">1963</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *service_name)</td></tr> +<tr class="codeline" data-linenumber="1964"><td class="num" id="LN1964">1964</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1965"><td class="num" id="LN1965">1965</td><td class="line"> RemoveClientData data;</td></tr> +<tr class="codeline" data-linenumber="1966"><td class="num" id="LN1966">1966</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1967"><td class="num" id="LN1967">1967</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1968"><td class="num" id="LN1968">1968</td><td class="line"> data.service_name = service_name;</td></tr> +<tr class="codeline" data-linenumber="1969"><td class="num" id="LN1969">1969</td><td class="line"> data.manager = manager;</td></tr> +<tr class="codeline" data-linenumber="1970"><td class="num" id="LN1970">1970</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1971"><td class="num" id="LN1971">1971</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1972"><td class="num" id="LN1972">1972</td><td class="line"> <span class='comment'>/* disconnect dbus clients for name */</span></td></tr> +<tr class="codeline" data-linenumber="1973"><td class="num" id="LN1973">1973</td><td class="line"> gsm_store_foreach_remove (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="1974"><td class="num" id="LN1974">1974</td><td class="line"> (GsmStoreFunc)_disconnect_dbus_client,</td></tr> +<tr class="codeline" data-linenumber="1975"><td class="num" id="LN1975">1975</td><td class="line"> &data);</td></tr> +<tr class="codeline" data-linenumber="1976"><td class="num" id="LN1976">1976</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1977"><td class="num" id="LN1977">1977</td><td class="line"> <span class='keyword'>if</span> (priv->phase >= GSM_MANAGER_PHASE_QUERY_END_SESSION</td></tr> +<tr class="codeline" data-linenumber="1978"><td class="num" id="LN1978">1978</td><td class="line"> && gsm_store_size (priv->clients) == 0) {</td></tr> +<tr class="codeline" data-linenumber="1979"><td class="num" id="LN1979">1979</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: last client disconnected - exiting"</span>);</td></tr> +<tr class="codeline" data-linenumber="1980"><td class="num" id="LN1980">1980</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="1981"><td class="num" id="LN1981">1981</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1982"><td class="num" id="LN1982">1982</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1983"><td class="num" id="LN1983">1983</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1984"><td class="num" id="LN1984">1984</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1985"><td class="num" id="LN1985">1985</td><td class="line">inhibitor_has_bus_name (gpointer key,</td></tr> +<tr class="codeline" data-linenumber="1986"><td class="num" id="LN1986">1986</td><td class="line"> GsmInhibitor *inhibitor,</td></tr> +<tr class="codeline" data-linenumber="1987"><td class="num" id="LN1987">1987</td><td class="line"> RemoveClientData *data)</td></tr> +<tr class="codeline" data-linenumber="1988"><td class="num" id="LN1988">1988</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1989"><td class="num" id="LN1989">1989</td><td class="line"> gboolean matches;</td></tr> +<tr class="codeline" data-linenumber="1990"><td class="num" id="LN1990">1990</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *bus_name_b;</td></tr> +<tr class="codeline" data-linenumber="1991"><td class="num" id="LN1991">1991</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1992"><td class="num" id="LN1992">1992</td><td class="line"> bus_name_b = gsm_inhibitor_peek_bus_name (inhibitor);</td></tr> +<tr class="codeline" data-linenumber="1993"><td class="num" id="LN1993">1993</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1994"><td class="num" id="LN1994">1994</td><td class="line"> matches = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1995"><td class="num" id="LN1995">1995</td><td class="line"> <span class='keyword'>if</span> (! <span class='macro'>IS_STRING_EMPTY (data->service_name)<span class='macro_popup'>((data->service_name)==((void*)0)||(data->service_name)<br>[0]=='\0')</span></span> && ! <span class='macro'>IS_STRING_EMPTY (bus_name_b)<span class='macro_popup'>((bus_name_b)==((void*)0)||(bus_name_b)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1996"><td class="num" id="LN1996">1996</td><td class="line"> matches = (strcmp (data->service_name, bus_name_b) == 0);</td></tr> +<tr class="codeline" data-linenumber="1997"><td class="num" id="LN1997">1997</td><td class="line"> <span class='keyword'>if</span> (matches) {</td></tr> +<tr class="codeline" data-linenumber="1998"><td class="num" id="LN1998">1998</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: removing inhibitor from %s for reason '%s' on connection %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="1999"><td class="num" id="LN1999">1999</td><td class="line"> gsm_inhibitor_peek_app_id (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="2000"><td class="num" id="LN2000">2000</td><td class="line"> gsm_inhibitor_peek_reason (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="2001"><td class="num" id="LN2001">2001</td><td class="line"> gsm_inhibitor_peek_bus_name (inhibitor));</td></tr> +<tr class="codeline" data-linenumber="2002"><td class="num" id="LN2002">2002</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2003"><td class="num" id="LN2003">2003</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2004"><td class="num" id="LN2004">2004</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2005"><td class="num" id="LN2005">2005</td><td class="line"> <span class='keyword'>return</span> matches;</td></tr> +<tr class="codeline" data-linenumber="2006"><td class="num" id="LN2006">2006</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2007"><td class="num" id="LN2007">2007</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2008"><td class="num" id="LN2008">2008</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2009"><td class="num" id="LN2009">2009</td><td class="line">remove_inhibitors_for_connection (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="2010"><td class="num" id="LN2010">2010</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *service_name)</td></tr> +<tr class="codeline" data-linenumber="2011"><td class="num" id="LN2011">2011</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2012"><td class="num" id="LN2012">2012</td><td class="line"> guint <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> n_removed;</td></tr> +<tr class="codeline" data-linenumber="2013"><td class="num" id="LN2013">2013</td><td class="line"> RemoveClientData data;</td></tr> +<tr class="codeline" data-linenumber="2014"><td class="num" id="LN2014">2014</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2015"><td class="num" id="LN2015">2015</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2016"><td class="num" id="LN2016">2016</td><td class="line"> data.service_name = service_name;</td></tr> +<tr class="codeline" data-linenumber="2017"><td class="num" id="LN2017">2017</td><td class="line"> data.manager = manager;</td></tr> +<tr class="codeline" data-linenumber="2018"><td class="num" id="LN2018">2018</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2019"><td class="num" id="LN2019">2019</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2020"><td class="num" id="LN2020">2020</td><td class="line"> debug_inhibitors (manager);</td></tr> +<tr class="codeline" data-linenumber="2021"><td class="num" id="LN2021">2021</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2022"><td class="num" id="LN2022">2022</td><td class="line"> n_removed = gsm_store_foreach_remove (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="2023"><td class="num" id="LN2023">2023</td><td class="line"> (GsmStoreFunc)inhibitor_has_bus_name,</td></tr> +<tr class="codeline" data-linenumber="2024"><td class="num" id="LN2024">2024</td><td class="line"> &data);</td></tr> +<tr class="codeline" data-linenumber="2025"><td class="num" id="LN2025">2025</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2026"><td class="num" id="LN2026">2026</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2027"><td class="num" id="LN2027">2027</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2028"><td class="num" id="LN2028">2028</td><td class="line">bus_name_owner_changed (DBusGProxy *bus_proxy,</td></tr> +<tr class="codeline" data-linenumber="2029"><td class="num" id="LN2029">2029</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *service_name,</td></tr> +<tr class="codeline" data-linenumber="2030"><td class="num" id="LN2030">2030</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *old_service_name,</td></tr> +<tr class="codeline" data-linenumber="2031"><td class="num" id="LN2031">2031</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *new_service_name,</td></tr> +<tr class="codeline" data-linenumber="2032"><td class="num" id="LN2032">2032</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2033"><td class="num" id="LN2033">2033</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2034"><td class="num" id="LN2034">2034</td><td class="line"> <span class='keyword'>if</span> (strlen (new_service_name) == 0</td></tr> +<tr class="codeline" data-linenumber="2035"><td class="num" id="LN2035">2035</td><td class="line"> && strlen (old_service_name) > 0) {</td></tr> +<tr class="codeline" data-linenumber="2036"><td class="num" id="LN2036">2036</td><td class="line"> <span class='comment'>/* service removed */</span></td></tr> +<tr class="codeline" data-linenumber="2037"><td class="num" id="LN2037">2037</td><td class="line"> remove_inhibitors_for_connection (manager, old_service_name);</td></tr> +<tr class="codeline" data-linenumber="2038"><td class="num" id="LN2038">2038</td><td class="line"> remove_clients_for_connection (manager, old_service_name);</td></tr> +<tr class="codeline" data-linenumber="2039"><td class="num" id="LN2039">2039</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (strlen (old_service_name) == 0</td></tr> +<tr class="codeline" data-linenumber="2040"><td class="num" id="LN2040">2040</td><td class="line"> && strlen (new_service_name) > 0) {</td></tr> +<tr class="codeline" data-linenumber="2041"><td class="num" id="LN2041">2041</td><td class="line"> <span class='comment'>/* service added */</span></td></tr> +<tr class="codeline" data-linenumber="2042"><td class="num" id="LN2042">2042</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2043"><td class="num" id="LN2043">2043</td><td class="line"> <span class='comment'>/* use this if we support automatically registering</span></td></tr> +<tr class="codeline" data-linenumber="2044"><td class="num" id="LN2044">2044</td><td class="line"> <span class='comment'>* well known bus names */</span></td></tr> +<tr class="codeline" data-linenumber="2045"><td class="num" id="LN2045">2045</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2046"><td class="num" id="LN2046">2046</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2047"><td class="num" id="LN2047">2047</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2048"><td class="num" id="LN2048">2048</td><td class="line"><span class='keyword'>static</span> DBusHandlerResult</td></tr> +<tr class="codeline" data-linenumber="2049"><td class="num" id="LN2049">2049</td><td class="line">gsm_manager_bus_filter (DBusConnection *connection,</td></tr> +<tr class="codeline" data-linenumber="2050"><td class="num" id="LN2050">2050</td><td class="line"> DBusMessage *message,</td></tr> +<tr class="codeline" data-linenumber="2051"><td class="num" id="LN2051">2051</td><td class="line"> <span class='keyword'>void</span> *user_data)</td></tr> +<tr class="codeline" data-linenumber="2052"><td class="num" id="LN2052">2052</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2053"><td class="num" id="LN2053">2053</td><td class="line"> GsmManager *manager;</td></tr> +<tr class="codeline" data-linenumber="2054"><td class="num" id="LN2054">2054</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2055"><td class="num" id="LN2055">2055</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2056"><td class="num" id="LN2056">2056</td><td class="line"> manager = GSM_MANAGER (user_data);</td></tr> +<tr class="codeline" data-linenumber="2057"><td class="num" id="LN2057">2057</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2058"><td class="num" id="LN2058">2058</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2059"><td class="num" id="LN2059">2059</td><td class="line"> <span class='keyword'>if</span> (dbus_message_is_signal (message,</td></tr> +<tr class="codeline" data-linenumber="2060"><td class="num" id="LN2060">2060</td><td class="line"> <span class='macro'>DBUS_INTERFACE_LOCAL<span class='macro_popup'>"org.freedesktop.DBus.Local"</span></span>, <span class='string_literal'>"Disconnected"</span>) &&</td></tr> +<tr class="codeline" data-linenumber="2061"><td class="num" id="LN2061">2061</td><td class="line"> strcmp (dbus_message_get_path (message), <span class='macro'>DBUS_PATH_LOCAL<span class='macro_popup'>"/org/freedesktop/DBus/Local"</span></span>) == 0) {</td></tr> +<tr class="codeline" data-linenumber="2062"><td class="num" id="LN2062">2062</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: dbus disconnected; disconnecting dbus clients..."</span>);</td></tr> +<tr class="codeline" data-linenumber="2063"><td class="num" id="LN2063">2063</td><td class="line"> priv->dbus_disconnected = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2064"><td class="num" id="LN2064">2064</td><td class="line"> remove_clients_for_connection (manager, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2065"><td class="num" id="LN2065">2065</td><td class="line"> <span class='comment'>/* let other filters get this disconnected signal, so that they</span></td></tr> +<tr class="codeline" data-linenumber="2066"><td class="num" id="LN2066">2066</td><td class="line"> <span class='comment'>* can handle it too */</span></td></tr> +<tr class="codeline" data-linenumber="2067"><td class="num" id="LN2067">2067</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2068"><td class="num" id="LN2068">2068</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2069"><td class="num" id="LN2069">2069</td><td class="line"> <span class='keyword'>return</span> DBUS_HANDLER_RESULT_NOT_YET_HANDLED;</td></tr> +<tr class="codeline" data-linenumber="2070"><td class="num" id="LN2070">2070</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2071"><td class="num" id="LN2071">2071</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2072"><td class="num" id="LN2072">2072</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="2073"><td class="num" id="LN2073">2073</td><td class="line">register_manager (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2074"><td class="num" id="LN2074">2074</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2075"><td class="num" id="LN2075">2075</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2076"><td class="num" id="LN2076">2076</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2077"><td class="num" id="LN2077">2077</td><td class="line"> DBusConnection *connection;</td></tr> +<tr class="codeline" data-linenumber="2078"><td class="num" id="LN2078">2078</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2079"><td class="num" id="LN2079">2079</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2080"><td class="num" id="LN2080">2080</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2081"><td class="num" id="LN2081">2081</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2082"><td class="num" id="LN2082">2082</td><td class="line"> priv->connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);</td></tr> +<tr class="codeline" data-linenumber="2083"><td class="num" id="LN2083">2083</td><td class="line"> <span class='keyword'>if</span> (priv->connection == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2084"><td class="num" id="LN2084">2084</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2085"><td class="num" id="LN2085">2085</td><td class="line"> g_critical (<span class='string_literal'>"error getting session bus: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="2086"><td class="num" id="LN2086">2086</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="2087"><td class="num" id="LN2087">2087</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2088"><td class="num" id="LN2088">2088</td><td class="line"> exit (1);</td></tr> +<tr class="codeline" data-linenumber="2089"><td class="num" id="LN2089">2089</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2090"><td class="num" id="LN2090">2090</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2091"><td class="num" id="LN2091">2091</td><td class="line"> connection = dbus_g_connection_get_connection (priv->connection);</td></tr> +<tr class="codeline" data-linenumber="2092"><td class="num" id="LN2092">2092</td><td class="line"> dbus_connection_add_filter (connection,</td></tr> +<tr class="codeline" data-linenumber="2093"><td class="num" id="LN2093">2093</td><td class="line"> gsm_manager_bus_filter,</td></tr> +<tr class="codeline" data-linenumber="2094"><td class="num" id="LN2094">2094</td><td class="line"> manager, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2095"><td class="num" id="LN2095">2095</td><td class="line"> priv->dbus_disconnected = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2096"><td class="num" id="LN2096">2096</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2097"><td class="num" id="LN2097">2097</td><td class="line"> priv->bus_proxy = dbus_g_proxy_new_for_name (priv->connection,</td></tr> +<tr class="codeline" data-linenumber="2098"><td class="num" id="LN2098">2098</td><td class="line"> <span class='macro'>DBUS_SERVICE_DBUS<span class='macro_popup'>"org.freedesktop.DBus"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2099"><td class="num" id="LN2099">2099</td><td class="line"> <span class='macro'>DBUS_PATH_DBUS<span class='macro_popup'>"/org/freedesktop/DBus"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2100"><td class="num" id="LN2100">2100</td><td class="line"> <span class='macro'>DBUS_INTERFACE_DBUS<span class='macro_popup'>"org.freedesktop.DBus"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2101"><td class="num" id="LN2101">2101</td><td class="line"> dbus_g_proxy_add_signal (priv->bus_proxy,</td></tr> +<tr class="codeline" data-linenumber="2102"><td class="num" id="LN2102">2102</td><td class="line"> <span class='string_literal'>"NameOwnerChanged"</span>,</td></tr> +<tr class="codeline" data-linenumber="2103"><td class="num" id="LN2103">2103</td><td class="line"> <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2104"><td class="num" id="LN2104">2104</td><td class="line"> <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2105"><td class="num" id="LN2105">2105</td><td class="line"> <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2106"><td class="num" id="LN2106">2106</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2107"><td class="num" id="LN2107">2107</td><td class="line"> dbus_g_proxy_connect_signal (priv->bus_proxy,</td></tr> +<tr class="codeline" data-linenumber="2108"><td class="num" id="LN2108">2108</td><td class="line"> <span class='string_literal'>"NameOwnerChanged"</span>,</td></tr> +<tr class="codeline" data-linenumber="2109"><td class="num" id="LN2109">2109</td><td class="line"> <span class='macro'>G_CALLBACK (bus_name_owner_changed)<span class='macro_popup'>((GCallback) (bus_name_owner_changed))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2110"><td class="num" id="LN2110">2110</td><td class="line"> manager,</td></tr> +<tr class="codeline" data-linenumber="2111"><td class="num" id="LN2111">2111</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2112"><td class="num" id="LN2112">2112</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2113"><td class="num" id="LN2113">2113</td><td class="line"> dbus_g_connection_register_g_object (priv->connection, <span class='macro'>GSM_MANAGER_DBUS_PATH<span class='macro_popup'>"/org/gnome/SessionManager"</span></span>, <span class='macro'>G_OBJECT (manager)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((manager)), (((GType) ((20) << (2))))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2114"><td class="num" id="LN2114">2114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2115"><td class="num" id="LN2115">2115</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2116"><td class="num" id="LN2116">2116</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2117"><td class="num" id="LN2117">2117</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2118"><td class="num" id="LN2118">2118</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2119"><td class="num" id="LN2119">2119</td><td class="line">gsm_manager_set_failsafe (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="2120"><td class="num" id="LN2120">2120</td><td class="line"> gboolean enabled)</td></tr> +<tr class="codeline" data-linenumber="2121"><td class="num" id="LN2121">2121</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2122"><td class="num" id="LN2122">2122</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2123"><td class="num" id="LN2123">2123</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2124"><td class="num" id="LN2124">2124</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_MANAGER (manager))<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2125"><td class="num" id="LN2125">2125</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2126"><td class="num" id="LN2126">2126</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2127"><td class="num" id="LN2127">2127</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2128"><td class="num" id="LN2128">2128</td><td class="line"> priv->failsafe = enabled;</td></tr> +<tr class="codeline" data-linenumber="2129"><td class="num" id="LN2129">2129</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2130"><td class="num" id="LN2130">2130</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2131"><td class="num" id="LN2131">2131</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="2132"><td class="num" id="LN2132">2132</td><td class="line">_client_has_startup_id (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="2133"><td class="num" id="LN2133">2133</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="2134"><td class="num" id="LN2134">2134</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id_a)</td></tr> +<tr class="codeline" data-linenumber="2135"><td class="num" id="LN2135">2135</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2136"><td class="num" id="LN2136">2136</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id_b;</td></tr> +<tr class="codeline" data-linenumber="2137"><td class="num" id="LN2137">2137</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2138"><td class="num" id="LN2138">2138</td><td class="line"> startup_id_b = gsm_client_peek_startup_id (client);</td></tr> +<tr class="codeline" data-linenumber="2139"><td class="num" id="LN2139">2139</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2140"><td class="num" id="LN2140">2140</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (startup_id_b)<span class='macro_popup'>((startup_id_b)==((void*)0)||(startup_id_b)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2141"><td class="num" id="LN2141">2141</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2142"><td class="num" id="LN2142">2142</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2143"><td class="num" id="LN2143">2143</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2144"><td class="num" id="LN2144">2144</td><td class="line"> <span class='keyword'>return</span> (strcmp (startup_id_a, startup_id_b) == 0);</td></tr> +<tr class="codeline" data-linenumber="2145"><td class="num" id="LN2145">2145</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2146"><td class="num" id="LN2146">2146</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2147"><td class="num" id="LN2147">2147</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2148"><td class="num" id="LN2148">2148</td><td class="line">on_client_disconnected (GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="2149"><td class="num" id="LN2149">2149</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2150"><td class="num" id="LN2150">2150</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2151"><td class="num" id="LN2151">2151</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2152"><td class="num" id="LN2152">2152</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2153"><td class="num" id="LN2153">2153</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: disconnect client"</span>);</td></tr> +<tr class="codeline" data-linenumber="2154"><td class="num" id="LN2154">2154</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2155"><td class="num" id="LN2155">2155</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2156"><td class="num" id="LN2156">2156</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2157"><td class="num" id="LN2157">2157</td><td class="line"> _disconnect_client (manager, client);</td></tr> +<tr class="codeline" data-linenumber="2158"><td class="num" id="LN2158">2158</td><td class="line"> gsm_store_remove (priv->clients, gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="2159"><td class="num" id="LN2159">2159</td><td class="line"> <span class='keyword'>if</span> (priv->phase >= GSM_MANAGER_PHASE_QUERY_END_SESSION</td></tr> +<tr class="codeline" data-linenumber="2160"><td class="num" id="LN2160">2160</td><td class="line"> && gsm_store_size (priv->clients) == 0) {</td></tr> +<tr class="codeline" data-linenumber="2161"><td class="num" id="LN2161">2161</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: last client disconnected - exiting"</span>);</td></tr> +<tr class="codeline" data-linenumber="2162"><td class="num" id="LN2162">2162</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="2163"><td class="num" id="LN2163">2163</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2164"><td class="num" id="LN2164">2164</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2165"><td class="num" id="LN2165">2165</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2166"><td class="num" id="LN2166">2166</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="2167"><td class="num" id="LN2167">2167</td><td class="line">on_xsmp_client_register_request (GsmXSMPClient *client,</td></tr> +<tr class="codeline" data-linenumber="2168"><td class="num" id="LN2168">2168</td><td class="line"> <span class='keyword'>char</span> **id,</td></tr> +<tr class="codeline" data-linenumber="2169"><td class="num" id="LN2169">2169</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2170"><td class="num" id="LN2170">2170</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2171"><td class="num" id="LN2171">2171</td><td class="line"> gboolean handled;</td></tr> +<tr class="codeline" data-linenumber="2172"><td class="num" id="LN2172">2172</td><td class="line"> <span class='keyword'>char</span> *new_id;</td></tr> +<tr class="codeline" data-linenumber="2173"><td class="num" id="LN2173">2173</td><td class="line"> GsmApp *app;</td></tr> +<tr class="codeline" data-linenumber="2174"><td class="num" id="LN2174">2174</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2175"><td class="num" id="LN2175">2175</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2176"><td class="num" id="LN2176">2176</td><td class="line"> handled = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2177"><td class="num" id="LN2177">2177</td><td class="line"> new_id = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2178"><td class="num" id="LN2178">2178</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2179"><td class="num" id="LN2179">2179</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2180"><td class="num" id="LN2180">2180</td><td class="line"> <span class='keyword'>if</span> (priv->phase >= GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="2181"><td class="num" id="LN2181">2181</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="2182"><td class="num" id="LN2182">2182</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2183"><td class="num" id="LN2183">2183</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2184"><td class="num" id="LN2184">2184</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (*id)<span class='macro_popup'>((*id)==((void*)0)||(*id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2185"><td class="num" id="LN2185">2185</td><td class="line"> new_id = gsm_util_generate_startup_id ();</td></tr> +<tr class="codeline" data-linenumber="2186"><td class="num" id="LN2186">2186</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2187"><td class="num" id="LN2187">2187</td><td class="line"> GsmClient *sm_client;</td></tr> +<tr class="codeline" data-linenumber="2188"><td class="num" id="LN2188">2188</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2189"><td class="num" id="LN2189">2189</td><td class="line"> sm_client = (GsmClient *)gsm_store_find (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="2190"><td class="num" id="LN2190">2190</td><td class="line"> (GsmStoreFunc)_client_has_startup_id,</td></tr> +<tr class="codeline" data-linenumber="2191"><td class="num" id="LN2191">2191</td><td class="line"> *id);</td></tr> +<tr class="codeline" data-linenumber="2192"><td class="num" id="LN2192">2192</td><td class="line"> <span class='comment'>/* We can't have two clients with the same id. */</span></td></tr> +<tr class="codeline" data-linenumber="2193"><td class="num" id="LN2193">2193</td><td class="line"> <span class='keyword'>if</span> (sm_client != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2194"><td class="num" id="LN2194">2194</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="2195"><td class="num" id="LN2195">2195</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2196"><td class="num" id="LN2196">2196</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2197"><td class="num" id="LN2197">2197</td><td class="line"> new_id = <span class='macro'>g_strdup (*id)<span class='macro_popup'>g_strdup_inline (*id)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2198"><td class="num" id="LN2198">2198</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2199"><td class="num" id="LN2199">2199</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2200"><td class="num" id="LN2200">2200</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Adding new client %s to session"</span>, new_id);</td></tr> +<tr class="codeline" data-linenumber="2201"><td class="num" id="LN2201">2201</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2202"><td class="num" id="LN2202">2202</td><td class="line"> <span class='macro'>g_signal_connect (client,<span class='macro_popup'>g_signal_connect_data ((client), ("disconnected"), (((GCallback<br>) (on_client_disconnected))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2203"><td class="num" id="LN2203">2203</td><td class="line"> <span class='string_literal'><span class='macro'>"disconnected"</span>,<span class='macro_popup'>g_signal_connect_data ((client), ("disconnected"), (((GCallback<br>) (on_client_disconnected))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2204"><td class="num" id="LN2204">2204</td><td class="line"> <span class='macro'>G_CALLBACK (on_client_disconnected),<span class='macro_popup'>g_signal_connect_data ((client), ("disconnected"), (((GCallback<br>) (on_client_disconnected))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2205"><td class="num" id="LN2205">2205</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((client), ("disconnected"), (((GCallback<br>) (on_client_disconnected))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2206"><td class="num" id="LN2206">2206</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2207"><td class="num" id="LN2207">2207</td><td class="line"> <span class='comment'>/* If it's a brand new client id, we just accept the client*/</span></td></tr> +<tr class="codeline" data-linenumber="2208"><td class="num" id="LN2208">2208</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (*id)<span class='macro_popup'>((*id)==((void*)0)||(*id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2209"><td class="num" id="LN2209">2209</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="2210"><td class="num" id="LN2210">2210</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2211"><td class="num" id="LN2211">2211</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2212"><td class="num" id="LN2212">2212</td><td class="line"> app = find_app_for_startup_id (manager, new_id);</td></tr> +<tr class="codeline" data-linenumber="2213"><td class="num" id="LN2213">2213</td><td class="line"> <span class='keyword'>if</span> (app != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2214"><td class="num" id="LN2214">2214</td><td class="line"> gsm_client_set_app_id (GSM_CLIENT (client), gsm_app_peek_app_id (app));</td></tr> +<tr class="codeline" data-linenumber="2215"><td class="num" id="LN2215">2215</td><td class="line"> gsm_app_registered (app);</td></tr> +<tr class="codeline" data-linenumber="2216"><td class="num" id="LN2216">2216</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="2217"><td class="num" id="LN2217">2217</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2218"><td class="num" id="LN2218">2218</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2219"><td class="num" id="LN2219">2219</td><td class="line"> <span class='comment'>/* app not found */</span></td></tr> +<tr class="codeline" data-linenumber="2220"><td class="num" id="LN2220">2220</td><td class="line"> g_free (new_id);</td></tr> +<tr class="codeline" data-linenumber="2221"><td class="num" id="LN2221">2221</td><td class="line"> new_id = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2222"><td class="num" id="LN2222">2222</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2223"><td class="num" id="LN2223">2223</td><td class="line"> out:</td></tr> +<tr class="codeline" data-linenumber="2224"><td class="num" id="LN2224">2224</td><td class="line"> g_free (*id);</td></tr> +<tr class="codeline" data-linenumber="2225"><td class="num" id="LN2225">2225</td><td class="line"> *id = new_id;</td></tr> +<tr class="codeline" data-linenumber="2226"><td class="num" id="LN2226">2226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2227"><td class="num" id="LN2227">2227</td><td class="line"> <span class='keyword'>return</span> handled;</td></tr> +<tr class="codeline" data-linenumber="2228"><td class="num" id="LN2228">2228</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2229"><td class="num" id="LN2229">2229</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2230"><td class="num" id="LN2230">2230</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="2231"><td class="num" id="LN2231">2231</td><td class="line">auto_save_is_enabled (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2232"><td class="num" id="LN2232">2232</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2233"><td class="num" id="LN2233">2233</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2234"><td class="num" id="LN2234">2234</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2235"><td class="num" id="LN2235">2235</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2236"><td class="num" id="LN2236">2236</td><td class="line"> <span class='keyword'>return</span> g_settings_get_boolean (priv->settings_session,</td></tr> +<tr class="codeline" data-linenumber="2237"><td class="num" id="LN2237">2237</td><td class="line"> <span class='macro'>KEY_AUTOSAVE<span class='macro_popup'>"auto-save-session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2238"><td class="num" id="LN2238">2238</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2239"><td class="num" id="LN2239">2239</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2240"><td class="num" id="LN2240">2240</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2241"><td class="num" id="LN2241">2241</td><td class="line">maybe_save_session (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2242"><td class="num" id="LN2242">2242</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2243"><td class="num" id="LN2243">2243</td><td class="line"> GsmConsolekit *consolekit = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2244"><td class="num" id="LN2244">2244</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="2245"><td class="num" id="LN2245">2245</td><td class="line"> GsmSystemd *systemd = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2246"><td class="num" id="LN2246">2246</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="2247"><td class="num" id="LN2247">2247</td><td class="line"> <span class='keyword'>char</span> *session_type;</td></tr> +<tr class="codeline" data-linenumber="2248"><td class="num" id="LN2248">2248</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="2249"><td class="num" id="LN2249">2249</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2250"><td class="num" id="LN2250">2250</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2251"><td class="num" id="LN2251">2251</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="2252"><td class="num" id="LN2252">2252</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2253"><td class="num" id="LN2253">2253</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="2254"><td class="num" id="LN2254">2254</td><td class="line"> session_type = gsm_systemd_get_current_session_type (systemd);</td></tr> +<tr class="codeline" data-linenumber="2255"><td class="num" id="LN2255">2255</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2256"><td class="num" id="LN2256">2256</td><td class="line"> <span class='keyword'>if</span> (g_strcmp0 (session_type, <span class='macro'>GSM_SYSTEMD_SESSION_TYPE_LOGIN_WINDOW<span class='macro_popup'>"greeter"</span></span>) == 0) {</td></tr> +<tr class="codeline" data-linenumber="2257"><td class="num" id="LN2257">2257</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="2258"><td class="num" id="LN2258">2258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2259"><td class="num" id="LN2259">2259</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2260"><td class="num" id="LN2260">2260</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2261"><td class="num" id="LN2261">2261</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="2262"><td class="num" id="LN2262">2262</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="2263"><td class="num" id="LN2263">2263</td><td class="line"> session_type = gsm_consolekit_get_current_session_type (consolekit);</td></tr> +<tr class="codeline" data-linenumber="2264"><td class="num" id="LN2264">2264</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2265"><td class="num" id="LN2265">2265</td><td class="line"> <span class='keyword'>if</span> (g_strcmp0 (session_type, <span class='macro'>GSM_CONSOLEKIT_SESSION_TYPE_LOGIN_WINDOW<span class='macro_popup'>"LoginWindow"</span></span>) == 0) {</td></tr> +<tr class="codeline" data-linenumber="2266"><td class="num" id="LN2266">2266</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="2267"><td class="num" id="LN2267">2267</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2268"><td class="num" id="LN2268">2268</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="2269"><td class="num" id="LN2269">2269</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2270"><td class="num" id="LN2270">2270</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="2271"><td class="num" id="LN2271">2271</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2272"><td class="num" id="LN2272">2272</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2273"><td class="num" id="LN2273">2273</td><td class="line"> <span class='comment'>/* We only allow session saving when session is running or when</span></td></tr> +<tr class="codeline" data-linenumber="2274"><td class="num" id="LN2274">2274</td><td class="line"> <span class='comment'>* logging out */</span></td></tr> +<tr class="codeline" data-linenumber="2275"><td class="num" id="LN2275">2275</td><td class="line"> <span class='keyword'>if</span> (priv->phase != GSM_MANAGER_PHASE_RUNNING &&</td></tr> +<tr class="codeline" data-linenumber="2276"><td class="num" id="LN2276">2276</td><td class="line"> priv->phase != GSM_MANAGER_PHASE_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="2277"><td class="num" id="LN2277">2277</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="2278"><td class="num" id="LN2278">2278</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2279"><td class="num" id="LN2279">2279</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2280"><td class="num" id="LN2280">2280</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2281"><td class="num" id="LN2281">2281</td><td class="line"> gsm_session_save (priv->clients, &error);</td></tr> +<tr class="codeline" data-linenumber="2282"><td class="num" id="LN2282">2282</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2283"><td class="num" id="LN2283">2283</td><td class="line"> <span class='keyword'>if</span> (error) {</td></tr> +<tr class="codeline" data-linenumber="2284"><td class="num" id="LN2284">2284</td><td class="line"> g_warning (<span class='string_literal'>"Error saving session: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="2285"><td class="num" id="LN2285">2285</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="2286"><td class="num" id="LN2286">2286</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2287"><td class="num" id="LN2287">2287</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2288"><td class="num" id="LN2288">2288</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="2289"><td class="num" id="LN2289">2289</td><td class="line"> <span class='keyword'>if</span> (consolekit != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="2290"><td class="num" id="LN2290">2290</td><td class="line"> g_object_unref (consolekit);</td></tr> +<tr class="codeline" data-linenumber="2291"><td class="num" id="LN2291">2291</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="2292"><td class="num" id="LN2292">2292</td><td class="line"> <span class='keyword'>if</span> (systemd != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="2293"><td class="num" id="LN2293">2293</td><td class="line"> g_object_unref (systemd);</td></tr> +<tr class="codeline" data-linenumber="2294"><td class="num" id="LN2294">2294</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="2295"><td class="num" id="LN2295">2295</td><td class="line"> g_free (session_type);</td></tr> +<tr class="codeline" data-linenumber="2296"><td class="num" id="LN2296">2296</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2297"><td class="num" id="LN2297">2297</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2298"><td class="num" id="LN2298">2298</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2299"><td class="num" id="LN2299">2299</td><td class="line">_handle_client_end_session_response (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="2300"><td class="num" id="LN2300">2300</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="2301"><td class="num" id="LN2301">2301</td><td class="line"> gboolean is_ok,</td></tr> +<tr class="codeline" data-linenumber="2302"><td class="num" id="LN2302">2302</td><td class="line"> gboolean do_last,</td></tr> +<tr class="codeline" data-linenumber="2303"><td class="num" id="LN2303">2303</td><td class="line"> gboolean cancel,</td></tr> +<tr class="codeline" data-linenumber="2304"><td class="num" id="LN2304">2304</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *reason)</td></tr> +<tr class="codeline" data-linenumber="2305"><td class="num" id="LN2305">2305</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2306"><td class="num" id="LN2306">2306</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2307"><td class="num" id="LN2307">2307</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2308"><td class="num" id="LN2308">2308</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2309"><td class="num" id="LN2309">2309</td><td class="line"> <span class='comment'>/* just ignore if received outside of shutdown */</span></td></tr> +<tr class="codeline" data-linenumber="2310"><td class="num" id="LN2310">2310</td><td class="line"> <span class='keyword'>if</span> (priv->phase < GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="2311"><td class="num" id="LN2311">2311</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="2312"><td class="num" id="LN2312">2312</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2313"><td class="num" id="LN2313">2313</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2314"><td class="num" id="LN2314">2314</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Response from end session request: is-ok=%d do-last=%d cancel=%d reason=%s"</span>, is_ok, do_last, cancel, reason ? reason :<span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="2315"><td class="num" id="LN2315">2315</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2316"><td class="num" id="LN2316">2316</td><td class="line"> <span class='keyword'>if</span> (cancel) {</td></tr> +<tr class="codeline" data-linenumber="2317"><td class="num" id="LN2317">2317</td><td class="line"> cancel_end_session (manager);</td></tr> +<tr class="codeline" data-linenumber="2318"><td class="num" id="LN2318">2318</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="2319"><td class="num" id="LN2319">2319</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2320"><td class="num" id="LN2320">2320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2321"><td class="num" id="LN2321">2321</td><td class="line"> priv->query_clients = g_slist_remove (priv->query_clients, client);</td></tr> +<tr class="codeline" data-linenumber="2322"><td class="num" id="LN2322">2322</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2323"><td class="num" id="LN2323">2323</td><td class="line"> <span class='keyword'>if</span> (! is_ok && priv->logout_mode != GSM_MANAGER_LOGOUT_MODE_FORCE) {</td></tr> +<tr class="codeline" data-linenumber="2324"><td class="num" id="LN2324">2324</td><td class="line"> guint cookie;</td></tr> +<tr class="codeline" data-linenumber="2325"><td class="num" id="LN2325">2325</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="2326"><td class="num" id="LN2326">2326</td><td class="line"> <span class='keyword'>char</span> *app_id;</td></tr> +<tr class="codeline" data-linenumber="2327"><td class="num" id="LN2327">2327</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *bus_name;</td></tr> +<tr class="codeline" data-linenumber="2328"><td class="num" id="LN2328">2328</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2329"><td class="num" id="LN2329">2329</td><td class="line"> <span class='comment'>/* FIXME: do we support updating the reason? */</span></td></tr> +<tr class="codeline" data-linenumber="2330"><td class="num" id="LN2330">2330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2331"><td class="num" id="LN2331">2331</td><td class="line"> <span class='comment'>/* Create JIT inhibit */</span></td></tr> +<tr class="codeline" data-linenumber="2332"><td class="num" id="LN2332">2332</td><td class="line"> <span class='keyword'>if</span> (GSM_IS_DBUS_CLIENT (client)) {</td></tr> +<tr class="codeline" data-linenumber="2333"><td class="num" id="LN2333">2333</td><td class="line"> bus_name = gsm_dbus_client_get_bus_name (GSM_DBUS_CLIENT (client));</td></tr> +<tr class="codeline" data-linenumber="2334"><td class="num" id="LN2334">2334</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2335"><td class="num" id="LN2335">2335</td><td class="line"> bus_name = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2336"><td class="num" id="LN2336">2336</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2337"><td class="num" id="LN2337">2337</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2338"><td class="num" id="LN2338">2338</td><td class="line"> app_id = <span class='macro'>g_strdup (gsm_client_peek_app_id (client))<span class='macro_popup'>g_strdup_inline (gsm_client_peek_app_id (client))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2339"><td class="num" id="LN2339">2339</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (app_id)<span class='macro_popup'>((app_id)==((void*)0)||(app_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2340"><td class="num" id="LN2340">2340</td><td class="line"> <span class='comment'>/* XSMP clients don't give us an app id unless we start them */</span></td></tr> +<tr class="codeline" data-linenumber="2341"><td class="num" id="LN2341">2341</td><td class="line"> g_free (app_id);</td></tr> +<tr class="codeline" data-linenumber="2342"><td class="num" id="LN2342">2342</td><td class="line"> app_id = gsm_client_get_app_name (client);</td></tr> +<tr class="codeline" data-linenumber="2343"><td class="num" id="LN2343">2343</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2344"><td class="num" id="LN2344">2344</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2345"><td class="num" id="LN2345">2345</td><td class="line"> cookie = _generate_unique_cookie (manager);</td></tr> +<tr class="codeline" data-linenumber="2346"><td class="num" id="LN2346">2346</td><td class="line"> inhibitor = gsm_inhibitor_new_for_client (gsm_client_peek_id (client),</td></tr> +<tr class="codeline" data-linenumber="2347"><td class="num" id="LN2347">2347</td><td class="line"> app_id,</td></tr> +<tr class="codeline" data-linenumber="2348"><td class="num" id="LN2348">2348</td><td class="line"> GSM_INHIBITOR_FLAG_LOGOUT,</td></tr> +<tr class="codeline" data-linenumber="2349"><td class="num" id="LN2349">2349</td><td class="line"> reason != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> ? reason : <span class='macro'>_(<span class='string_literal'>"Not responding"</span>)<span class='macro_popup'>gettext ("Not responding")</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2350"><td class="num" id="LN2350">2350</td><td class="line"> bus_name,</td></tr> +<tr class="codeline" data-linenumber="2351"><td class="num" id="LN2351">2351</td><td class="line"> cookie);</td></tr> +<tr class="codeline" data-linenumber="2352"><td class="num" id="LN2352">2352</td><td class="line"> g_free (app_id);</td></tr> +<tr class="codeline" data-linenumber="2353"><td class="num" id="LN2353">2353</td><td class="line"> gsm_store_add (priv->inhibitors, gsm_inhibitor_peek_id (inhibitor), <span class='macro'>G_OBJECT (inhibitor)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((inhibitor)), (((GType) ((20) << (2))))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2354"><td class="num" id="LN2354">2354</td><td class="line"> g_object_unref (inhibitor);</td></tr> +<tr class="codeline" data-linenumber="2355"><td class="num" id="LN2355">2355</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2356"><td class="num" id="LN2356">2356</td><td class="line"> gsm_store_foreach_remove (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="2357"><td class="num" id="LN2357">2357</td><td class="line"> (GsmStoreFunc)inhibitor_has_client_id,</td></tr> +<tr class="codeline" data-linenumber="2358"><td class="num" id="LN2358">2358</td><td class="line"> (gpointer)gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="2359"><td class="num" id="LN2359">2359</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2360"><td class="num" id="LN2360">2360</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2361"><td class="num" id="LN2361">2361</td><td class="line"> <span class='keyword'>if</span> (priv->phase == GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="2362"><td class="num" id="LN2362">2362</td><td class="line"> <span class='keyword'>if</span> (priv->query_clients == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2363"><td class="num" id="LN2363">2363</td><td class="line"> query_end_session_complete (manager);</td></tr> +<tr class="codeline" data-linenumber="2364"><td class="num" id="LN2364">2364</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2365"><td class="num" id="LN2365">2365</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (priv->phase == GSM_MANAGER_PHASE_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="2366"><td class="num" id="LN2366">2366</td><td class="line"> <span class='keyword'>if</span> (do_last) {</td></tr> +<tr class="codeline" data-linenumber="2367"><td class="num" id="LN2367">2367</td><td class="line"> <span class='comment'>/* This only makes sense if we're in part 1 of</span></td></tr> +<tr class="codeline" data-linenumber="2368"><td class="num" id="LN2368">2368</td><td class="line"> <span class='comment'>* GSM_MANAGER_PHASE_END_SESSION. Doing this in part 2</span></td></tr> +<tr class="codeline" data-linenumber="2369"><td class="num" id="LN2369">2369</td><td class="line"> <span class='comment'>* can only happen because of a buggy client that loops</span></td></tr> +<tr class="codeline" data-linenumber="2370"><td class="num" id="LN2370">2370</td><td class="line"> <span class='comment'>* wanting to be last again and again. The phase</span></td></tr> +<tr class="codeline" data-linenumber="2371"><td class="num" id="LN2371">2371</td><td class="line"> <span class='comment'>* timeout will take care of this issue. */</span></td></tr> +<tr class="codeline" data-linenumber="2372"><td class="num" id="LN2372">2372</td><td class="line"> priv->next_query_clients = g_slist_prepend (priv->next_query_clients,</td></tr> +<tr class="codeline" data-linenumber="2373"><td class="num" id="LN2373">2373</td><td class="line"> client);</td></tr> +<tr class="codeline" data-linenumber="2374"><td class="num" id="LN2374">2374</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2375"><td class="num" id="LN2375">2375</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2376"><td class="num" id="LN2376">2376</td><td class="line"> <span class='comment'>/* we can continue to the next step if all clients have replied</span></td></tr> +<tr class="codeline" data-linenumber="2377"><td class="num" id="LN2377">2377</td><td class="line"> <span class='comment'>* and if there's no inhibitor */</span></td></tr> +<tr class="codeline" data-linenumber="2378"><td class="num" id="LN2378">2378</td><td class="line"> <span class='keyword'>if</span> (priv->query_clients != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2379"><td class="num" id="LN2379">2379</td><td class="line"> || gsm_manager_is_logout_inhibited (manager)) {</td></tr> +<tr class="codeline" data-linenumber="2380"><td class="num" id="LN2380">2380</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="2381"><td class="num" id="LN2381">2381</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2382"><td class="num" id="LN2382">2382</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2383"><td class="num" id="LN2383">2383</td><td class="line"> <span class='keyword'>if</span> (priv->next_query_clients != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2384"><td class="num" id="LN2384">2384</td><td class="line"> do_phase_end_session_part_2 (manager);</td></tr> +<tr class="codeline" data-linenumber="2385"><td class="num" id="LN2385">2385</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2386"><td class="num" id="LN2386">2386</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="2387"><td class="num" id="LN2387">2387</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2388"><td class="num" id="LN2388">2388</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2389"><td class="num" id="LN2389">2389</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2390"><td class="num" id="LN2390">2390</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2391"><td class="num" id="LN2391">2391</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2392"><td class="num" id="LN2392">2392</td><td class="line">on_client_end_session_response (GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="2393"><td class="num" id="LN2393">2393</td><td class="line"> gboolean is_ok,</td></tr> +<tr class="codeline" data-linenumber="2394"><td class="num" id="LN2394">2394</td><td class="line"> gboolean do_last,</td></tr> +<tr class="codeline" data-linenumber="2395"><td class="num" id="LN2395">2395</td><td class="line"> gboolean cancel,</td></tr> +<tr class="codeline" data-linenumber="2396"><td class="num" id="LN2396">2396</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *reason,</td></tr> +<tr class="codeline" data-linenumber="2397"><td class="num" id="LN2397">2397</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2398"><td class="num" id="LN2398">2398</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2399"><td class="num" id="LN2399">2399</td><td class="line"> _handle_client_end_session_response (manager,</td></tr> +<tr class="codeline" data-linenumber="2400"><td class="num" id="LN2400">2400</td><td class="line"> client,</td></tr> +<tr class="codeline" data-linenumber="2401"><td class="num" id="LN2401">2401</td><td class="line"> is_ok,</td></tr> +<tr class="codeline" data-linenumber="2402"><td class="num" id="LN2402">2402</td><td class="line"> do_last,</td></tr> +<tr class="codeline" data-linenumber="2403"><td class="num" id="LN2403">2403</td><td class="line"> cancel,</td></tr> +<tr class="codeline" data-linenumber="2404"><td class="num" id="LN2404">2404</td><td class="line"> reason);</td></tr> +<tr class="codeline" data-linenumber="2405"><td class="num" id="LN2405">2405</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2406"><td class="num" id="LN2406">2406</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2407"><td class="num" id="LN2407">2407</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2408"><td class="num" id="LN2408">2408</td><td class="line">on_xsmp_client_logout_request (GsmXSMPClient *client,</td></tr> +<tr class="codeline" data-linenumber="2409"><td class="num" id="LN2409">2409</td><td class="line"> gboolean show_dialog,</td></tr> +<tr class="codeline" data-linenumber="2410"><td class="num" id="LN2410">2410</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2411"><td class="num" id="LN2411">2411</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2412"><td class="num" id="LN2412">2412</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="2413"><td class="num" id="LN2413">2413</td><td class="line"> <span class='keyword'>int</span> logout_mode;</td></tr> +<tr class="codeline" data-linenumber="2414"><td class="num" id="LN2414">2414</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2415"><td class="num" id="LN2415">2415</td><td class="line"> <span class='keyword'>if</span> (show_dialog) {</td></tr> +<tr class="codeline" data-linenumber="2416"><td class="num" id="LN2416">2416</td><td class="line"> logout_mode = GSM_MANAGER_LOGOUT_MODE_NORMAL;</td></tr> +<tr class="codeline" data-linenumber="2417"><td class="num" id="LN2417">2417</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2418"><td class="num" id="LN2418">2418</td><td class="line"> logout_mode = GSM_MANAGER_LOGOUT_MODE_NO_CONFIRMATION;</td></tr> +<tr class="codeline" data-linenumber="2419"><td class="num" id="LN2419">2419</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2420"><td class="num" id="LN2420">2420</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2421"><td class="num" id="LN2421">2421</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2422"><td class="num" id="LN2422">2422</td><td class="line"> gsm_manager_logout (manager, logout_mode, &error);</td></tr> +<tr class="codeline" data-linenumber="2423"><td class="num" id="LN2423">2423</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2424"><td class="num" id="LN2424">2424</td><td class="line"> g_warning (<span class='string_literal'>"Unable to logout: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="2425"><td class="num" id="LN2425">2425</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="2426"><td class="num" id="LN2426">2426</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2427"><td class="num" id="LN2427">2427</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2428"><td class="num" id="LN2428">2428</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2429"><td class="num" id="LN2429">2429</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2430"><td class="num" id="LN2430">2430</td><td class="line">on_store_client_added (GsmStore *store,</td></tr> +<tr class="codeline" data-linenumber="2431"><td class="num" id="LN2431">2431</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="2432"><td class="num" id="LN2432">2432</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2433"><td class="num" id="LN2433">2433</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2434"><td class="num" id="LN2434">2434</td><td class="line"> GsmClient *client;</td></tr> +<tr class="codeline" data-linenumber="2435"><td class="num" id="LN2435">2435</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2436"><td class="num" id="LN2436">2436</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Client added: %s"</span>, id);</td></tr> +<tr class="codeline" data-linenumber="2437"><td class="num" id="LN2437">2437</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2438"><td class="num" id="LN2438">2438</td><td class="line"> client = (GsmClient *)gsm_store_lookup (store, id);</td></tr> +<tr class="codeline" data-linenumber="2439"><td class="num" id="LN2439">2439</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2440"><td class="num" id="LN2440">2440</td><td class="line"> <span class='comment'>/* a bit hacky */</span></td></tr> +<tr class="codeline" data-linenumber="2441"><td class="num" id="LN2441">2441</td><td class="line"> <span class='keyword'>if</span> (GSM_IS_XSMP_CLIENT (client)) {</td></tr> +<tr class="codeline" data-linenumber="2442"><td class="num" id="LN2442">2442</td><td class="line"> <span class='macro'>g_signal_connect (client,<span class='macro_popup'>g_signal_connect_data ((client), ("register-request"), (((GCallback<br>) (on_xsmp_client_register_request))), (manager), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2443"><td class="num" id="LN2443">2443</td><td class="line"> <span class='string_literal'><span class='macro'>"register-request"</span>,<span class='macro_popup'>g_signal_connect_data ((client), ("register-request"), (((GCallback<br>) (on_xsmp_client_register_request))), (manager), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2444"><td class="num" id="LN2444">2444</td><td class="line"> <span class='macro'>G_CALLBACK (on_xsmp_client_register_request),<span class='macro_popup'>g_signal_connect_data ((client), ("register-request"), (((GCallback<br>) (on_xsmp_client_register_request))), (manager), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2445"><td class="num" id="LN2445">2445</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((client), ("register-request"), (((GCallback<br>) (on_xsmp_client_register_request))), (manager), ((void*)0),<br> (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2446"><td class="num" id="LN2446">2446</td><td class="line"> <span class='macro'>g_signal_connect (client,<span class='macro_popup'>g_signal_connect_data ((client), ("logout-request"), (((GCallback<br>) (on_xsmp_client_logout_request))), (manager), ((void*)0), (<br>GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2447"><td class="num" id="LN2447">2447</td><td class="line"> <span class='string_literal'><span class='macro'>"logout-request"</span>,<span class='macro_popup'>g_signal_connect_data ((client), ("logout-request"), (((GCallback<br>) (on_xsmp_client_logout_request))), (manager), ((void*)0), (<br>GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2448"><td class="num" id="LN2448">2448</td><td class="line"> <span class='macro'>G_CALLBACK (on_xsmp_client_logout_request),<span class='macro_popup'>g_signal_connect_data ((client), ("logout-request"), (((GCallback<br>) (on_xsmp_client_logout_request))), (manager), ((void*)0), (<br>GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2449"><td class="num" id="LN2449">2449</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((client), ("logout-request"), (((GCallback<br>) (on_xsmp_client_logout_request))), (manager), ((void*)0), (<br>GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2450"><td class="num" id="LN2450">2450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2451"><td class="num" id="LN2451">2451</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2452"><td class="num" id="LN2452">2452</td><td class="line"> <span class='macro'>g_signal_connect (client,<span class='macro_popup'>g_signal_connect_data ((client), ("end-session-response"), ((<br>(GCallback) (on_client_end_session_response))), (manager), ((<br>void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2453"><td class="num" id="LN2453">2453</td><td class="line"> <span class='string_literal'><span class='macro'>"end-session-response"</span>,<span class='macro_popup'>g_signal_connect_data ((client), ("end-session-response"), ((<br>(GCallback) (on_client_end_session_response))), (manager), ((<br>void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2454"><td class="num" id="LN2454">2454</td><td class="line"> <span class='macro'>G_CALLBACK (on_client_end_session_response),<span class='macro_popup'>g_signal_connect_data ((client), ("end-session-response"), ((<br>(GCallback) (on_client_end_session_response))), (manager), ((<br>void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2455"><td class="num" id="LN2455">2455</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((client), ("end-session-response"), ((<br>(GCallback) (on_client_end_session_response))), (manager), ((<br>void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2456"><td class="num" id="LN2456">2456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2457"><td class="num" id="LN2457">2457</td><td class="line"> g_signal_emit (manager, signals [CLIENT_ADDED], 0, id);</td></tr> +<tr class="codeline" data-linenumber="2458"><td class="num" id="LN2458">2458</td><td class="line"> <span class='comment'>/* FIXME: disconnect signal handler */</span></td></tr> +<tr class="codeline" data-linenumber="2459"><td class="num" id="LN2459">2459</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2460"><td class="num" id="LN2460">2460</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2461"><td class="num" id="LN2461">2461</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2462"><td class="num" id="LN2462">2462</td><td class="line">on_store_client_removed (GsmStore *store,</td></tr> +<tr class="codeline" data-linenumber="2463"><td class="num" id="LN2463">2463</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="2464"><td class="num" id="LN2464">2464</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2465"><td class="num" id="LN2465">2465</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2466"><td class="num" id="LN2466">2466</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Client removed: %s"</span>, id);</td></tr> +<tr class="codeline" data-linenumber="2467"><td class="num" id="LN2467">2467</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2468"><td class="num" id="LN2468">2468</td><td class="line"> g_signal_emit (manager, signals [CLIENT_REMOVED], 0, id);</td></tr> +<tr class="codeline" data-linenumber="2469"><td class="num" id="LN2469">2469</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2470"><td class="num" id="LN2470">2470</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2471"><td class="num" id="LN2471">2471</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2472"><td class="num" id="LN2472">2472</td><td class="line">gsm_manager_set_client_store (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="2473"><td class="num" id="LN2473">2473</td><td class="line"> GsmStore *store)</td></tr> +<tr class="codeline" data-linenumber="2474"><td class="num" id="LN2474">2474</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2475"><td class="num" id="LN2475">2475</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2476"><td class="num" id="LN2476">2476</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2477"><td class="num" id="LN2477">2477</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_MANAGER (manager))<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2478"><td class="num" id="LN2478">2478</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2479"><td class="num" id="LN2479">2479</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2480"><td class="num" id="LN2480">2480</td><td class="line"> <span class='keyword'>if</span> (store != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2481"><td class="num" id="LN2481">2481</td><td class="line"> <span class='macro'>g_object_ref (store)<span class='macro_popup'>((__typeof__ (store)) (g_object_ref) (store))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2482"><td class="num" id="LN2482">2482</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2483"><td class="num" id="LN2483">2483</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2484"><td class="num" id="LN2484">2484</td><td class="line"> <span class='keyword'>if</span> (priv->clients != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2485"><td class="num" id="LN2485">2485</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (priv->clients,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_added), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2486"><td class="num" id="LN2486">2486</td><td class="line"> <span class='macro'>on_store_client_added,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_added), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2487"><td class="num" id="LN2487">2487</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_added), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2488"><td class="num" id="LN2488">2488</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (priv->clients,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_removed), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2489"><td class="num" id="LN2489">2489</td><td class="line"> <span class='macro'>on_store_client_removed,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_removed), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2490"><td class="num" id="LN2490">2490</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_removed), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2491"><td class="num" id="LN2491">2491</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2492"><td class="num" id="LN2492">2492</td><td class="line"> g_object_unref (priv->clients);</td></tr> +<tr class="codeline" data-linenumber="2493"><td class="num" id="LN2493">2493</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2494"><td class="num" id="LN2494">2494</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2495"><td class="num" id="LN2495">2495</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: setting client store %p"</span>, store);</td></tr> +<tr class="codeline" data-linenumber="2496"><td class="num" id="LN2496">2496</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2497"><td class="num" id="LN2497">2497</td><td class="line"> priv->clients = store;</td></tr> +<tr class="codeline" data-linenumber="2498"><td class="num" id="LN2498">2498</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2499"><td class="num" id="LN2499">2499</td><td class="line"> <span class='keyword'>if</span> (priv->clients != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2500"><td class="num" id="LN2500">2500</td><td class="line"> <span class='macro'>g_signal_connect (priv->clients,<span class='macro_popup'>g_signal_connect_data ((priv->clients), ("added"), (((GCallback<br>) (on_store_client_added))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2501"><td class="num" id="LN2501">2501</td><td class="line"> <span class='string_literal'><span class='macro'>"added"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->clients), ("added"), (((GCallback<br>) (on_store_client_added))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2502"><td class="num" id="LN2502">2502</td><td class="line"> <span class='macro'>G_CALLBACK (on_store_client_added),<span class='macro_popup'>g_signal_connect_data ((priv->clients), ("added"), (((GCallback<br>) (on_store_client_added))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2503"><td class="num" id="LN2503">2503</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->clients), ("added"), (((GCallback<br>) (on_store_client_added))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2504"><td class="num" id="LN2504">2504</td><td class="line"> <span class='macro'>g_signal_connect (priv->clients,<span class='macro_popup'>g_signal_connect_data ((priv->clients), ("removed"), (((GCallback<br>) (on_store_client_removed))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2505"><td class="num" id="LN2505">2505</td><td class="line"> <span class='string_literal'><span class='macro'>"removed"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->clients), ("removed"), (((GCallback<br>) (on_store_client_removed))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2506"><td class="num" id="LN2506">2506</td><td class="line"> <span class='macro'>G_CALLBACK (on_store_client_removed),<span class='macro_popup'>g_signal_connect_data ((priv->clients), ("removed"), (((GCallback<br>) (on_store_client_removed))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2507"><td class="num" id="LN2507">2507</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->clients), ("removed"), (((GCallback<br>) (on_store_client_removed))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2508"><td class="num" id="LN2508">2508</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2509"><td class="num" id="LN2509">2509</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2510"><td class="num" id="LN2510">2510</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2511"><td class="num" id="LN2511">2511</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2512"><td class="num" id="LN2512">2512</td><td class="line">gsm_manager_set_property (GObject *object,</td></tr> +<tr class="codeline" data-linenumber="2513"><td class="num" id="LN2513">2513</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="2514"><td class="num" id="LN2514">2514</td><td class="line"> <span class='keyword'>const</span> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="2515"><td class="num" id="LN2515">2515</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="2516"><td class="num" id="LN2516">2516</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2517"><td class="num" id="LN2517">2517</td><td class="line"> GsmManager *self;</td></tr> +<tr class="codeline" data-linenumber="2518"><td class="num" id="LN2518">2518</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2519"><td class="num" id="LN2519">2519</td><td class="line"> self = GSM_MANAGER (object);</td></tr> +<tr class="codeline" data-linenumber="2520"><td class="num" id="LN2520">2520</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2521"><td class="num" id="LN2521">2521</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="2522"><td class="num" id="LN2522">2522</td><td class="line"> <span class='keyword'>case</span> PROP_FAILSAFE:</td></tr> +<tr class="codeline" data-linenumber="2523"><td class="num" id="LN2523">2523</td><td class="line"> gsm_manager_set_failsafe (self, g_value_get_boolean (value));</td></tr> +<tr class="codeline" data-linenumber="2524"><td class="num" id="LN2524">2524</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="2525"><td class="num" id="LN2525">2525</td><td class="line"> <span class='keyword'>case</span> PROP_CLIENT_STORE:</td></tr> +<tr class="codeline" data-linenumber="2526"><td class="num" id="LN2526">2526</td><td class="line"> gsm_manager_set_client_store (self, g_value_get_object (value));</td></tr> +<tr class="codeline" data-linenumber="2527"><td class="num" id="LN2527">2527</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="2528"><td class="num" id="LN2528">2528</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="2529"><td class="num" id="LN2529">2529</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "gsm-manager.c", 2529, ("property"), _glib__property_id, _glib__pspec<br>->name, g_type_name ((((((GTypeClass*) (((GTypeInstance*) (<br>_glib__pspec))->g_class))->g_type)))), (g_type_name (((<br>(((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2530"><td class="num" id="LN2530">2530</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="2531"><td class="num" id="LN2531">2531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2532"><td class="num" id="LN2532">2532</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2533"><td class="num" id="LN2533">2533</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2534"><td class="num" id="LN2534">2534</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2535"><td class="num" id="LN2535">2535</td><td class="line">gsm_manager_get_property (GObject *object,</td></tr> +<tr class="codeline" data-linenumber="2536"><td class="num" id="LN2536">2536</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="2537"><td class="num" id="LN2537">2537</td><td class="line"> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="2538"><td class="num" id="LN2538">2538</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="2539"><td class="num" id="LN2539">2539</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2540"><td class="num" id="LN2540">2540</td><td class="line"> GsmManager *self;</td></tr> +<tr class="codeline" data-linenumber="2541"><td class="num" id="LN2541">2541</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2542"><td class="num" id="LN2542">2542</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2543"><td class="num" id="LN2543">2543</td><td class="line"> self = GSM_MANAGER (object);</td></tr> +<tr class="codeline" data-linenumber="2544"><td class="num" id="LN2544">2544</td><td class="line"> priv = gsm_manager_get_instance_private (self);</td></tr> +<tr class="codeline" data-linenumber="2545"><td class="num" id="LN2545">2545</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2546"><td class="num" id="LN2546">2546</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="2547"><td class="num" id="LN2547">2547</td><td class="line"> <span class='keyword'>case</span> PROP_FAILSAFE:</td></tr> +<tr class="codeline" data-linenumber="2548"><td class="num" id="LN2548">2548</td><td class="line"> g_value_set_boolean (value, priv->failsafe);</td></tr> +<tr class="codeline" data-linenumber="2549"><td class="num" id="LN2549">2549</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="2550"><td class="num" id="LN2550">2550</td><td class="line"> <span class='keyword'>case</span> PROP_CLIENT_STORE:</td></tr> +<tr class="codeline" data-linenumber="2551"><td class="num" id="LN2551">2551</td><td class="line"> g_value_set_object (value, priv->clients);</td></tr> +<tr class="codeline" data-linenumber="2552"><td class="num" id="LN2552">2552</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="2553"><td class="num" id="LN2553">2553</td><td class="line"> <span class='keyword'>case</span> PROP_RENDERER:</td></tr> +<tr class="codeline" data-linenumber="2554"><td class="num" id="LN2554">2554</td><td class="line"> g_value_set_string (value, priv->renderer);</td></tr> +<tr class="codeline" data-linenumber="2555"><td class="num" id="LN2555">2555</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="2556"><td class="num" id="LN2556">2556</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="2557"><td class="num" id="LN2557">2557</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "gsm-manager.c", 2557, ("property"), _glib__property_id, _glib__pspec<br>->name, g_type_name ((((((GTypeClass*) (((GTypeInstance*) (<br>_glib__pspec))->g_class))->g_type)))), (g_type_name (((<br>(((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2558"><td class="num" id="LN2558">2558</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="2559"><td class="num" id="LN2559">2559</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2560"><td class="num" id="LN2560">2560</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2561"><td class="num" id="LN2561">2561</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2562"><td class="num" id="LN2562">2562</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="2563"><td class="num" id="LN2563">2563</td><td class="line">_find_app_provides (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="2564"><td class="num" id="LN2564">2564</td><td class="line"> GsmApp *app,</td></tr> +<tr class="codeline" data-linenumber="2565"><td class="num" id="LN2565">2565</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *service)</td></tr> +<tr class="codeline" data-linenumber="2566"><td class="num" id="LN2566">2566</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2567"><td class="num" id="LN2567">2567</td><td class="line"> <span class='keyword'>return</span> gsm_app_provides (app, service);</td></tr> +<tr class="codeline" data-linenumber="2568"><td class="num" id="LN2568">2568</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2569"><td class="num" id="LN2569">2569</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2570"><td class="num" id="LN2570">2570</td><td class="line"><span class='keyword'>static</span> GObject *</td></tr> +<tr class="codeline" data-linenumber="2571"><td class="num" id="LN2571">2571</td><td class="line">gsm_manager_constructor (GType type,</td></tr> +<tr class="codeline" data-linenumber="2572"><td class="num" id="LN2572">2572</td><td class="line"> guint n_construct_properties,</td></tr> +<tr class="codeline" data-linenumber="2573"><td class="num" id="LN2573">2573</td><td class="line"> GObjectConstructParam *construct_properties)</td></tr> +<tr class="codeline" data-linenumber="2574"><td class="num" id="LN2574">2574</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2575"><td class="num" id="LN2575">2575</td><td class="line"> GsmManager *manager;</td></tr> +<tr class="codeline" data-linenumber="2576"><td class="num" id="LN2576">2576</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2577"><td class="num" id="LN2577">2577</td><td class="line"> manager = GSM_MANAGER (<span class='macro'>G_OBJECT_CLASS (gsm_manager_parent_class)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((gsm_manager_parent_class)), (((GType) ((20) << (2)<br>)))))))</span></span>->constructor (type,</td></tr> +<tr class="codeline" data-linenumber="2578"><td class="num" id="LN2578">2578</td><td class="line"> n_construct_properties,</td></tr> +<tr class="codeline" data-linenumber="2579"><td class="num" id="LN2579">2579</td><td class="line"> construct_properties));</td></tr> +<tr class="codeline" data-linenumber="2580"><td class="num" id="LN2580">2580</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>G_OBJECT (manager)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((manager)), (((GType) ((20) << (2))))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2581"><td class="num" id="LN2581">2581</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2582"><td class="num" id="LN2582">2582</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2583"><td class="num" id="LN2583">2583</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2584"><td class="num" id="LN2584">2584</td><td class="line">on_store_inhibitor_added (GsmStore *store,</td></tr> +<tr class="codeline" data-linenumber="2585"><td class="num" id="LN2585">2585</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="2586"><td class="num" id="LN2586">2586</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2587"><td class="num" id="LN2587">2587</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2588"><td class="num" id="LN2588">2588</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Inhibitor added: %s"</span>, id);</td></tr> +<tr class="codeline" data-linenumber="2589"><td class="num" id="LN2589">2589</td><td class="line"> g_signal_emit (manager, signals [INHIBITOR_ADDED], 0, id);</td></tr> +<tr class="codeline" data-linenumber="2590"><td class="num" id="LN2590">2590</td><td class="line"> update_idle (manager);</td></tr> +<tr class="codeline" data-linenumber="2591"><td class="num" id="LN2591">2591</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2592"><td class="num" id="LN2592">2592</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2593"><td class="num" id="LN2593">2593</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2594"><td class="num" id="LN2594">2594</td><td class="line">on_store_inhibitor_removed (GsmStore *store,</td></tr> +<tr class="codeline" data-linenumber="2595"><td class="num" id="LN2595">2595</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="2596"><td class="num" id="LN2596">2596</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2597"><td class="num" id="LN2597">2597</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2598"><td class="num" id="LN2598">2598</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Inhibitor removed: %s"</span>, id);</td></tr> +<tr class="codeline" data-linenumber="2599"><td class="num" id="LN2599">2599</td><td class="line"> g_signal_emit (manager, signals [INHIBITOR_REMOVED], 0, id);</td></tr> +<tr class="codeline" data-linenumber="2600"><td class="num" id="LN2600">2600</td><td class="line"> update_idle (manager);</td></tr> +<tr class="codeline" data-linenumber="2601"><td class="num" id="LN2601">2601</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2602"><td class="num" id="LN2602">2602</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2603"><td class="num" id="LN2603">2603</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2604"><td class="num" id="LN2604">2604</td><td class="line">gsm_manager_dispose (GObject *object)</td></tr> +<tr class="codeline" data-linenumber="2605"><td class="num" id="LN2605">2605</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2606"><td class="num" id="LN2606">2606</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2607"><td class="num" id="LN2607">2607</td><td class="line"> GsmManager *manager = GSM_MANAGER (object);</td></tr> +<tr class="codeline" data-linenumber="2608"><td class="num" id="LN2608">2608</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2609"><td class="num" id="LN2609">2609</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: disposing manager"</span>);</td></tr> +<tr class="codeline" data-linenumber="2610"><td class="num" id="LN2610">2610</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2611"><td class="num" id="LN2611">2611</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2612"><td class="num" id="LN2612">2612</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2613"><td class="num" id="LN2613">2613</td><td class="line"> <span class='keyword'>if</span> (priv->clients != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2614"><td class="num" id="LN2614">2614</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (priv->clients,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_added), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2615"><td class="num" id="LN2615">2615</td><td class="line"> <span class='macro'>on_store_client_added,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_added), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2616"><td class="num" id="LN2616">2616</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_added), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2617"><td class="num" id="LN2617">2617</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (priv->clients,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_removed), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2618"><td class="num" id="LN2618">2618</td><td class="line"> <span class='macro'>on_store_client_removed,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_removed), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2619"><td class="num" id="LN2619">2619</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_removed), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2620"><td class="num" id="LN2620">2620</td><td class="line"> g_object_unref (priv->clients);</td></tr> +<tr class="codeline" data-linenumber="2621"><td class="num" id="LN2621">2621</td><td class="line"> priv->clients = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2622"><td class="num" id="LN2622">2622</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2623"><td class="num" id="LN2623">2623</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2624"><td class="num" id="LN2624">2624</td><td class="line"> <span class='keyword'>if</span> (priv->apps != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2625"><td class="num" id="LN2625">2625</td><td class="line"> g_object_unref (priv->apps);</td></tr> +<tr class="codeline" data-linenumber="2626"><td class="num" id="LN2626">2626</td><td class="line"> priv->apps = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2627"><td class="num" id="LN2627">2627</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2628"><td class="num" id="LN2628">2628</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2629"><td class="num" id="LN2629">2629</td><td class="line"> <span class='keyword'>if</span> (priv->inhibitors != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2630"><td class="num" id="LN2630">2630</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (priv->inhibitors,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->inhibitors), (<br>GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA)<br>, 0, 0, ((void*)0), (on_store_inhibitor_added), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2631"><td class="num" id="LN2631">2631</td><td class="line"> <span class='macro'>on_store_inhibitor_added,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->inhibitors), (<br>GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA)<br>, 0, 0, ((void*)0), (on_store_inhibitor_added), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2632"><td class="num" id="LN2632">2632</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->inhibitors), (<br>GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA)<br>, 0, 0, ((void*)0), (on_store_inhibitor_added), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2633"><td class="num" id="LN2633">2633</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (priv->inhibitors,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->inhibitors), (<br>GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA)<br>, 0, 0, ((void*)0), (on_store_inhibitor_removed), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2634"><td class="num" id="LN2634">2634</td><td class="line"> <span class='macro'>on_store_inhibitor_removed,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->inhibitors), (<br>GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA)<br>, 0, 0, ((void*)0), (on_store_inhibitor_removed), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2635"><td class="num" id="LN2635">2635</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->inhibitors), (<br>GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA)<br>, 0, 0, ((void*)0), (on_store_inhibitor_removed), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2636"><td class="num" id="LN2636">2636</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2637"><td class="num" id="LN2637">2637</td><td class="line"> g_object_unref (priv->inhibitors);</td></tr> +<tr class="codeline" data-linenumber="2638"><td class="num" id="LN2638">2638</td><td class="line"> priv->inhibitors = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2639"><td class="num" id="LN2639">2639</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2640"><td class="num" id="LN2640">2640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2641"><td class="num" id="LN2641">2641</td><td class="line"> <span class='keyword'>if</span> (priv->presence != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2642"><td class="num" id="LN2642">2642</td><td class="line"> g_object_unref (priv->presence);</td></tr> +<tr class="codeline" data-linenumber="2643"><td class="num" id="LN2643">2643</td><td class="line"> priv->presence = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2644"><td class="num" id="LN2644">2644</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2645"><td class="num" id="LN2645">2645</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2646"><td class="num" id="LN2646">2646</td><td class="line"> <span class='keyword'>if</span> (priv->settings_session) {</td></tr> +<tr class="codeline" data-linenumber="2647"><td class="num" id="LN2647">2647</td><td class="line"> g_object_unref (priv->settings_session);</td></tr> +<tr class="codeline" data-linenumber="2648"><td class="num" id="LN2648">2648</td><td class="line"> priv->settings_session = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2649"><td class="num" id="LN2649">2649</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2650"><td class="num" id="LN2650">2650</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2651"><td class="num" id="LN2651">2651</td><td class="line"> <span class='keyword'>if</span> (priv->settings_lockdown) {</td></tr> +<tr class="codeline" data-linenumber="2652"><td class="num" id="LN2652">2652</td><td class="line"> g_object_unref (priv->settings_lockdown);</td></tr> +<tr class="codeline" data-linenumber="2653"><td class="num" id="LN2653">2653</td><td class="line"> priv->settings_lockdown = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2654"><td class="num" id="LN2654">2654</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2655"><td class="num" id="LN2655">2655</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2656"><td class="num" id="LN2656">2656</td><td class="line"> <span class='keyword'>if</span> (priv->settings_screensaver) {</td></tr> +<tr class="codeline" data-linenumber="2657"><td class="num" id="LN2657">2657</td><td class="line"> g_object_unref (priv->settings_screensaver);</td></tr> +<tr class="codeline" data-linenumber="2658"><td class="num" id="LN2658">2658</td><td class="line"> priv->settings_screensaver = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2659"><td class="num" id="LN2659">2659</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2660"><td class="num" id="LN2660">2660</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2661"><td class="num" id="LN2661">2661</td><td class="line"> <span class='macro'>g_clear_pointer (&priv->renderer, g_free)<span class='macro_popup'>do { _Static_assert (sizeof *(&priv->renderer) == sizeof<br> (gpointer), "Expression evaluates to false"); __typeof__ ((&<br>priv->renderer)) _pp = (&priv->renderer); __typeof__<br> (*(&priv->renderer)) _ptr = *_pp; *_pp = ((void*)0); if<br> (_ptr) (g_free) (_ptr); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2662"><td class="num" id="LN2662">2662</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2663"><td class="num" id="LN2663">2663</td><td class="line"> <span class='macro'>G_OBJECT_CLASS (gsm_manager_parent_class)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((gsm_manager_parent_class)), (((GType) ((20) << (2)<br>)))))))</span></span>->dispose (object);</td></tr> +<tr class="codeline" data-linenumber="2664"><td class="num" id="LN2664">2664</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2665"><td class="num" id="LN2665">2665</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2666"><td class="num" id="LN2666">2666</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2667"><td class="num" id="LN2667">2667</td><td class="line">gsm_manager_class_init (GsmManagerClass *klass)</td></tr> +<tr class="codeline" data-linenumber="2668"><td class="num" id="LN2668">2668</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2669"><td class="num" id="LN2669">2669</td><td class="line"> GObjectClass *object_class = <span class='macro'>G_OBJECT_CLASS (klass)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((klass)), (((GType) ((20) << (2))))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2670"><td class="num" id="LN2670">2670</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2671"><td class="num" id="LN2671">2671</td><td class="line"> object_class->get_property = gsm_manager_get_property;</td></tr> +<tr class="codeline" data-linenumber="2672"><td class="num" id="LN2672">2672</td><td class="line"> object_class->set_property = gsm_manager_set_property;</td></tr> +<tr class="codeline" data-linenumber="2673"><td class="num" id="LN2673">2673</td><td class="line"> object_class->constructor = gsm_manager_constructor;</td></tr> +<tr class="codeline" data-linenumber="2674"><td class="num" id="LN2674">2674</td><td class="line"> object_class->finalize = gsm_manager_finalize;</td></tr> +<tr class="codeline" data-linenumber="2675"><td class="num" id="LN2675">2675</td><td class="line"> object_class->dispose = gsm_manager_dispose;</td></tr> +<tr class="codeline" data-linenumber="2676"><td class="num" id="LN2676">2676</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2677"><td class="num" id="LN2677">2677</td><td class="line"> signals [PHASE_CHANGED] =</td></tr> +<tr class="codeline" data-linenumber="2678"><td class="num" id="LN2678">2678</td><td class="line"> g_signal_new (<span class='string_literal'>"phase-changed"</span>,</td></tr> +<tr class="codeline" data-linenumber="2679"><td class="num" id="LN2679">2679</td><td class="line"> <span class='macro'>G_TYPE_FROM_CLASS (object_class)<span class='macro_popup'>(((GTypeClass*) (object_class))->g_type)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2680"><td class="num" id="LN2680">2680</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="2681"><td class="num" id="LN2681">2681</td><td class="line"> <span class='macro'>G_STRUCT_OFFSET (GsmManagerClass, phase_changed)<span class='macro_popup'>((glong) __builtin_offsetof(GsmManagerClass, phase_changed))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2682"><td class="num" id="LN2682">2682</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2683"><td class="num" id="LN2683">2683</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2684"><td class="num" id="LN2684">2684</td><td class="line"> g_cclosure_marshal_VOID__STRING,</td></tr> +<tr class="codeline" data-linenumber="2685"><td class="num" id="LN2685">2685</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2686"><td class="num" id="LN2686">2686</td><td class="line"> 1, <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2687"><td class="num" id="LN2687">2687</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2688"><td class="num" id="LN2688">2688</td><td class="line"> signals [SESSION_RUNNING] =</td></tr> +<tr class="codeline" data-linenumber="2689"><td class="num" id="LN2689">2689</td><td class="line"> g_signal_new (<span class='string_literal'>"session-running"</span>,</td></tr> +<tr class="codeline" data-linenumber="2690"><td class="num" id="LN2690">2690</td><td class="line"> <span class='macro'>G_OBJECT_CLASS_TYPE (object_class)<span class='macro_popup'>((((GTypeClass*) (object_class))->g_type))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2691"><td class="num" id="LN2691">2691</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="2692"><td class="num" id="LN2692">2692</td><td class="line"> <span class='macro'>G_STRUCT_OFFSET (GsmManagerClass, session_running)<span class='macro_popup'>((glong) __builtin_offsetof(GsmManagerClass, session_running)<br>)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2693"><td class="num" id="LN2693">2693</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2694"><td class="num" id="LN2694">2694</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2695"><td class="num" id="LN2695">2695</td><td class="line"> g_cclosure_marshal_VOID__VOID,</td></tr> +<tr class="codeline" data-linenumber="2696"><td class="num" id="LN2696">2696</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2697"><td class="num" id="LN2697">2697</td><td class="line"> 0);</td></tr> +<tr class="codeline" data-linenumber="2698"><td class="num" id="LN2698">2698</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2699"><td class="num" id="LN2699">2699</td><td class="line"> signals [SESSION_OVER] =</td></tr> +<tr class="codeline" data-linenumber="2700"><td class="num" id="LN2700">2700</td><td class="line"> g_signal_new (<span class='string_literal'>"session-over"</span>,</td></tr> +<tr class="codeline" data-linenumber="2701"><td class="num" id="LN2701">2701</td><td class="line"> <span class='macro'>G_OBJECT_CLASS_TYPE (object_class)<span class='macro_popup'>((((GTypeClass*) (object_class))->g_type))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2702"><td class="num" id="LN2702">2702</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="2703"><td class="num" id="LN2703">2703</td><td class="line"> <span class='macro'>G_STRUCT_OFFSET (GsmManagerClass, session_over)<span class='macro_popup'>((glong) __builtin_offsetof(GsmManagerClass, session_over))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2704"><td class="num" id="LN2704">2704</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2705"><td class="num" id="LN2705">2705</td><td class="line"> g_cclosure_marshal_VOID__VOID,</td></tr> +<tr class="codeline" data-linenumber="2706"><td class="num" id="LN2706">2706</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2707"><td class="num" id="LN2707">2707</td><td class="line"> 0);</td></tr> +<tr class="codeline" data-linenumber="2708"><td class="num" id="LN2708">2708</td><td class="line"> signals [CLIENT_ADDED] =</td></tr> +<tr class="codeline" data-linenumber="2709"><td class="num" id="LN2709">2709</td><td class="line"> g_signal_new (<span class='string_literal'>"client-added"</span>,</td></tr> +<tr class="codeline" data-linenumber="2710"><td class="num" id="LN2710">2710</td><td class="line"> <span class='macro'>G_TYPE_FROM_CLASS (object_class)<span class='macro_popup'>(((GTypeClass*) (object_class))->g_type)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2711"><td class="num" id="LN2711">2711</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="2712"><td class="num" id="LN2712">2712</td><td class="line"> <span class='macro'>G_STRUCT_OFFSET (GsmManagerClass, client_added)<span class='macro_popup'>((glong) __builtin_offsetof(GsmManagerClass, client_added))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2713"><td class="num" id="LN2713">2713</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2714"><td class="num" id="LN2714">2714</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2715"><td class="num" id="LN2715">2715</td><td class="line"> g_cclosure_marshal_VOID__BOXED,</td></tr> +<tr class="codeline" data-linenumber="2716"><td class="num" id="LN2716">2716</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2717"><td class="num" id="LN2717">2717</td><td class="line"> 1, <span class='macro'>DBUS_TYPE_G_OBJECT_PATH<span class='macro_popup'>(dbus_g_object_path_get_g_type ())</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2718"><td class="num" id="LN2718">2718</td><td class="line"> signals [CLIENT_REMOVED] =</td></tr> +<tr class="codeline" data-linenumber="2719"><td class="num" id="LN2719">2719</td><td class="line"> g_signal_new (<span class='string_literal'>"client-removed"</span>,</td></tr> +<tr class="codeline" data-linenumber="2720"><td class="num" id="LN2720">2720</td><td class="line"> <span class='macro'>G_TYPE_FROM_CLASS (object_class)<span class='macro_popup'>(((GTypeClass*) (object_class))->g_type)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2721"><td class="num" id="LN2721">2721</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="2722"><td class="num" id="LN2722">2722</td><td class="line"> <span class='macro'>G_STRUCT_OFFSET (GsmManagerClass, client_removed)<span class='macro_popup'>((glong) __builtin_offsetof(GsmManagerClass, client_removed))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2723"><td class="num" id="LN2723">2723</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2724"><td class="num" id="LN2724">2724</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2725"><td class="num" id="LN2725">2725</td><td class="line"> g_cclosure_marshal_VOID__BOXED,</td></tr> +<tr class="codeline" data-linenumber="2726"><td class="num" id="LN2726">2726</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2727"><td class="num" id="LN2727">2727</td><td class="line"> 1, <span class='macro'>DBUS_TYPE_G_OBJECT_PATH<span class='macro_popup'>(dbus_g_object_path_get_g_type ())</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2728"><td class="num" id="LN2728">2728</td><td class="line"> signals [INHIBITOR_ADDED] =</td></tr> +<tr class="codeline" data-linenumber="2729"><td class="num" id="LN2729">2729</td><td class="line"> g_signal_new (<span class='string_literal'>"inhibitor-added"</span>,</td></tr> +<tr class="codeline" data-linenumber="2730"><td class="num" id="LN2730">2730</td><td class="line"> <span class='macro'>G_TYPE_FROM_CLASS (object_class)<span class='macro_popup'>(((GTypeClass*) (object_class))->g_type)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2731"><td class="num" id="LN2731">2731</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="2732"><td class="num" id="LN2732">2732</td><td class="line"> <span class='macro'>G_STRUCT_OFFSET (GsmManagerClass, inhibitor_added)<span class='macro_popup'>((glong) __builtin_offsetof(GsmManagerClass, inhibitor_added)<br>)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2733"><td class="num" id="LN2733">2733</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2734"><td class="num" id="LN2734">2734</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2735"><td class="num" id="LN2735">2735</td><td class="line"> g_cclosure_marshal_VOID__BOXED,</td></tr> +<tr class="codeline" data-linenumber="2736"><td class="num" id="LN2736">2736</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2737"><td class="num" id="LN2737">2737</td><td class="line"> 1, <span class='macro'>DBUS_TYPE_G_OBJECT_PATH<span class='macro_popup'>(dbus_g_object_path_get_g_type ())</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2738"><td class="num" id="LN2738">2738</td><td class="line"> signals [INHIBITOR_REMOVED] =</td></tr> +<tr class="codeline" data-linenumber="2739"><td class="num" id="LN2739">2739</td><td class="line"> g_signal_new (<span class='string_literal'>"inhibitor-removed"</span>,</td></tr> +<tr class="codeline" data-linenumber="2740"><td class="num" id="LN2740">2740</td><td class="line"> <span class='macro'>G_TYPE_FROM_CLASS (object_class)<span class='macro_popup'>(((GTypeClass*) (object_class))->g_type)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2741"><td class="num" id="LN2741">2741</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="2742"><td class="num" id="LN2742">2742</td><td class="line"> <span class='macro'>G_STRUCT_OFFSET (GsmManagerClass, inhibitor_removed)<span class='macro_popup'>((glong) __builtin_offsetof(GsmManagerClass, inhibitor_removed<br>))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2743"><td class="num" id="LN2743">2743</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2744"><td class="num" id="LN2744">2744</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2745"><td class="num" id="LN2745">2745</td><td class="line"> g_cclosure_marshal_VOID__BOXED,</td></tr> +<tr class="codeline" data-linenumber="2746"><td class="num" id="LN2746">2746</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2747"><td class="num" id="LN2747">2747</td><td class="line"> 1, <span class='macro'>DBUS_TYPE_G_OBJECT_PATH<span class='macro_popup'>(dbus_g_object_path_get_g_type ())</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2748"><td class="num" id="LN2748">2748</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2749"><td class="num" id="LN2749">2749</td><td class="line"> g_object_class_install_property (object_class,</td></tr> +<tr class="codeline" data-linenumber="2750"><td class="num" id="LN2750">2750</td><td class="line"> PROP_FAILSAFE,</td></tr> +<tr class="codeline" data-linenumber="2751"><td class="num" id="LN2751">2751</td><td class="line"> g_param_spec_boolean (<span class='string_literal'>"failsafe"</span>,</td></tr> +<tr class="codeline" data-linenumber="2752"><td class="num" id="LN2752">2752</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2753"><td class="num" id="LN2753">2753</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2754"><td class="num" id="LN2754">2754</td><td class="line"> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2755"><td class="num" id="LN2755">2755</td><td class="line"> G_PARAM_READWRITE | G_PARAM_CONSTRUCT));</td></tr> +<tr class="codeline" data-linenumber="2756"><td class="num" id="LN2756">2756</td><td class="line"> g_object_class_install_property (object_class,</td></tr> +<tr class="codeline" data-linenumber="2757"><td class="num" id="LN2757">2757</td><td class="line"> PROP_CLIENT_STORE,</td></tr> +<tr class="codeline" data-linenumber="2758"><td class="num" id="LN2758">2758</td><td class="line"> g_param_spec_object (<span class='string_literal'>"client-store"</span>,</td></tr> +<tr class="codeline" data-linenumber="2759"><td class="num" id="LN2759">2759</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2760"><td class="num" id="LN2760">2760</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2761"><td class="num" id="LN2761">2761</td><td class="line"> <span class='macro'>GSM_TYPE_STORE<span class='macro_popup'>(gsm_store_get_type ())</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2762"><td class="num" id="LN2762">2762</td><td class="line"> G_PARAM_READWRITE | G_PARAM_CONSTRUCT));</td></tr> +<tr class="codeline" data-linenumber="2763"><td class="num" id="LN2763">2763</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2764"><td class="num" id="LN2764">2764</td><td class="line"> g_object_class_install_property (object_class,</td></tr> +<tr class="codeline" data-linenumber="2765"><td class="num" id="LN2765">2765</td><td class="line"> PROP_RENDERER,</td></tr> +<tr class="codeline" data-linenumber="2766"><td class="num" id="LN2766">2766</td><td class="line"> g_param_spec_string (<span class='string_literal'>"renderer"</span>,</td></tr> +<tr class="codeline" data-linenumber="2767"><td class="num" id="LN2767">2767</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2768"><td class="num" id="LN2768">2768</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2769"><td class="num" id="LN2769">2769</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2770"><td class="num" id="LN2770">2770</td><td class="line"> G_PARAM_READABLE));</td></tr> +<tr class="codeline" data-linenumber="2771"><td class="num" id="LN2771">2771</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2772"><td class="num" id="LN2772">2772</td><td class="line"> dbus_g_object_type_install_info (<span class='macro'>GSM_TYPE_MANAGER<span class='macro_popup'>(gsm_manager_get_type ())</span></span>, &dbus_glib_gsm_manager_object_info);</td></tr> +<tr class="codeline" data-linenumber="2773"><td class="num" id="LN2773">2773</td><td class="line"> dbus_g_error_domain_register (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>GSM_MANAGER_TYPE_ERROR<span class='macro_popup'>(gsm_manager_error_get_type ())</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2774"><td class="num" id="LN2774">2774</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2775"><td class="num" id="LN2775">2775</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2776"><td class="num" id="LN2776">2776</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2777"><td class="num" id="LN2777">2777</td><td class="line">load_idle_delay_from_gsettings (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2778"><td class="num" id="LN2778">2778</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2779"><td class="num" id="LN2779">2779</td><td class="line"> glong value;</td></tr> +<tr class="codeline" data-linenumber="2780"><td class="num" id="LN2780">2780</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2781"><td class="num" id="LN2781">2781</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2782"><td class="num" id="LN2782">2782</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2783"><td class="num" id="LN2783">2783</td><td class="line"> value = g_settings_get_int (priv->settings_session,</td></tr> +<tr class="codeline" data-linenumber="2784"><td class="num" id="LN2784">2784</td><td class="line"> <span class='macro'>KEY_IDLE_DELAY<span class='macro_popup'>"idle-delay"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2785"><td class="num" id="LN2785">2785</td><td class="line"> gsm_presence_set_idle_timeout (priv->presence, value * 60000);</td></tr> +<tr class="codeline" data-linenumber="2786"><td class="num" id="LN2786">2786</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2787"><td class="num" id="LN2787">2787</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2788"><td class="num" id="LN2788">2788</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2789"><td class="num" id="LN2789">2789</td><td class="line">on_gsettings_key_changed (GSettings *settings,</td></tr> +<tr class="codeline" data-linenumber="2790"><td class="num" id="LN2790">2790</td><td class="line"> gchar *key,</td></tr> +<tr class="codeline" data-linenumber="2791"><td class="num" id="LN2791">2791</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2792"><td class="num" id="LN2792">2792</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2793"><td class="num" id="LN2793">2793</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2794"><td class="num" id="LN2794">2794</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2795"><td class="num" id="LN2795">2795</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2796"><td class="num" id="LN2796">2796</td><td class="line"> <span class='keyword'>if</span> (g_strcmp0 (key, <span class='macro'>KEY_IDLE_DELAY<span class='macro_popup'>"idle-delay"</span></span>) == 0) {</td></tr> +<tr class="codeline" data-linenumber="2797"><td class="num" id="LN2797">2797</td><td class="line"> <span class='keyword'>int</span> delay;</td></tr> +<tr class="codeline" data-linenumber="2798"><td class="num" id="LN2798">2798</td><td class="line"> delay = g_settings_get_int (settings, key);</td></tr> +<tr class="codeline" data-linenumber="2799"><td class="num" id="LN2799">2799</td><td class="line"> gsm_presence_set_idle_timeout (priv->presence, delay * 60000);</td></tr> +<tr class="codeline" data-linenumber="2800"><td class="num" id="LN2800">2800</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (g_strcmp0 (key, <span class='macro'>KEY_LOCK_DISABLE<span class='macro_popup'>"disable-lock-screen"</span></span>) == 0) {</td></tr> +<tr class="codeline" data-linenumber="2801"><td class="num" id="LN2801">2801</td><td class="line"> <span class='comment'>/* ??? */</span></td></tr> +<tr class="codeline" data-linenumber="2802"><td class="num" id="LN2802">2802</td><td class="line"> gboolean <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> disabled;</td></tr> +<tr class="codeline" data-linenumber="2803"><td class="num" id="LN2803">2803</td><td class="line"> disabled = g_settings_get_boolean (settings, key);</td></tr> +<tr class="codeline" data-linenumber="2804"><td class="num" id="LN2804">2804</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (g_strcmp0 (key, <span class='macro'>KEY_USER_SWITCH_DISABLE<span class='macro_popup'>"disable-user-switching"</span></span>) == 0) {</td></tr> +<tr class="codeline" data-linenumber="2805"><td class="num" id="LN2805">2805</td><td class="line"> <span class='comment'>/* ??? */</span></td></tr> +<tr class="codeline" data-linenumber="2806"><td class="num" id="LN2806">2806</td><td class="line"> gboolean <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> disabled;</td></tr> +<tr class="codeline" data-linenumber="2807"><td class="num" id="LN2807">2807</td><td class="line"> disabled = g_settings_get_boolean (settings, key);</td></tr> +<tr class="codeline" data-linenumber="2808"><td class="num" id="LN2808">2808</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2809"><td class="num" id="LN2809">2809</td><td class="line"> g_debug (<span class='string_literal'>"Config key not handled: %s"</span>, key);</td></tr> +<tr class="codeline" data-linenumber="2810"><td class="num" id="LN2810">2810</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2811"><td class="num" id="LN2811">2811</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2812"><td class="num" id="LN2812">2812</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2813"><td class="num" id="LN2813">2813</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2814"><td class="num" id="LN2814">2814</td><td class="line">on_presence_status_changed (GsmPresence *presence,</td></tr> +<tr class="codeline" data-linenumber="2815"><td class="num" id="LN2815">2815</td><td class="line"> guint status,</td></tr> +<tr class="codeline" data-linenumber="2816"><td class="num" id="LN2816">2816</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2817"><td class="num" id="LN2817">2817</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2818"><td class="num" id="LN2818">2818</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="2819"><td class="num" id="LN2819">2819</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2820"><td class="num" id="LN2820">2820</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="2821"><td class="num" id="LN2821">2821</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2822"><td class="num" id="LN2822">2822</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="2823"><td class="num" id="LN2823">2823</td><td class="line"> gsm_systemd_set_session_idle (systemd,</td></tr> +<tr class="codeline" data-linenumber="2824"><td class="num" id="LN2824">2824</td><td class="line"> (status == GSM_PRESENCE_STATUS_IDLE));</td></tr> +<tr class="codeline" data-linenumber="2825"><td class="num" id="LN2825">2825</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2826"><td class="num" id="LN2826">2826</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2827"><td class="num" id="LN2827">2827</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="2828"><td class="num" id="LN2828">2828</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="2829"><td class="num" id="LN2829">2829</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2830"><td class="num" id="LN2830">2830</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="2831"><td class="num" id="LN2831">2831</td><td class="line"> gsm_consolekit_set_session_idle (consolekit,</td></tr> +<tr class="codeline" data-linenumber="2832"><td class="num" id="LN2832">2832</td><td class="line"> (status == GSM_PRESENCE_STATUS_IDLE));</td></tr> +<tr class="codeline" data-linenumber="2833"><td class="num" id="LN2833">2833</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="2834"><td class="num" id="LN2834">2834</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2835"><td class="num" id="LN2835">2835</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="2836"><td class="num" id="LN2836">2836</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2837"><td class="num" id="LN2837">2837</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2838"><td class="num" id="LN2838">2838</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2839"><td class="num" id="LN2839">2839</td><td class="line">gsm_manager_init (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2840"><td class="num" id="LN2840">2840</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2841"><td class="num" id="LN2841">2841</td><td class="line"> gchar **schemas = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2842"><td class="num" id="LN2842">2842</td><td class="line"> gboolean schema_exists;</td></tr> +<tr class="codeline" data-linenumber="2843"><td class="num" id="LN2843">2843</td><td class="line"> guint i;</td></tr> +<tr class="codeline" data-linenumber="2844"><td class="num" id="LN2844">2844</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2845"><td class="num" id="LN2845">2845</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2846"><td class="num" id="LN2846">2846</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2847"><td class="num" id="LN2847">2847</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2848"><td class="num" id="LN2848">2848</td><td class="line"> priv->settings_session = g_settings_new (<span class='macro'>SESSION_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2849"><td class="num" id="LN2849">2849</td><td class="line"> priv->settings_lockdown = g_settings_new (<span class='macro'>LOCKDOWN_SCHEMA<span class='macro_popup'>"org.mate.lockdown"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2850"><td class="num" id="LN2850">2850</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2851"><td class="num" id="LN2851">2851</td><td class="line"> <span class='comment'>/* check if mate-screensaver is installed */</span></td></tr> +<tr class="codeline" data-linenumber="2852"><td class="num" id="LN2852">2852</td><td class="line"> g_settings_schema_source_list_schemas (g_settings_schema_source_get_default (), <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, &schemas, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2853"><td class="num" id="LN2853">2853</td><td class="line"> schema_exists = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2854"><td class="num" id="LN2854">2854</td><td class="line"> <span class='keyword'>for</span> (i = 0; schemas[i] != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; i++) {</td></tr> +<tr class="codeline" data-linenumber="2855"><td class="num" id="LN2855">2855</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>g_str_equal (schemas[i], SCREENSAVER_SCHEMA)<span class='macro_popup'>(strcmp ((const char *) (schemas[i]), (const char *) ("org.mate.screensaver"<br>)) == 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2856"><td class="num" id="LN2856">2856</td><td class="line"> schema_exists = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2857"><td class="num" id="LN2857">2857</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="2858"><td class="num" id="LN2858">2858</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2859"><td class="num" id="LN2859">2859</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2860"><td class="num" id="LN2860">2860</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2861"><td class="num" id="LN2861">2861</td><td class="line"> g_strfreev (schemas);</td></tr> +<tr class="codeline" data-linenumber="2862"><td class="num" id="LN2862">2862</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2863"><td class="num" id="LN2863">2863</td><td class="line"> <span class='keyword'>if</span> (schema_exists == <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>)</td></tr> +<tr class="codeline" data-linenumber="2864"><td class="num" id="LN2864">2864</td><td class="line"> priv->settings_screensaver = g_settings_new (<span class='macro'>SCREENSAVER_SCHEMA<span class='macro_popup'>"org.mate.screensaver"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2865"><td class="num" id="LN2865">2865</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="2866"><td class="num" id="LN2866">2866</td><td class="line"> priv->settings_screensaver = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2867"><td class="num" id="LN2867">2867</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2868"><td class="num" id="LN2868">2868</td><td class="line"> priv->inhibitors = gsm_store_new ();</td></tr> +<tr class="codeline" data-linenumber="2869"><td class="num" id="LN2869">2869</td><td class="line"> <span class='macro'>g_signal_connect (priv->inhibitors,<span class='macro_popup'>g_signal_connect_data ((priv->inhibitors), ("added"), (((GCallback<br>) (on_store_inhibitor_added))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2870"><td class="num" id="LN2870">2870</td><td class="line"> <span class='string_literal'><span class='macro'>"added"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->inhibitors), ("added"), (((GCallback<br>) (on_store_inhibitor_added))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2871"><td class="num" id="LN2871">2871</td><td class="line"> <span class='macro'>G_CALLBACK (on_store_inhibitor_added),<span class='macro_popup'>g_signal_connect_data ((priv->inhibitors), ("added"), (((GCallback<br>) (on_store_inhibitor_added))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2872"><td class="num" id="LN2872">2872</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->inhibitors), ("added"), (((GCallback<br>) (on_store_inhibitor_added))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2873"><td class="num" id="LN2873">2873</td><td class="line"> <span class='macro'>g_signal_connect (priv->inhibitors,<span class='macro_popup'>g_signal_connect_data ((priv->inhibitors), ("removed"), ((<br>(GCallback) (on_store_inhibitor_removed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2874"><td class="num" id="LN2874">2874</td><td class="line"> <span class='string_literal'><span class='macro'>"removed"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->inhibitors), ("removed"), ((<br>(GCallback) (on_store_inhibitor_removed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2875"><td class="num" id="LN2875">2875</td><td class="line"> <span class='macro'>G_CALLBACK (on_store_inhibitor_removed),<span class='macro_popup'>g_signal_connect_data ((priv->inhibitors), ("removed"), ((<br>(GCallback) (on_store_inhibitor_removed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2876"><td class="num" id="LN2876">2876</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->inhibitors), ("removed"), ((<br>(GCallback) (on_store_inhibitor_removed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2877"><td class="num" id="LN2877">2877</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2878"><td class="num" id="LN2878">2878</td><td class="line"> priv->apps = gsm_store_new ();</td></tr> +<tr class="codeline" data-linenumber="2879"><td class="num" id="LN2879">2879</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2880"><td class="num" id="LN2880">2880</td><td class="line"> priv->presence = gsm_presence_new ();</td></tr> +<tr class="codeline" data-linenumber="2881"><td class="num" id="LN2881">2881</td><td class="line"> <span class='macro'>g_signal_connect (priv->presence,<span class='macro_popup'>g_signal_connect_data ((priv->presence), ("status-changed"<br>), (((GCallback) (on_presence_status_changed))), (manager), (<br>(void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2882"><td class="num" id="LN2882">2882</td><td class="line"> <span class='string_literal'><span class='macro'>"status-changed"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->presence), ("status-changed"<br>), (((GCallback) (on_presence_status_changed))), (manager), (<br>(void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2883"><td class="num" id="LN2883">2883</td><td class="line"> <span class='macro'>G_CALLBACK (on_presence_status_changed),<span class='macro_popup'>g_signal_connect_data ((priv->presence), ("status-changed"<br>), (((GCallback) (on_presence_status_changed))), (manager), (<br>(void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2884"><td class="num" id="LN2884">2884</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->presence), ("status-changed"<br>), (((GCallback) (on_presence_status_changed))), (manager), (<br>(void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2885"><td class="num" id="LN2885">2885</td><td class="line"> <span class='macro'>g_signal_connect (priv->settings_session,<span class='macro_popup'>g_signal_connect_data ((priv->settings_session), ("changed"<br>), (((GCallback) (on_gsettings_key_changed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2886"><td class="num" id="LN2886">2886</td><td class="line"> <span class='string_literal'><span class='macro'>"changed"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->settings_session), ("changed"<br>), (((GCallback) (on_gsettings_key_changed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2887"><td class="num" id="LN2887">2887</td><td class="line"> <span class='macro'>G_CALLBACK (on_gsettings_key_changed),<span class='macro_popup'>g_signal_connect_data ((priv->settings_session), ("changed"<br>), (((GCallback) (on_gsettings_key_changed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2888"><td class="num" id="LN2888">2888</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->settings_session), ("changed"<br>), (((GCallback) (on_gsettings_key_changed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2889"><td class="num" id="LN2889">2889</td><td class="line"> <span class='macro'>g_signal_connect (priv->settings_lockdown,<span class='macro_popup'>g_signal_connect_data ((priv->settings_lockdown), ("changed"<br>), (((GCallback) (on_gsettings_key_changed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2890"><td class="num" id="LN2890">2890</td><td class="line"> <span class='string_literal'><span class='macro'>"changed"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->settings_lockdown), ("changed"<br>), (((GCallback) (on_gsettings_key_changed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2891"><td class="num" id="LN2891">2891</td><td class="line"> <span class='macro'>G_CALLBACK (on_gsettings_key_changed),<span class='macro_popup'>g_signal_connect_data ((priv->settings_lockdown), ("changed"<br>), (((GCallback) (on_gsettings_key_changed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2892"><td class="num" id="LN2892">2892</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->settings_lockdown), ("changed"<br>), (((GCallback) (on_gsettings_key_changed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2893"><td class="num" id="LN2893">2893</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2894"><td class="num" id="LN2894">2894</td><td class="line"> load_idle_delay_from_gsettings (manager);</td></tr> +<tr class="codeline" data-linenumber="2895"><td class="num" id="LN2895">2895</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2896"><td class="num" id="LN2896">2896</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2897"><td class="num" id="LN2897">2897</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2898"><td class="num" id="LN2898">2898</td><td class="line">gsm_manager_finalize (GObject *object)</td></tr> +<tr class="codeline" data-linenumber="2899"><td class="num" id="LN2899">2899</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2900"><td class="num" id="LN2900">2900</td><td class="line"> GsmManager *manager;</td></tr> +<tr class="codeline" data-linenumber="2901"><td class="num" id="LN2901">2901</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2902"><td class="num" id="LN2902">2902</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2903"><td class="num" id="LN2903">2903</td><td class="line"> <span class='macro'>g_return_if_fail (object != NULL)<span class='macro_popup'>do { if ((object != ((void*)0))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "object != NULL")<br>; return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2904"><td class="num" id="LN2904">2904</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_MANAGER (object))<span class='macro_popup'>do { if ((GSM_IS_MANAGER (object))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (object)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2905"><td class="num" id="LN2905">2905</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2906"><td class="num" id="LN2906">2906</td><td class="line"> manager = GSM_MANAGER (object);</td></tr> +<tr class="codeline" data-linenumber="2907"><td class="num" id="LN2907">2907</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2908"><td class="num" id="LN2908">2908</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2909"><td class="num" id="LN2909">2909</td><td class="line"> <span class='macro'>g_return_if_fail (priv != NULL)<span class='macro_popup'>do { if ((priv != ((void*)0))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "priv != NULL"); return<br>; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2910"><td class="num" id="LN2910">2910</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2911"><td class="num" id="LN2911">2911</td><td class="line"> <span class='macro'>G_OBJECT_CLASS (gsm_manager_parent_class)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((gsm_manager_parent_class)), (((GType) ((20) << (2)<br>)))))))</span></span>->finalize (object);</td></tr> +<tr class="codeline" data-linenumber="2912"><td class="num" id="LN2912">2912</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2913"><td class="num" id="LN2913">2913</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2914"><td class="num" id="LN2914">2914</td><td class="line">GsmManager *</td></tr> +<tr class="codeline" data-linenumber="2915"><td class="num" id="LN2915">2915</td><td class="line">gsm_manager_new (GsmStore *client_store,</td></tr> +<tr class="codeline" data-linenumber="2916"><td class="num" id="LN2916">2916</td><td class="line"> gboolean failsafe)</td></tr> +<tr class="codeline" data-linenumber="2917"><td class="num" id="LN2917">2917</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2918"><td class="num" id="LN2918">2918</td><td class="line"> <span class='keyword'>if</span> (manager_object != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2919"><td class="num" id="LN2919">2919</td><td class="line"> <span class='macro'>g_object_ref (manager_object)<span class='macro_popup'>((__typeof__ (manager_object)) (g_object_ref) (manager_object<br>))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2920"><td class="num" id="LN2920">2920</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2921"><td class="num" id="LN2921">2921</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="2922"><td class="num" id="LN2922">2922</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2923"><td class="num" id="LN2923">2923</td><td class="line"> manager_object = g_object_new (<span class='macro'>GSM_TYPE_MANAGER<span class='macro_popup'>(gsm_manager_get_type ())</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2924"><td class="num" id="LN2924">2924</td><td class="line"> <span class='string_literal'>"client-store"</span>, client_store,</td></tr> +<tr class="codeline" data-linenumber="2925"><td class="num" id="LN2925">2925</td><td class="line"> <span class='string_literal'>"failsafe"</span>, failsafe,</td></tr> +<tr class="codeline" data-linenumber="2926"><td class="num" id="LN2926">2926</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2927"><td class="num" id="LN2927">2927</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2928"><td class="num" id="LN2928">2928</td><td class="line"> g_object_add_weak_pointer (manager_object,</td></tr> +<tr class="codeline" data-linenumber="2929"><td class="num" id="LN2929">2929</td><td class="line"> (gpointer *) &manager_object);</td></tr> +<tr class="codeline" data-linenumber="2930"><td class="num" id="LN2930">2930</td><td class="line"> res = register_manager (manager_object);</td></tr> +<tr class="codeline" data-linenumber="2931"><td class="num" id="LN2931">2931</td><td class="line"> <span class='keyword'>if</span> (! res) {</td></tr> +<tr class="codeline" data-linenumber="2932"><td class="num" id="LN2932">2932</td><td class="line"> <span class="mrange">g_object_unref</span> (manager_object);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:25ex">This statement is never executed</div></td></tr> +<tr class="codeline" data-linenumber="2933"><td class="num" id="LN2933">2933</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2934"><td class="num" id="LN2934">2934</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2935"><td class="num" id="LN2935">2935</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2936"><td class="num" id="LN2936">2936</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2937"><td class="num" id="LN2937">2937</td><td class="line"> <span class='keyword'>return</span> GSM_MANAGER (manager_object);</td></tr> +<tr class="codeline" data-linenumber="2938"><td class="num" id="LN2938">2938</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2939"><td class="num" id="LN2939">2939</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2940"><td class="num" id="LN2940">2940</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="2941"><td class="num" id="LN2941">2941</td><td class="line">gsm_manager_setenv (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="2942"><td class="num" id="LN2942">2942</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *variable,</td></tr> +<tr class="codeline" data-linenumber="2943"><td class="num" id="LN2943">2943</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *value,</td></tr> +<tr class="codeline" data-linenumber="2944"><td class="num" id="LN2944">2944</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="2945"><td class="num" id="LN2945">2945</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2946"><td class="num" id="LN2946">2946</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2947"><td class="num" id="LN2947">2947</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2948"><td class="num" id="LN2948">2948</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2949"><td class="num" id="LN2949">2949</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2950"><td class="num" id="LN2950">2950</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2951"><td class="num" id="LN2951">2951</td><td class="line"> <span class='keyword'>if</span> (priv->phase > GSM_MANAGER_PHASE_INITIALIZATION) {</td></tr> +<tr class="codeline" data-linenumber="2952"><td class="num" id="LN2952">2952</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="2953"><td class="num" id="LN2953">2953</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2954"><td class="num" id="LN2954">2954</td><td class="line"> GSM_MANAGER_ERROR_NOT_IN_INITIALIZATION,</td></tr> +<tr class="codeline" data-linenumber="2955"><td class="num" id="LN2955">2955</td><td class="line"> <span class='string_literal'>"Setenv interface is only available during the Initialization phase"</span>);</td></tr> +<tr class="codeline" data-linenumber="2956"><td class="num" id="LN2956">2956</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2957"><td class="num" id="LN2957">2957</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2958"><td class="num" id="LN2958">2958</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2959"><td class="num" id="LN2959">2959</td><td class="line"> gsm_util_setenv (variable, value);</td></tr> +<tr class="codeline" data-linenumber="2960"><td class="num" id="LN2960">2960</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2961"><td class="num" id="LN2961">2961</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2962"><td class="num" id="LN2962">2962</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2963"><td class="num" id="LN2963">2963</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2964"><td class="num" id="LN2964">2964</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="2965"><td class="num" id="LN2965">2965</td><td class="line">gsm_manager_initialization_error (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="2966"><td class="num" id="LN2966">2966</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *message,</td></tr> +<tr class="codeline" data-linenumber="2967"><td class="num" id="LN2967">2967</td><td class="line"> gboolean fatal,</td></tr> +<tr class="codeline" data-linenumber="2968"><td class="num" id="LN2968">2968</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="2969"><td class="num" id="LN2969">2969</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2970"><td class="num" id="LN2970">2970</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2971"><td class="num" id="LN2971">2971</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2972"><td class="num" id="LN2972">2972</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2973"><td class="num" id="LN2973">2973</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2974"><td class="num" id="LN2974">2974</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2975"><td class="num" id="LN2975">2975</td><td class="line"> <span class='keyword'>if</span> (priv->phase > GSM_MANAGER_PHASE_INITIALIZATION) {</td></tr> +<tr class="codeline" data-linenumber="2976"><td class="num" id="LN2976">2976</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="2977"><td class="num" id="LN2977">2977</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2978"><td class="num" id="LN2978">2978</td><td class="line"> GSM_MANAGER_ERROR_NOT_IN_INITIALIZATION,</td></tr> +<tr class="codeline" data-linenumber="2979"><td class="num" id="LN2979">2979</td><td class="line"> <span class='string_literal'>"InitializationError interface is only available during the Initialization phase"</span>);</td></tr> +<tr class="codeline" data-linenumber="2980"><td class="num" id="LN2980">2980</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2981"><td class="num" id="LN2981">2981</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2982"><td class="num" id="LN2982">2982</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2983"><td class="num" id="LN2983">2983</td><td class="line"> gsm_util_init_error (fatal, <span class='string_literal'>"%s"</span>, message);</td></tr> +<tr class="codeline" data-linenumber="2984"><td class="num" id="LN2984">2984</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2985"><td class="num" id="LN2985">2985</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2986"><td class="num" id="LN2986">2986</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2987"><td class="num" id="LN2987">2987</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2988"><td class="num" id="LN2988">2988</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="2989"><td class="num" id="LN2989">2989</td><td class="line">gsm_manager_is_switch_user_inhibited (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2990"><td class="num" id="LN2990">2990</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2991"><td class="num" id="LN2991">2991</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="2992"><td class="num" id="LN2992">2992</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2993"><td class="num" id="LN2993">2993</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2994"><td class="num" id="LN2994">2994</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2995"><td class="num" id="LN2995">2995</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2996"><td class="num" id="LN2996">2996</td><td class="line"> <span class='keyword'>if</span> (priv->inhibitors == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2997"><td class="num" id="LN2997">2997</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2998"><td class="num" id="LN2998">2998</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2999"><td class="num" id="LN2999">2999</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3000"><td class="num" id="LN3000">3000</td><td class="line"> inhibitor = (GsmInhibitor *)gsm_store_find (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="3001"><td class="num" id="LN3001">3001</td><td class="line"> (GsmStoreFunc)inhibitor_has_flag,</td></tr> +<tr class="codeline" data-linenumber="3002"><td class="num" id="LN3002">3002</td><td class="line"> <span class='macro'>GUINT_TO_POINTER (GSM_INHIBITOR_FLAG_SWITCH_USER)<span class='macro_popup'>((gpointer) (gulong) (GSM_INHIBITOR_FLAG_SWITCH_USER))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3003"><td class="num" id="LN3003">3003</td><td class="line"> <span class='keyword'>if</span> (inhibitor == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3004"><td class="num" id="LN3004">3004</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3005"><td class="num" id="LN3005">3005</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3006"><td class="num" id="LN3006">3006</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3007"><td class="num" id="LN3007">3007</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3008"><td class="num" id="LN3008">3008</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3009"><td class="num" id="LN3009">3009</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="3010"><td class="num" id="LN3010">3010</td><td class="line">gsm_manager_is_suspend_inhibited (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3011"><td class="num" id="LN3011">3011</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3012"><td class="num" id="LN3012">3012</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="3013"><td class="num" id="LN3013">3013</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3014"><td class="num" id="LN3014">3014</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3015"><td class="num" id="LN3015">3015</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3016"><td class="num" id="LN3016">3016</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3017"><td class="num" id="LN3017">3017</td><td class="line"> <span class='keyword'>if</span> (priv->inhibitors == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3018"><td class="num" id="LN3018">3018</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3019"><td class="num" id="LN3019">3019</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3020"><td class="num" id="LN3020">3020</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3021"><td class="num" id="LN3021">3021</td><td class="line"> inhibitor = (GsmInhibitor *)gsm_store_find (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="3022"><td class="num" id="LN3022">3022</td><td class="line"> (GsmStoreFunc)inhibitor_has_flag,</td></tr> +<tr class="codeline" data-linenumber="3023"><td class="num" id="LN3023">3023</td><td class="line"> <span class='macro'>GUINT_TO_POINTER (GSM_INHIBITOR_FLAG_SUSPEND)<span class='macro_popup'>((gpointer) (gulong) (GSM_INHIBITOR_FLAG_SUSPEND))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3024"><td class="num" id="LN3024">3024</td><td class="line"> <span class='keyword'>if</span> (inhibitor == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3025"><td class="num" id="LN3025">3025</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3026"><td class="num" id="LN3026">3026</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3027"><td class="num" id="LN3027">3027</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3028"><td class="num" id="LN3028">3028</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3029"><td class="num" id="LN3029">3029</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3030"><td class="num" id="LN3030">3030</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3031"><td class="num" id="LN3031">3031</td><td class="line">request_reboot_privileges_completed_consolekit (GsmConsolekit *consolekit,</td></tr> +<tr class="codeline" data-linenumber="3032"><td class="num" id="LN3032">3032</td><td class="line"> gboolean success,</td></tr> +<tr class="codeline" data-linenumber="3033"><td class="num" id="LN3033">3033</td><td class="line"> gboolean ask_later,</td></tr> +<tr class="codeline" data-linenumber="3034"><td class="num" id="LN3034">3034</td><td class="line"> GError *error,</td></tr> +<tr class="codeline" data-linenumber="3035"><td class="num" id="LN3035">3035</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3036"><td class="num" id="LN3036">3036</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3037"><td class="num" id="LN3037">3037</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3038"><td class="num" id="LN3038">3038</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3039"><td class="num" id="LN3039">3039</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3040"><td class="num" id="LN3040">3040</td><td class="line"> <span class='comment'>/* make sure we disconnect the signal handler so that it's not called</span></td></tr> +<tr class="codeline" data-linenumber="3041"><td class="num" id="LN3041">3041</td><td class="line"> <span class='comment'>* again next time the event is fired -- this can happen if the reboot</span></td></tr> +<tr class="codeline" data-linenumber="3042"><td class="num" id="LN3042">3042</td><td class="line"> <span class='comment'>* is cancelled. */</span></td></tr> +<tr class="codeline" data-linenumber="3043"><td class="num" id="LN3043">3043</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (consolekit,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_consolekit), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3044"><td class="num" id="LN3044">3044</td><td class="line"> <span class='macro'>request_reboot_privileges_completed_consolekit,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_consolekit), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3045"><td class="num" id="LN3045">3045</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_consolekit), (manager<br>))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3046"><td class="num" id="LN3046">3046</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3047"><td class="num" id="LN3047">3047</td><td class="line"> g_object_unref (consolekit);</td></tr> +<tr class="codeline" data-linenumber="3048"><td class="num" id="LN3048">3048</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3049"><td class="num" id="LN3049">3049</td><td class="line"> <span class='keyword'>if</span> (success) {</td></tr> +<tr class="codeline" data-linenumber="3050"><td class="num" id="LN3050">3050</td><td class="line"> <span class='keyword'>if</span> (ask_later) {</td></tr> +<tr class="codeline" data-linenumber="3051"><td class="num" id="LN3051">3051</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_REBOOT_INTERACT;</td></tr> +<tr class="codeline" data-linenumber="3052"><td class="num" id="LN3052">3052</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3053"><td class="num" id="LN3053">3053</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_REBOOT;</td></tr> +<tr class="codeline" data-linenumber="3054"><td class="num" id="LN3054">3054</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3055"><td class="num" id="LN3055">3055</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3056"><td class="num" id="LN3056">3056</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3057"><td class="num" id="LN3057">3057</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3058"><td class="num" id="LN3058">3058</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3059"><td class="num" id="LN3059">3059</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3060"><td class="num" id="LN3060">3060</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3061"><td class="num" id="LN3061">3061</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3062"><td class="num" id="LN3062">3062</td><td class="line">request_reboot_privileges_completed_systemd (GsmSystemd *systemd,</td></tr> +<tr class="codeline" data-linenumber="3063"><td class="num" id="LN3063">3063</td><td class="line"> gboolean success,</td></tr> +<tr class="codeline" data-linenumber="3064"><td class="num" id="LN3064">3064</td><td class="line"> gboolean ask_later,</td></tr> +<tr class="codeline" data-linenumber="3065"><td class="num" id="LN3065">3065</td><td class="line"> GError *error,</td></tr> +<tr class="codeline" data-linenumber="3066"><td class="num" id="LN3066">3066</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3067"><td class="num" id="LN3067">3067</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3068"><td class="num" id="LN3068">3068</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3069"><td class="num" id="LN3069">3069</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3070"><td class="num" id="LN3070">3070</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3071"><td class="num" id="LN3071">3071</td><td class="line"> <span class='comment'>/* make sure we disconnect the signal handler so that it's not called</span></td></tr> +<tr class="codeline" data-linenumber="3072"><td class="num" id="LN3072">3072</td><td class="line"> <span class='comment'>* again next time the event is fired -- this can happen if the reboot</span></td></tr> +<tr class="codeline" data-linenumber="3073"><td class="num" id="LN3073">3073</td><td class="line"> <span class='comment'>* is cancelled. */</span></td></tr> +<tr class="codeline" data-linenumber="3074"><td class="num" id="LN3074">3074</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (systemd,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_systemd), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="3075"><td class="num" id="LN3075">3075</td><td class="line"> <span class='macro'>request_reboot_privileges_completed_systemd,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_systemd), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="3076"><td class="num" id="LN3076">3076</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_systemd), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3077"><td class="num" id="LN3077">3077</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3078"><td class="num" id="LN3078">3078</td><td class="line"> g_object_unref (systemd);</td></tr> +<tr class="codeline" data-linenumber="3079"><td class="num" id="LN3079">3079</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3080"><td class="num" id="LN3080">3080</td><td class="line"> <span class='keyword'>if</span> (success) {</td></tr> +<tr class="codeline" data-linenumber="3081"><td class="num" id="LN3081">3081</td><td class="line"> <span class='keyword'>if</span> (ask_later) {</td></tr> +<tr class="codeline" data-linenumber="3082"><td class="num" id="LN3082">3082</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_REBOOT_INTERACT;</td></tr> +<tr class="codeline" data-linenumber="3083"><td class="num" id="LN3083">3083</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3084"><td class="num" id="LN3084">3084</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_REBOOT;</td></tr> +<tr class="codeline" data-linenumber="3085"><td class="num" id="LN3085">3085</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3086"><td class="num" id="LN3086">3086</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3087"><td class="num" id="LN3087">3087</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3088"><td class="num" id="LN3088">3088</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3089"><td class="num" id="LN3089">3089</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3090"><td class="num" id="LN3090">3090</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3091"><td class="num" id="LN3091">3091</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3092"><td class="num" id="LN3092">3092</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3093"><td class="num" id="LN3093">3093</td><td class="line">request_reboot (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3094"><td class="num" id="LN3094">3094</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3095"><td class="num" id="LN3095">3095</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="3096"><td class="num" id="LN3096">3096</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3097"><td class="num" id="LN3097">3097</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="3098"><td class="num" id="LN3098">3098</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3099"><td class="num" id="LN3099">3099</td><td class="line"> gboolean success;</td></tr> +<tr class="codeline" data-linenumber="3100"><td class="num" id="LN3100">3100</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3101"><td class="num" id="LN3101">3101</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3102"><td class="num" id="LN3102">3102</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: requesting reboot"</span>);</td></tr> +<tr class="codeline" data-linenumber="3103"><td class="num" id="LN3103">3103</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3104"><td class="num" id="LN3104">3104</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3105"><td class="num" id="LN3105">3105</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3106"><td class="num" id="LN3106">3106</td><td class="line"> <span class='comment'>/* We request the privileges before doing anything. There are a few</span></td></tr> +<tr class="codeline" data-linenumber="3107"><td class="num" id="LN3107">3107</td><td class="line"> <span class='comment'>* different cases here:</span></td></tr> +<tr class="codeline" data-linenumber="3108"><td class="num" id="LN3108">3108</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="3109"><td class="num" id="LN3109">3109</td><td class="line"> <span class='comment'>* - no systemd: we fallback on ConsoleKit</span></td></tr> +<tr class="codeline" data-linenumber="3110"><td class="num" id="LN3110">3110</td><td class="line"> <span class='comment'>* - no ConsoleKit: we fallback on MDM</span></td></tr> +<tr class="codeline" data-linenumber="3111"><td class="num" id="LN3111">3111</td><td class="line"> <span class='comment'>* - no password required: everything is fine</span></td></tr> +<tr class="codeline" data-linenumber="3112"><td class="num" id="LN3112">3112</td><td class="line"> <span class='comment'>* - password asked once: we ask for it now. If the user enters it</span></td></tr> +<tr class="codeline" data-linenumber="3113"><td class="num" id="LN3113">3113</td><td class="line"> <span class='comment'>* fine, then all is great. If the user doesn't enter it fine, we</span></td></tr> +<tr class="codeline" data-linenumber="3114"><td class="num" id="LN3114">3114</td><td class="line"> <span class='comment'>* don't do anything (so no logout).</span></td></tr> +<tr class="codeline" data-linenumber="3115"><td class="num" id="LN3115">3115</td><td class="line"> <span class='comment'>* - password asked each time: we don't ask it for now since we don't</span></td></tr> +<tr class="codeline" data-linenumber="3116"><td class="num" id="LN3116">3116</td><td class="line"> <span class='comment'>* want to ask for it twice. Instead we'll ask for it at the very</span></td></tr> +<tr class="codeline" data-linenumber="3117"><td class="num" id="LN3117">3117</td><td class="line"> <span class='comment'>* end. If the user will enter it fine, then all is great again. If</span></td></tr> +<tr class="codeline" data-linenumber="3118"><td class="num" id="LN3118">3118</td><td class="line"> <span class='comment'>* the user doesn't enter it fine, then we'll just fallback to MDM.</span></td></tr> +<tr class="codeline" data-linenumber="3119"><td class="num" id="LN3119">3119</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="3120"><td class="num" id="LN3120">3120</td><td class="line"> <span class='comment'>* The last case (password asked each time) is a bit broken, but</span></td></tr> +<tr class="codeline" data-linenumber="3121"><td class="num" id="LN3121">3121</td><td class="line"> <span class='comment'>* there's really nothing we can do about it. Generally speaking,</span></td></tr> +<tr class="codeline" data-linenumber="3122"><td class="num" id="LN3122">3122</td><td class="line"> <span class='comment'>* though, the password will only be asked once (unless the system is</span></td></tr> +<tr class="codeline" data-linenumber="3123"><td class="num" id="LN3123">3123</td><td class="line"> <span class='comment'>* configured in paranoid mode), and most probably only if there are</span></td></tr> +<tr class="codeline" data-linenumber="3124"><td class="num" id="LN3124">3124</td><td class="line"> <span class='comment'>* more than one user connected. So the general case is that it will</span></td></tr> +<tr class="codeline" data-linenumber="3125"><td class="num" id="LN3125">3125</td><td class="line"> <span class='comment'>* just work fine.</span></td></tr> +<tr class="codeline" data-linenumber="3126"><td class="num" id="LN3126">3126</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="3127"><td class="num" id="LN3127">3127</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3128"><td class="num" id="LN3128">3128</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3129"><td class="num" id="LN3129">3129</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3130"><td class="num" id="LN3130">3130</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="3131"><td class="num" id="LN3131">3131</td><td class="line"> <span class='macro'>g_signal_connect (systemd,<span class='macro_popup'>g_signal_connect_data ((systemd), ("privileges-completed"), (<br>((GCallback) (request_reboot_privileges_completed_systemd))),<br> (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3132"><td class="num" id="LN3132">3132</td><td class="line"> <span class='string_literal'><span class='macro'>"privileges-completed"</span>,<span class='macro_popup'>g_signal_connect_data ((systemd), ("privileges-completed"), (<br>((GCallback) (request_reboot_privileges_completed_systemd))),<br> (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3133"><td class="num" id="LN3133">3133</td><td class="line"> <span class='macro'>G_CALLBACK (request_reboot_privileges_completed_systemd),<span class='macro_popup'>g_signal_connect_data ((systemd), ("privileges-completed"), (<br>((GCallback) (request_reboot_privileges_completed_systemd))),<br> (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3134"><td class="num" id="LN3134">3134</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((systemd), ("privileges-completed"), (<br>((GCallback) (request_reboot_privileges_completed_systemd))),<br> (manager), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3135"><td class="num" id="LN3135">3135</td><td class="line"> success = gsm_systemd_get_restart_privileges (systemd);</td></tr> +<tr class="codeline" data-linenumber="3136"><td class="num" id="LN3136">3136</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3137"><td class="num" id="LN3137">3137</td><td class="line"> <span class='keyword'>if</span> (!success) {</td></tr> +<tr class="codeline" data-linenumber="3138"><td class="num" id="LN3138">3138</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (systemd,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_systemd), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="3139"><td class="num" id="LN3139">3139</td><td class="line"> <span class='macro'>request_reboot_privileges_completed_systemd,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_systemd), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="3140"><td class="num" id="LN3140">3140</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_systemd), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3141"><td class="num" id="LN3141">3141</td><td class="line"> g_object_unref (systemd);</td></tr> +<tr class="codeline" data-linenumber="3142"><td class="num" id="LN3142">3142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3143"><td class="num" id="LN3143">3143</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_REBOOT_MDM;</td></tr> +<tr class="codeline" data-linenumber="3144"><td class="num" id="LN3144">3144</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3145"><td class="num" id="LN3145">3145</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3146"><td class="num" id="LN3146">3146</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3147"><td class="num" id="LN3147">3147</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3148"><td class="num" id="LN3148">3148</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3149"><td class="num" id="LN3149">3149</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="3150"><td class="num" id="LN3150">3150</td><td class="line"> <span class='macro'>g_signal_connect (consolekit,<span class='macro_popup'>g_signal_connect_data ((consolekit), ("privileges-completed")<br>, (((GCallback) (request_reboot_privileges_completed_consolekit<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3151"><td class="num" id="LN3151">3151</td><td class="line"> <span class='string_literal'><span class='macro'>"privileges-completed"</span>,<span class='macro_popup'>g_signal_connect_data ((consolekit), ("privileges-completed")<br>, (((GCallback) (request_reboot_privileges_completed_consolekit<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3152"><td class="num" id="LN3152">3152</td><td class="line"> <span class='macro'>G_CALLBACK (request_reboot_privileges_completed_consolekit),<span class='macro_popup'>g_signal_connect_data ((consolekit), ("privileges-completed")<br>, (((GCallback) (request_reboot_privileges_completed_consolekit<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3153"><td class="num" id="LN3153">3153</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((consolekit), ("privileges-completed")<br>, (((GCallback) (request_reboot_privileges_completed_consolekit<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3154"><td class="num" id="LN3154">3154</td><td class="line"> success = gsm_consolekit_get_restart_privileges (consolekit);</td></tr> +<tr class="codeline" data-linenumber="3155"><td class="num" id="LN3155">3155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3156"><td class="num" id="LN3156">3156</td><td class="line"> <span class='keyword'>if</span> (!success) {</td></tr> +<tr class="codeline" data-linenumber="3157"><td class="num" id="LN3157">3157</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (consolekit,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_consolekit), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3158"><td class="num" id="LN3158">3158</td><td class="line"> <span class='macro'>request_reboot_privileges_completed_consolekit,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_consolekit), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3159"><td class="num" id="LN3159">3159</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_consolekit), (manager<br>))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3160"><td class="num" id="LN3160">3160</td><td class="line"> g_object_unref (consolekit);</td></tr> +<tr class="codeline" data-linenumber="3161"><td class="num" id="LN3161">3161</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3162"><td class="num" id="LN3162">3162</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_REBOOT_MDM;</td></tr> +<tr class="codeline" data-linenumber="3163"><td class="num" id="LN3163">3163</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3164"><td class="num" id="LN3164">3164</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3165"><td class="num" id="LN3165">3165</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3166"><td class="num" id="LN3166">3166</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3167"><td class="num" id="LN3167">3167</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3168"><td class="num" id="LN3168">3168</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3169"><td class="num" id="LN3169">3169</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3170"><td class="num" id="LN3170">3170</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3171"><td class="num" id="LN3171">3171</td><td class="line">request_shutdown_privileges_completed_consolekit (GsmConsolekit *consolekit,</td></tr> +<tr class="codeline" data-linenumber="3172"><td class="num" id="LN3172">3172</td><td class="line"> gboolean success,</td></tr> +<tr class="codeline" data-linenumber="3173"><td class="num" id="LN3173">3173</td><td class="line"> gboolean ask_later,</td></tr> +<tr class="codeline" data-linenumber="3174"><td class="num" id="LN3174">3174</td><td class="line"> GError *error,</td></tr> +<tr class="codeline" data-linenumber="3175"><td class="num" id="LN3175">3175</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3176"><td class="num" id="LN3176">3176</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3177"><td class="num" id="LN3177">3177</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3178"><td class="num" id="LN3178">3178</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3179"><td class="num" id="LN3179">3179</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3180"><td class="num" id="LN3180">3180</td><td class="line"> <span class='comment'>/* make sure we disconnect the signal handler so that it's not called</span></td></tr> +<tr class="codeline" data-linenumber="3181"><td class="num" id="LN3181">3181</td><td class="line"> <span class='comment'>* again next time the event is fired -- this can happen if the reboot</span></td></tr> +<tr class="codeline" data-linenumber="3182"><td class="num" id="LN3182">3182</td><td class="line"> <span class='comment'>* is cancelled. */</span></td></tr> +<tr class="codeline" data-linenumber="3183"><td class="num" id="LN3183">3183</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (consolekit,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_consolekit), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3184"><td class="num" id="LN3184">3184</td><td class="line"> <span class='macro'>request_shutdown_privileges_completed_consolekit,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_consolekit), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3185"><td class="num" id="LN3185">3185</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_consolekit), (manager<br>))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3186"><td class="num" id="LN3186">3186</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3187"><td class="num" id="LN3187">3187</td><td class="line"> g_object_unref (consolekit);</td></tr> +<tr class="codeline" data-linenumber="3188"><td class="num" id="LN3188">3188</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3189"><td class="num" id="LN3189">3189</td><td class="line"> <span class='keyword'>if</span> (success) {</td></tr> +<tr class="codeline" data-linenumber="3190"><td class="num" id="LN3190">3190</td><td class="line"> <span class='keyword'>if</span> (ask_later) {</td></tr> +<tr class="codeline" data-linenumber="3191"><td class="num" id="LN3191">3191</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_SHUTDOWN_INTERACT;</td></tr> +<tr class="codeline" data-linenumber="3192"><td class="num" id="LN3192">3192</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3193"><td class="num" id="LN3193">3193</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_SHUTDOWN;</td></tr> +<tr class="codeline" data-linenumber="3194"><td class="num" id="LN3194">3194</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3195"><td class="num" id="LN3195">3195</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3196"><td class="num" id="LN3196">3196</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3197"><td class="num" id="LN3197">3197</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3198"><td class="num" id="LN3198">3198</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3199"><td class="num" id="LN3199">3199</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3200"><td class="num" id="LN3200">3200</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3201"><td class="num" id="LN3201">3201</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3202"><td class="num" id="LN3202">3202</td><td class="line">request_shutdown_privileges_completed_systemd (GsmSystemd *systemd,</td></tr> +<tr class="codeline" data-linenumber="3203"><td class="num" id="LN3203">3203</td><td class="line"> gboolean success,</td></tr> +<tr class="codeline" data-linenumber="3204"><td class="num" id="LN3204">3204</td><td class="line"> gboolean ask_later,</td></tr> +<tr class="codeline" data-linenumber="3205"><td class="num" id="LN3205">3205</td><td class="line"> GError *error,</td></tr> +<tr class="codeline" data-linenumber="3206"><td class="num" id="LN3206">3206</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3207"><td class="num" id="LN3207">3207</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3208"><td class="num" id="LN3208">3208</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3209"><td class="num" id="LN3209">3209</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3210"><td class="num" id="LN3210">3210</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3211"><td class="num" id="LN3211">3211</td><td class="line"> <span class='comment'>/* make sure we disconnect the signal handler so that it's not called</span></td></tr> +<tr class="codeline" data-linenumber="3212"><td class="num" id="LN3212">3212</td><td class="line"> <span class='comment'>* again next time the event is fired -- this can happen if the reboot</span></td></tr> +<tr class="codeline" data-linenumber="3213"><td class="num" id="LN3213">3213</td><td class="line"> <span class='comment'>* is cancelled. */</span></td></tr> +<tr class="codeline" data-linenumber="3214"><td class="num" id="LN3214">3214</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (systemd,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_systemd), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3215"><td class="num" id="LN3215">3215</td><td class="line"> <span class='macro'>request_shutdown_privileges_completed_systemd,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_systemd), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3216"><td class="num" id="LN3216">3216</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_systemd), (manager<br>))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3217"><td class="num" id="LN3217">3217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3218"><td class="num" id="LN3218">3218</td><td class="line"> g_object_unref (systemd);</td></tr> +<tr class="codeline" data-linenumber="3219"><td class="num" id="LN3219">3219</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3220"><td class="num" id="LN3220">3220</td><td class="line"> <span class='keyword'>if</span> (success) {</td></tr> +<tr class="codeline" data-linenumber="3221"><td class="num" id="LN3221">3221</td><td class="line"> <span class='keyword'>if</span> (ask_later) {</td></tr> +<tr class="codeline" data-linenumber="3222"><td class="num" id="LN3222">3222</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_SHUTDOWN_INTERACT;</td></tr> +<tr class="codeline" data-linenumber="3223"><td class="num" id="LN3223">3223</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3224"><td class="num" id="LN3224">3224</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_SHUTDOWN;</td></tr> +<tr class="codeline" data-linenumber="3225"><td class="num" id="LN3225">3225</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3226"><td class="num" id="LN3226">3226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3227"><td class="num" id="LN3227">3227</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3228"><td class="num" id="LN3228">3228</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3229"><td class="num" id="LN3229">3229</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3230"><td class="num" id="LN3230">3230</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3231"><td class="num" id="LN3231">3231</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3232"><td class="num" id="LN3232">3232</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3233"><td class="num" id="LN3233">3233</td><td class="line">request_shutdown (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3234"><td class="num" id="LN3234">3234</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3235"><td class="num" id="LN3235">3235</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="3236"><td class="num" id="LN3236">3236</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3237"><td class="num" id="LN3237">3237</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="3238"><td class="num" id="LN3238">3238</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3239"><td class="num" id="LN3239">3239</td><td class="line"> gboolean success;</td></tr> +<tr class="codeline" data-linenumber="3240"><td class="num" id="LN3240">3240</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3241"><td class="num" id="LN3241">3241</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3242"><td class="num" id="LN3242">3242</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: requesting shutdown"</span>);</td></tr> +<tr class="codeline" data-linenumber="3243"><td class="num" id="LN3243">3243</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3244"><td class="num" id="LN3244">3244</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3245"><td class="num" id="LN3245">3245</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3246"><td class="num" id="LN3246">3246</td><td class="line"> <span class='comment'>/* See the comment in request_reboot() for some more details about how</span></td></tr> +<tr class="codeline" data-linenumber="3247"><td class="num" id="LN3247">3247</td><td class="line"> <span class='comment'>* this works. */</span></td></tr> +<tr class="codeline" data-linenumber="3248"><td class="num" id="LN3248">3248</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3249"><td class="num" id="LN3249">3249</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3250"><td class="num" id="LN3250">3250</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3251"><td class="num" id="LN3251">3251</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="3252"><td class="num" id="LN3252">3252</td><td class="line"> <span class='macro'>g_signal_connect (systemd,<span class='macro_popup'>g_signal_connect_data ((systemd), ("privileges-completed"), (<br>((GCallback) (request_shutdown_privileges_completed_systemd))<br>), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3253"><td class="num" id="LN3253">3253</td><td class="line"> <span class='string_literal'><span class='macro'>"privileges-completed"</span>,<span class='macro_popup'>g_signal_connect_data ((systemd), ("privileges-completed"), (<br>((GCallback) (request_shutdown_privileges_completed_systemd))<br>), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3254"><td class="num" id="LN3254">3254</td><td class="line"> <span class='macro'>G_CALLBACK (request_shutdown_privileges_completed_systemd),<span class='macro_popup'>g_signal_connect_data ((systemd), ("privileges-completed"), (<br>((GCallback) (request_shutdown_privileges_completed_systemd))<br>), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3255"><td class="num" id="LN3255">3255</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((systemd), ("privileges-completed"), (<br>((GCallback) (request_shutdown_privileges_completed_systemd))<br>), (manager), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3256"><td class="num" id="LN3256">3256</td><td class="line"> success = gsm_systemd_get_stop_privileges (systemd);</td></tr> +<tr class="codeline" data-linenumber="3257"><td class="num" id="LN3257">3257</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3258"><td class="num" id="LN3258">3258</td><td class="line"> <span class='keyword'>if</span> (!success) {</td></tr> +<tr class="codeline" data-linenumber="3259"><td class="num" id="LN3259">3259</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (systemd,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_systemd), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3260"><td class="num" id="LN3260">3260</td><td class="line"> <span class='macro'>request_shutdown_privileges_completed_systemd,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_systemd), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3261"><td class="num" id="LN3261">3261</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_systemd), (manager<br>))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3262"><td class="num" id="LN3262">3262</td><td class="line"> g_object_unref (systemd);</td></tr> +<tr class="codeline" data-linenumber="3263"><td class="num" id="LN3263">3263</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3264"><td class="num" id="LN3264">3264</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_SHUTDOWN_MDM;</td></tr> +<tr class="codeline" data-linenumber="3265"><td class="num" id="LN3265">3265</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3266"><td class="num" id="LN3266">3266</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3267"><td class="num" id="LN3267">3267</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3268"><td class="num" id="LN3268">3268</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3269"><td class="num" id="LN3269">3269</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3270"><td class="num" id="LN3270">3270</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="3271"><td class="num" id="LN3271">3271</td><td class="line"> <span class='macro'>g_signal_connect (consolekit,<span class='macro_popup'>g_signal_connect_data ((consolekit), ("privileges-completed")<br>, (((GCallback) (request_shutdown_privileges_completed_consolekit<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3272"><td class="num" id="LN3272">3272</td><td class="line"> <span class='string_literal'><span class='macro'>"privileges-completed"</span>,<span class='macro_popup'>g_signal_connect_data ((consolekit), ("privileges-completed")<br>, (((GCallback) (request_shutdown_privileges_completed_consolekit<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3273"><td class="num" id="LN3273">3273</td><td class="line"> <span class='macro'>G_CALLBACK (request_shutdown_privileges_completed_consolekit),<span class='macro_popup'>g_signal_connect_data ((consolekit), ("privileges-completed")<br>, (((GCallback) (request_shutdown_privileges_completed_consolekit<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3274"><td class="num" id="LN3274">3274</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((consolekit), ("privileges-completed")<br>, (((GCallback) (request_shutdown_privileges_completed_consolekit<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3275"><td class="num" id="LN3275">3275</td><td class="line"> success = gsm_consolekit_get_stop_privileges (consolekit);</td></tr> +<tr class="codeline" data-linenumber="3276"><td class="num" id="LN3276">3276</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3277"><td class="num" id="LN3277">3277</td><td class="line"> <span class='keyword'>if</span> (!success) {</td></tr> +<tr class="codeline" data-linenumber="3278"><td class="num" id="LN3278">3278</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (consolekit,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_consolekit), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3279"><td class="num" id="LN3279">3279</td><td class="line"> <span class='macro'>request_shutdown_privileges_completed_consolekit,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_consolekit), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3280"><td class="num" id="LN3280">3280</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_consolekit), (manager<br>))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3281"><td class="num" id="LN3281">3281</td><td class="line"> g_object_unref (consolekit);</td></tr> +<tr class="codeline" data-linenumber="3282"><td class="num" id="LN3282">3282</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3283"><td class="num" id="LN3283">3283</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_SHUTDOWN_MDM;</td></tr> +<tr class="codeline" data-linenumber="3284"><td class="num" id="LN3284">3284</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3285"><td class="num" id="LN3285">3285</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3286"><td class="num" id="LN3286">3286</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3287"><td class="num" id="LN3287">3287</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3288"><td class="num" id="LN3288">3288</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3289"><td class="num" id="LN3289">3289</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3290"><td class="num" id="LN3290">3290</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3291"><td class="num" id="LN3291">3291</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3292"><td class="num" id="LN3292">3292</td><td class="line">request_suspend (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3293"><td class="num" id="LN3293">3293</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3294"><td class="num" id="LN3294">3294</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3295"><td class="num" id="LN3295">3295</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3296"><td class="num" id="LN3296">3296</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: requesting suspend"</span>);</td></tr> +<tr class="codeline" data-linenumber="3297"><td class="num" id="LN3297">3297</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3298"><td class="num" id="LN3298">3298</td><td class="line"> <span class='keyword'>if</span> (! gsm_manager_is_suspend_inhibited (manager)) {</td></tr> +<tr class="codeline" data-linenumber="3299"><td class="num" id="LN3299">3299</td><td class="line"> manager_attempt_suspend (manager);</td></tr> +<tr class="codeline" data-linenumber="3300"><td class="num" id="LN3300">3300</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3301"><td class="num" id="LN3301">3301</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3302"><td class="num" id="LN3302">3302</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3303"><td class="num" id="LN3303">3303</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3304"><td class="num" id="LN3304">3304</td><td class="line"> <span class='keyword'>if</span> (priv->inhibit_dialog != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3305"><td class="num" id="LN3305">3305</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: inhibit dialog already up"</span>);</td></tr> +<tr class="codeline" data-linenumber="3306"><td class="num" id="LN3306">3306</td><td class="line"> gtk_window_present (<span class='macro'>GTK_WINDOW (priv->inhibit_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((priv->inhibit_dialog)), ((gtk_window_get_type ())))))<br>)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3307"><td class="num" id="LN3307">3307</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3308"><td class="num" id="LN3308">3308</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3309"><td class="num" id="LN3309">3309</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3310"><td class="num" id="LN3310">3310</td><td class="line"> priv->inhibit_dialog = gsm_inhibit_dialog_new (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="3311"><td class="num" id="LN3311">3311</td><td class="line"> priv->clients,</td></tr> +<tr class="codeline" data-linenumber="3312"><td class="num" id="LN3312">3312</td><td class="line"> GSM_LOGOUT_ACTION_SLEEP);</td></tr> +<tr class="codeline" data-linenumber="3313"><td class="num" id="LN3313">3313</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3314"><td class="num" id="LN3314">3314</td><td class="line"> <span class='macro'>g_signal_connect (priv->inhibit_dialog,<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3315"><td class="num" id="LN3315">3315</td><td class="line"> <span class='string_literal'><span class='macro'>"response"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3316"><td class="num" id="LN3316">3316</td><td class="line"> <span class='macro'>G_CALLBACK (inhibit_dialog_response),<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3317"><td class="num" id="LN3317">3317</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3318"><td class="num" id="LN3318">3318</td><td class="line"> gtk_widget_show (priv->inhibit_dialog);</td></tr> +<tr class="codeline" data-linenumber="3319"><td class="num" id="LN3319">3319</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3320"><td class="num" id="LN3320">3320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3321"><td class="num" id="LN3321">3321</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3322"><td class="num" id="LN3322">3322</td><td class="line">request_hibernate (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3323"><td class="num" id="LN3323">3323</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3324"><td class="num" id="LN3324">3324</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3325"><td class="num" id="LN3325">3325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3326"><td class="num" id="LN3326">3326</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: requesting hibernate"</span>);</td></tr> +<tr class="codeline" data-linenumber="3327"><td class="num" id="LN3327">3327</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3328"><td class="num" id="LN3328">3328</td><td class="line"> <span class='comment'>/* hibernate uses suspend inhibit */</span></td></tr> +<tr class="codeline" data-linenumber="3329"><td class="num" id="LN3329">3329</td><td class="line"> <span class='keyword'>if</span> (! gsm_manager_is_suspend_inhibited (manager)) {</td></tr> +<tr class="codeline" data-linenumber="3330"><td class="num" id="LN3330">3330</td><td class="line"> manager_attempt_hibernate (manager);</td></tr> +<tr class="codeline" data-linenumber="3331"><td class="num" id="LN3331">3331</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3332"><td class="num" id="LN3332">3332</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3333"><td class="num" id="LN3333">3333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3334"><td class="num" id="LN3334">3334</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3335"><td class="num" id="LN3335">3335</td><td class="line"> <span class='keyword'>if</span> (priv->inhibit_dialog != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3336"><td class="num" id="LN3336">3336</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: inhibit dialog already up"</span>);</td></tr> +<tr class="codeline" data-linenumber="3337"><td class="num" id="LN3337">3337</td><td class="line"> gtk_window_present (<span class='macro'>GTK_WINDOW (priv->inhibit_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((priv->inhibit_dialog)), ((gtk_window_get_type ())))))<br>)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3338"><td class="num" id="LN3338">3338</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3339"><td class="num" id="LN3339">3339</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3340"><td class="num" id="LN3340">3340</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3341"><td class="num" id="LN3341">3341</td><td class="line"> priv->inhibit_dialog = gsm_inhibit_dialog_new (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="3342"><td class="num" id="LN3342">3342</td><td class="line"> priv->clients,</td></tr> +<tr class="codeline" data-linenumber="3343"><td class="num" id="LN3343">3343</td><td class="line"> GSM_LOGOUT_ACTION_HIBERNATE);</td></tr> +<tr class="codeline" data-linenumber="3344"><td class="num" id="LN3344">3344</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3345"><td class="num" id="LN3345">3345</td><td class="line"> <span class='macro'>g_signal_connect (priv->inhibit_dialog,<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3346"><td class="num" id="LN3346">3346</td><td class="line"> <span class='string_literal'><span class='macro'>"response"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3347"><td class="num" id="LN3347">3347</td><td class="line"> <span class='macro'>G_CALLBACK (inhibit_dialog_response),<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3348"><td class="num" id="LN3348">3348</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3349"><td class="num" id="LN3349">3349</td><td class="line"> gtk_widget_show (priv->inhibit_dialog);</td></tr> +<tr class="codeline" data-linenumber="3350"><td class="num" id="LN3350">3350</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3351"><td class="num" id="LN3351">3351</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3352"><td class="num" id="LN3352">3352</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3353"><td class="num" id="LN3353">3353</td><td class="line">request_logout (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3354"><td class="num" id="LN3354">3354</td><td class="line"> GsmManagerLogoutMode mode)</td></tr> +<tr class="codeline" data-linenumber="3355"><td class="num" id="LN3355">3355</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3356"><td class="num" id="LN3356">3356</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3357"><td class="num" id="LN3357">3357</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3358"><td class="num" id="LN3358">3358</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: requesting logout"</span>);</td></tr> +<tr class="codeline" data-linenumber="3359"><td class="num" id="LN3359">3359</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3360"><td class="num" id="LN3360">3360</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3361"><td class="num" id="LN3361">3361</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3362"><td class="num" id="LN3362">3362</td><td class="line"> priv->logout_mode = mode;</td></tr> +<tr class="codeline" data-linenumber="3363"><td class="num" id="LN3363">3363</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_LOGOUT;</td></tr> +<tr class="codeline" data-linenumber="3364"><td class="num" id="LN3364">3364</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3365"><td class="num" id="LN3365">3365</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3366"><td class="num" id="LN3366">3366</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3367"><td class="num" id="LN3367">3367</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3368"><td class="num" id="LN3368">3368</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3369"><td class="num" id="LN3369">3369</td><td class="line">request_switch_user (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3370"><td class="num" id="LN3370">3370</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3371"><td class="num" id="LN3371">3371</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3372"><td class="num" id="LN3372">3372</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3373"><td class="num" id="LN3373">3373</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: requesting user switch"</span>);</td></tr> +<tr class="codeline" data-linenumber="3374"><td class="num" id="LN3374">3374</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3375"><td class="num" id="LN3375">3375</td><td class="line"> <span class='comment'>/* See comment in manager_switch_user() to understand why we do this in</span></td></tr> +<tr class="codeline" data-linenumber="3376"><td class="num" id="LN3376">3376</td><td class="line"> <span class='comment'>* both functions. */</span></td></tr> +<tr class="codeline" data-linenumber="3377"><td class="num" id="LN3377">3377</td><td class="line"> <span class='keyword'>if</span> (_switch_user_is_locked_down (manager)) {</td></tr> +<tr class="codeline" data-linenumber="3378"><td class="num" id="LN3378">3378</td><td class="line"> g_warning (<span class='string_literal'>"Unable to switch user: User switching has been locked down"</span>);</td></tr> +<tr class="codeline" data-linenumber="3379"><td class="num" id="LN3379">3379</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3380"><td class="num" id="LN3380">3380</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3381"><td class="num" id="LN3381">3381</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3382"><td class="num" id="LN3382">3382</td><td class="line"> <span class='keyword'>if</span> (! gsm_manager_is_switch_user_inhibited (manager)) {</td></tr> +<tr class="codeline" data-linenumber="3383"><td class="num" id="LN3383">3383</td><td class="line"> manager_switch_user (manager);</td></tr> +<tr class="codeline" data-linenumber="3384"><td class="num" id="LN3384">3384</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3385"><td class="num" id="LN3385">3385</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3386"><td class="num" id="LN3386">3386</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3387"><td class="num" id="LN3387">3387</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3388"><td class="num" id="LN3388">3388</td><td class="line"> <span class='keyword'>if</span> (priv->inhibit_dialog != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3389"><td class="num" id="LN3389">3389</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: inhibit dialog already up"</span>);</td></tr> +<tr class="codeline" data-linenumber="3390"><td class="num" id="LN3390">3390</td><td class="line"> gtk_window_present (<span class='macro'>GTK_WINDOW (priv->inhibit_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((priv->inhibit_dialog)), ((gtk_window_get_type ())))))<br>)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3391"><td class="num" id="LN3391">3391</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3392"><td class="num" id="LN3392">3392</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3393"><td class="num" id="LN3393">3393</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3394"><td class="num" id="LN3394">3394</td><td class="line"> priv->inhibit_dialog = gsm_inhibit_dialog_new (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="3395"><td class="num" id="LN3395">3395</td><td class="line"> priv->clients,</td></tr> +<tr class="codeline" data-linenumber="3396"><td class="num" id="LN3396">3396</td><td class="line"> GSM_LOGOUT_ACTION_SWITCH_USER);</td></tr> +<tr class="codeline" data-linenumber="3397"><td class="num" id="LN3397">3397</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3398"><td class="num" id="LN3398">3398</td><td class="line"> <span class='macro'>g_signal_connect (priv->inhibit_dialog,<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3399"><td class="num" id="LN3399">3399</td><td class="line"> <span class='string_literal'><span class='macro'>"response"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3400"><td class="num" id="LN3400">3400</td><td class="line"> <span class='macro'>G_CALLBACK (inhibit_dialog_response),<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3401"><td class="num" id="LN3401">3401</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3402"><td class="num" id="LN3402">3402</td><td class="line"> gtk_widget_show (priv->inhibit_dialog);</td></tr> +<tr class="codeline" data-linenumber="3403"><td class="num" id="LN3403">3403</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3404"><td class="num" id="LN3404">3404</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3405"><td class="num" id="LN3405">3405</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3406"><td class="num" id="LN3406">3406</td><td class="line">logout_dialog_response (GsmLogoutDialog *logout_dialog,</td></tr> +<tr class="codeline" data-linenumber="3407"><td class="num" id="LN3407">3407</td><td class="line"> guint response_id,</td></tr> +<tr class="codeline" data-linenumber="3408"><td class="num" id="LN3408">3408</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3409"><td class="num" id="LN3409">3409</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3410"><td class="num" id="LN3410">3410</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3411"><td class="num" id="LN3411">3411</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3412"><td class="num" id="LN3412">3412</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3413"><td class="num" id="LN3413">3413</td><td class="line"> <span class='comment'>/* We should only be here if mode has already have been set from</span></td></tr> +<tr class="codeline" data-linenumber="3414"><td class="num" id="LN3414">3414</td><td class="line"> <span class='comment'>* show_fallback_shutdown/logout_dialog</span></td></tr> +<tr class="codeline" data-linenumber="3415"><td class="num" id="LN3415">3415</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="3416"><td class="num" id="LN3416">3416</td><td class="line"> <span class='macro'>g_assert (priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_NORMAL)<span class='macro_popup'>do { if (priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_NORMAL<br>) ; else g_assertion_message_expr (((gchar*) 0), "gsm-manager.c"<br>, 3416, ((const char*) (__func__)), "priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_NORMAL"<br>); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3417"><td class="num" id="LN3417">3417</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3418"><td class="num" id="LN3418">3418</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Logout dialog response: %d"</span>, response_id);</td></tr> +<tr class="codeline" data-linenumber="3419"><td class="num" id="LN3419">3419</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3420"><td class="num" id="LN3420">3420</td><td class="line"> gtk_widget_destroy (<span class='macro'>GTK_WIDGET (logout_dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_widget_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3421"><td class="num" id="LN3421">3421</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3422"><td class="num" id="LN3422">3422</td><td class="line"> <span class='comment'>/* In case of dialog cancel, switch user, hibernate and</span></td></tr> +<tr class="codeline" data-linenumber="3423"><td class="num" id="LN3423">3423</td><td class="line"> <span class='comment'>* suspend, we just perform the respective action and return,</span></td></tr> +<tr class="codeline" data-linenumber="3424"><td class="num" id="LN3424">3424</td><td class="line"> <span class='comment'>* without shutting down the session. */</span></td></tr> +<tr class="codeline" data-linenumber="3425"><td class="num" id="LN3425">3425</td><td class="line"> <span class='keyword'>switch</span> (response_id) {</td></tr> +<tr class="codeline" data-linenumber="3426"><td class="num" id="LN3426">3426</td><td class="line"> <span class='keyword'>case</span> GTK_RESPONSE_CANCEL:</td></tr> +<tr class="codeline" data-linenumber="3427"><td class="num" id="LN3427">3427</td><td class="line"> <span class='keyword'>case</span> GTK_RESPONSE_NONE:</td></tr> +<tr class="codeline" data-linenumber="3428"><td class="num" id="LN3428">3428</td><td class="line"> <span class='keyword'>case</span> GTK_RESPONSE_DELETE_EVENT:</td></tr> +<tr class="codeline" data-linenumber="3429"><td class="num" id="LN3429">3429</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3430"><td class="num" id="LN3430">3430</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_RESPONSE_SWITCH_USER:</td></tr> +<tr class="codeline" data-linenumber="3431"><td class="num" id="LN3431">3431</td><td class="line"> request_switch_user (manager);</td></tr> +<tr class="codeline" data-linenumber="3432"><td class="num" id="LN3432">3432</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3433"><td class="num" id="LN3433">3433</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_RESPONSE_HIBERNATE:</td></tr> +<tr class="codeline" data-linenumber="3434"><td class="num" id="LN3434">3434</td><td class="line"> request_hibernate (manager);</td></tr> +<tr class="codeline" data-linenumber="3435"><td class="num" id="LN3435">3435</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3436"><td class="num" id="LN3436">3436</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_RESPONSE_SLEEP:</td></tr> +<tr class="codeline" data-linenumber="3437"><td class="num" id="LN3437">3437</td><td class="line"> request_suspend (manager);</td></tr> +<tr class="codeline" data-linenumber="3438"><td class="num" id="LN3438">3438</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3439"><td class="num" id="LN3439">3439</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_RESPONSE_SHUTDOWN:</td></tr> +<tr class="codeline" data-linenumber="3440"><td class="num" id="LN3440">3440</td><td class="line"> request_shutdown (manager);</td></tr> +<tr class="codeline" data-linenumber="3441"><td class="num" id="LN3441">3441</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3442"><td class="num" id="LN3442">3442</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_RESPONSE_REBOOT:</td></tr> +<tr class="codeline" data-linenumber="3443"><td class="num" id="LN3443">3443</td><td class="line"> request_reboot (manager);</td></tr> +<tr class="codeline" data-linenumber="3444"><td class="num" id="LN3444">3444</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3445"><td class="num" id="LN3445">3445</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_RESPONSE_LOGOUT:</td></tr> +<tr class="codeline" data-linenumber="3446"><td class="num" id="LN3446">3446</td><td class="line"> <span class='comment'>/* We've already gotten confirmation from the user so</span></td></tr> +<tr class="codeline" data-linenumber="3447"><td class="num" id="LN3447">3447</td><td class="line"> <span class='comment'>* initiate the logout in NO_CONFIRMATION mode.</span></td></tr> +<tr class="codeline" data-linenumber="3448"><td class="num" id="LN3448">3448</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="3449"><td class="num" id="LN3449">3449</td><td class="line"> <span class='comment'>* (it shouldn't matter whether we use NO_CONFIRMATION or stay</span></td></tr> +<tr class="codeline" data-linenumber="3450"><td class="num" id="LN3450">3450</td><td class="line"> <span class='comment'>* with NORMAL, unless the shell happens to start after the</span></td></tr> +<tr class="codeline" data-linenumber="3451"><td class="num" id="LN3451">3451</td><td class="line"> <span class='comment'>* user confirmed)</span></td></tr> +<tr class="codeline" data-linenumber="3452"><td class="num" id="LN3452">3452</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="3453"><td class="num" id="LN3453">3453</td><td class="line"> request_logout (manager, GSM_MANAGER_LOGOUT_MODE_NO_CONFIRMATION);</td></tr> +<tr class="codeline" data-linenumber="3454"><td class="num" id="LN3454">3454</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3455"><td class="num" id="LN3455">3455</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="3456"><td class="num" id="LN3456">3456</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-manager.c",<br> 3456, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3457"><td class="num" id="LN3457">3457</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3458"><td class="num" id="LN3458">3458</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3459"><td class="num" id="LN3459">3459</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3460"><td class="num" id="LN3460">3460</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3461"><td class="num" id="LN3461">3461</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3462"><td class="num" id="LN3462">3462</td><td class="line">show_shutdown_dialog (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3463"><td class="num" id="LN3463">3463</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3464"><td class="num" id="LN3464">3464</td><td class="line"> GtkWidget *dialog;</td></tr> +<tr class="codeline" data-linenumber="3465"><td class="num" id="LN3465">3465</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3466"><td class="num" id="LN3466">3466</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3467"><td class="num" id="LN3467">3467</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3468"><td class="num" id="LN3468">3468</td><td class="line"> <span class='keyword'>if</span> (priv->phase >= GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="3469"><td class="num" id="LN3469">3469</td><td class="line"> <span class='comment'>/* Already shutting down, nothing more to do */</span></td></tr> +<tr class="codeline" data-linenumber="3470"><td class="num" id="LN3470">3470</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3471"><td class="num" id="LN3471">3471</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3472"><td class="num" id="LN3472">3472</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3473"><td class="num" id="LN3473">3473</td><td class="line"> priv->logout_mode = GSM_MANAGER_LOGOUT_MODE_NORMAL;</td></tr> +<tr class="codeline" data-linenumber="3474"><td class="num" id="LN3474">3474</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3475"><td class="num" id="LN3475">3475</td><td class="line"> dialog = gsm_get_shutdown_dialog (gdk_screen_get_default (),</td></tr> +<tr class="codeline" data-linenumber="3476"><td class="num" id="LN3476">3476</td><td class="line"> gtk_get_current_event_time ());</td></tr> +<tr class="codeline" data-linenumber="3477"><td class="num" id="LN3477">3477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3478"><td class="num" id="LN3478">3478</td><td class="line"> <span class='macro'>g_signal_connect (dialog,<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>logout_dialog_response))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3479"><td class="num" id="LN3479">3479</td><td class="line"> <span class='string_literal'><span class='macro'>"response"</span>,<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>logout_dialog_response))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3480"><td class="num" id="LN3480">3480</td><td class="line"> <span class='macro'>G_CALLBACK (logout_dialog_response),<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>logout_dialog_response))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3481"><td class="num" id="LN3481">3481</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>logout_dialog_response))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3482"><td class="num" id="LN3482">3482</td><td class="line"> gtk_widget_show (dialog);</td></tr> +<tr class="codeline" data-linenumber="3483"><td class="num" id="LN3483">3483</td><td class="line"> gtk_window_present_with_time (<span class='macro'>GTK_WINDOW (dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3484"><td class="num" id="LN3484">3484</td><td class="line"> gdk_x11_get_server_time (gtk_widget_get_window (<span class='macro'>GTK_WIDGET (dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_widget_get_type ()))))))</span></span>)));</td></tr> +<tr class="codeline" data-linenumber="3485"><td class="num" id="LN3485">3485</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3486"><td class="num" id="LN3486">3486</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3487"><td class="num" id="LN3487">3487</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3488"><td class="num" id="LN3488">3488</td><td class="line">show_logout_dialog (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3489"><td class="num" id="LN3489">3489</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3490"><td class="num" id="LN3490">3490</td><td class="line"> GtkWidget *dialog;</td></tr> +<tr class="codeline" data-linenumber="3491"><td class="num" id="LN3491">3491</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3492"><td class="num" id="LN3492">3492</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3493"><td class="num" id="LN3493">3493</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3494"><td class="num" id="LN3494">3494</td><td class="line"> <span class='keyword'>if</span> (priv->phase >= GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="3495"><td class="num" id="LN3495">3495</td><td class="line"> <span class='comment'>/* Already shutting down, nothing more to do */</span></td></tr> +<tr class="codeline" data-linenumber="3496"><td class="num" id="LN3496">3496</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3497"><td class="num" id="LN3497">3497</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3498"><td class="num" id="LN3498">3498</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3499"><td class="num" id="LN3499">3499</td><td class="line"> priv->logout_mode = GSM_MANAGER_LOGOUT_MODE_NORMAL;</td></tr> +<tr class="codeline" data-linenumber="3500"><td class="num" id="LN3500">3500</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3501"><td class="num" id="LN3501">3501</td><td class="line"> dialog = gsm_get_logout_dialog (gdk_screen_get_default (),</td></tr> +<tr class="codeline" data-linenumber="3502"><td class="num" id="LN3502">3502</td><td class="line"> gtk_get_current_event_time ());</td></tr> +<tr class="codeline" data-linenumber="3503"><td class="num" id="LN3503">3503</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3504"><td class="num" id="LN3504">3504</td><td class="line"> <span class='macro'>g_signal_connect (dialog,<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>logout_dialog_response))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3505"><td class="num" id="LN3505">3505</td><td class="line"> <span class='string_literal'><span class='macro'>"response"</span>,<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>logout_dialog_response))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3506"><td class="num" id="LN3506">3506</td><td class="line"> <span class='macro'>G_CALLBACK (logout_dialog_response),<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>logout_dialog_response))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3507"><td class="num" id="LN3507">3507</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>logout_dialog_response))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3508"><td class="num" id="LN3508">3508</td><td class="line"> gtk_widget_show (dialog);</td></tr> +<tr class="codeline" data-linenumber="3509"><td class="num" id="LN3509">3509</td><td class="line"> gtk_window_present_with_time (<span class='macro'>GTK_WINDOW (dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3510"><td class="num" id="LN3510">3510</td><td class="line"> gdk_x11_get_server_time (gtk_widget_get_window (<span class='macro'>GTK_WIDGET (dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_widget_get_type ()))))))</span></span>)));</td></tr> +<tr class="codeline" data-linenumber="3511"><td class="num" id="LN3511">3511</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3512"><td class="num" id="LN3512">3512</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3513"><td class="num" id="LN3513">3513</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3514"><td class="num" id="LN3514">3514</td><td class="line">user_logout (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3515"><td class="num" id="LN3515">3515</td><td class="line"> GsmManagerLogoutMode mode)</td></tr> +<tr class="codeline" data-linenumber="3516"><td class="num" id="LN3516">3516</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3517"><td class="num" id="LN3517">3517</td><td class="line"> gboolean logout_prompt;</td></tr> +<tr class="codeline" data-linenumber="3518"><td class="num" id="LN3518">3518</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3519"><td class="num" id="LN3519">3519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3520"><td class="num" id="LN3520">3520</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3521"><td class="num" id="LN3521">3521</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3522"><td class="num" id="LN3522">3522</td><td class="line"> <span class='keyword'>if</span> (priv->phase >= GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="3523"><td class="num" id="LN3523">3523</td><td class="line"> <span class='comment'>/* Already shutting down, nothing more to do */</span></td></tr> +<tr class="codeline" data-linenumber="3524"><td class="num" id="LN3524">3524</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3525"><td class="num" id="LN3525">3525</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3526"><td class="num" id="LN3526">3526</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3527"><td class="num" id="LN3527">3527</td><td class="line"> logout_prompt =</td></tr> +<tr class="codeline" data-linenumber="3528"><td class="num" id="LN3528">3528</td><td class="line"> g_settings_get_boolean (priv->settings_session,</td></tr> +<tr class="codeline" data-linenumber="3529"><td class="num" id="LN3529">3529</td><td class="line"> <span class='string_literal'>"logout-prompt"</span>);</td></tr> +<tr class="codeline" data-linenumber="3530"><td class="num" id="LN3530">3530</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3531"><td class="num" id="LN3531">3531</td><td class="line"> <span class='comment'>/* If the shell isn't running, and this isn't a non-interative logout request,</span></td></tr> +<tr class="codeline" data-linenumber="3532"><td class="num" id="LN3532">3532</td><td class="line"> <span class='comment'>* and the user has their settings configured to show a confirmation dialog for</span></td></tr> +<tr class="codeline" data-linenumber="3533"><td class="num" id="LN3533">3533</td><td class="line"> <span class='comment'>* logout, then go ahead and show the confirmation dialog now.</span></td></tr> +<tr class="codeline" data-linenumber="3534"><td class="num" id="LN3534">3534</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="3535"><td class="num" id="LN3535">3535</td><td class="line"> <span class='keyword'>if</span> (mode == GSM_MANAGER_LOGOUT_MODE_NORMAL && logout_prompt) {</td></tr> +<tr class="codeline" data-linenumber="3536"><td class="num" id="LN3536">3536</td><td class="line"> show_logout_dialog (manager);</td></tr> +<tr class="codeline" data-linenumber="3537"><td class="num" id="LN3537">3537</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3538"><td class="num" id="LN3538">3538</td><td class="line"> request_logout (manager, mode);</td></tr> +<tr class="codeline" data-linenumber="3539"><td class="num" id="LN3539">3539</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3540"><td class="num" id="LN3540">3540</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3541"><td class="num" id="LN3541">3541</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3542"><td class="num" id="LN3542">3542</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="3543"><td class="num" id="LN3543">3543</td><td class="line"> <span class='comment'>dbus-send --session --type=method_call --print-reply</span></td></tr> +<tr class="codeline" data-linenumber="3544"><td class="num" id="LN3544">3544</td><td class="line"> <span class='comment'>--dest=org.gnome.SessionManager</span></td></tr> +<tr class="codeline" data-linenumber="3545"><td class="num" id="LN3545">3545</td><td class="line"> <span class='comment'>/org/gnome/SessionManager</span></td></tr> +<tr class="codeline" data-linenumber="3546"><td class="num" id="LN3546">3546</td><td class="line"> <span class='comment'>org.freedesktop.DBus.Introspectable.Introspect</span></td></tr> +<tr class="codeline" data-linenumber="3547"><td class="num" id="LN3547">3547</td><td class="line"><span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="3548"><td class="num" id="LN3548">3548</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3549"><td class="num" id="LN3549">3549</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3550"><td class="num" id="LN3550">3550</td><td class="line">gsm_manager_set_phase (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3551"><td class="num" id="LN3551">3551</td><td class="line"> GsmManagerPhase phase)</td></tr> +<tr class="codeline" data-linenumber="3552"><td class="num" id="LN3552">3552</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3553"><td class="num" id="LN3553">3553</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3554"><td class="num" id="LN3554">3554</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3555"><td class="num" id="LN3555">3555</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3556"><td class="num" id="LN3556">3556</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3557"><td class="num" id="LN3557">3557</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3558"><td class="num" id="LN3558">3558</td><td class="line"> priv->phase = phase;</td></tr> +<tr class="codeline" data-linenumber="3559"><td class="num" id="LN3559">3559</td><td class="line"> <span class='keyword'>return</span> (<span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3560"><td class="num" id="LN3560">3560</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3561"><td class="num" id="LN3561">3561</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3562"><td class="num" id="LN3562">3562</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3563"><td class="num" id="LN3563">3563</td><td class="line">gsm_manager_request_shutdown (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3564"><td class="num" id="LN3564">3564</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="3565"><td class="num" id="LN3565">3565</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3566"><td class="num" id="LN3566">3566</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3567"><td class="num" id="LN3567">3567</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: RequestShutdown called"</span>);</td></tr> +<tr class="codeline" data-linenumber="3568"><td class="num" id="LN3568">3568</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3569"><td class="num" id="LN3569">3569</td><td class="line"> <span class='macro'>g_return_val_if_fail(GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3570"><td class="num" id="LN3570">3570</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3571"><td class="num" id="LN3571">3571</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3572"><td class="num" id="LN3572">3572</td><td class="line"> <span class='keyword'>if</span> (priv->phase != GSM_MANAGER_PHASE_RUNNING) {</td></tr> +<tr class="codeline" data-linenumber="3573"><td class="num" id="LN3573">3573</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="3574"><td class="num" id="LN3574">3574</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3575"><td class="num" id="LN3575">3575</td><td class="line"> GSM_MANAGER_ERROR_NOT_IN_RUNNING,</td></tr> +<tr class="codeline" data-linenumber="3576"><td class="num" id="LN3576">3576</td><td class="line"> <span class='string_literal'>"RequestShutdown interface is only available during the Running phase"</span>);</td></tr> +<tr class="codeline" data-linenumber="3577"><td class="num" id="LN3577">3577</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3578"><td class="num" id="LN3578">3578</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3579"><td class="num" id="LN3579">3579</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3580"><td class="num" id="LN3580">3580</td><td class="line"> request_shutdown (manager);</td></tr> +<tr class="codeline" data-linenumber="3581"><td class="num" id="LN3581">3581</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3582"><td class="num" id="LN3582">3582</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3583"><td class="num" id="LN3583">3583</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3584"><td class="num" id="LN3584">3584</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3585"><td class="num" id="LN3585">3585</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3586"><td class="num" id="LN3586">3586</td><td class="line">gsm_manager_request_reboot (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3587"><td class="num" id="LN3587">3587</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="3588"><td class="num" id="LN3588">3588</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3589"><td class="num" id="LN3589">3589</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3590"><td class="num" id="LN3590">3590</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3591"><td class="num" id="LN3591">3591</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: RequestReboot called"</span>);</td></tr> +<tr class="codeline" data-linenumber="3592"><td class="num" id="LN3592">3592</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3593"><td class="num" id="LN3593">3593</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3594"><td class="num" id="LN3594">3594</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3595"><td class="num" id="LN3595">3595</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3596"><td class="num" id="LN3596">3596</td><td class="line"> <span class='keyword'>if</span> (priv->phase != GSM_MANAGER_PHASE_RUNNING) {</td></tr> +<tr class="codeline" data-linenumber="3597"><td class="num" id="LN3597">3597</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="3598"><td class="num" id="LN3598">3598</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3599"><td class="num" id="LN3599">3599</td><td class="line"> GSM_MANAGER_ERROR_NOT_IN_RUNNING,</td></tr> +<tr class="codeline" data-linenumber="3600"><td class="num" id="LN3600">3600</td><td class="line"> <span class='string_literal'>"RequestReboot interface is only available during the running phase"</span>);</td></tr> +<tr class="codeline" data-linenumber="3601"><td class="num" id="LN3601">3601</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3602"><td class="num" id="LN3602">3602</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3603"><td class="num" id="LN3603">3603</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3604"><td class="num" id="LN3604">3604</td><td class="line"> request_reboot (manager);</td></tr> +<tr class="codeline" data-linenumber="3605"><td class="num" id="LN3605">3605</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3606"><td class="num" id="LN3606">3606</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3607"><td class="num" id="LN3607">3607</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3608"><td class="num" id="LN3608">3608</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3609"><td class="num" id="LN3609">3609</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="3610"><td class="num" id="LN3610">3610</td><td class="line">_log_out_is_locked_down (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3611"><td class="num" id="LN3611">3611</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3612"><td class="num" id="LN3612">3612</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3613"><td class="num" id="LN3613">3613</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3614"><td class="num" id="LN3614">3614</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3615"><td class="num" id="LN3615">3615</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3616"><td class="num" id="LN3616">3616</td><td class="line"> <span class='keyword'>return</span> g_settings_get_boolean (priv->settings_lockdown,</td></tr> +<tr class="codeline" data-linenumber="3617"><td class="num" id="LN3617">3617</td><td class="line"> <span class='macro'>KEY_LOG_OUT_DISABLE<span class='macro_popup'>"disable-log-out"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3618"><td class="num" id="LN3618">3618</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3619"><td class="num" id="LN3619">3619</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3620"><td class="num" id="LN3620">3620</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="3621"><td class="num" id="LN3621">3621</td><td class="line">_switch_user_is_locked_down (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3622"><td class="num" id="LN3622">3622</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3623"><td class="num" id="LN3623">3623</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3624"><td class="num" id="LN3624">3624</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3625"><td class="num" id="LN3625">3625</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3626"><td class="num" id="LN3626">3626</td><td class="line"> <span class='keyword'>return</span> g_settings_get_boolean (priv->settings_lockdown,</td></tr> +<tr class="codeline" data-linenumber="3627"><td class="num" id="LN3627">3627</td><td class="line"> <span class='macro'>KEY_USER_SWITCH_DISABLE<span class='macro_popup'>"disable-user-switching"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3628"><td class="num" id="LN3628">3628</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3629"><td class="num" id="LN3629">3629</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3630"><td class="num" id="LN3630">3630</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3631"><td class="num" id="LN3631">3631</td><td class="line">gsm_manager_shutdown (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3632"><td class="num" id="LN3632">3632</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="3633"><td class="num" id="LN3633">3633</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3634"><td class="num" id="LN3634">3634</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3635"><td class="num" id="LN3635">3635</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Shutdown called"</span>);</td></tr> +<tr class="codeline" data-linenumber="3636"><td class="num" id="LN3636">3636</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3637"><td class="num" id="LN3637">3637</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3638"><td class="num" id="LN3638">3638</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3639"><td class="num" id="LN3639">3639</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3640"><td class="num" id="LN3640">3640</td><td class="line"> <span class='keyword'>if</span> (priv->phase != GSM_MANAGER_PHASE_RUNNING) {</td></tr> +<tr class="codeline" data-linenumber="3641"><td class="num" id="LN3641">3641</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="3642"><td class="num" id="LN3642">3642</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3643"><td class="num" id="LN3643">3643</td><td class="line"> GSM_MANAGER_ERROR_NOT_IN_RUNNING,</td></tr> +<tr class="codeline" data-linenumber="3644"><td class="num" id="LN3644">3644</td><td class="line"> <span class='string_literal'>"Shutdown interface is only available during the Running phase"</span>);</td></tr> +<tr class="codeline" data-linenumber="3645"><td class="num" id="LN3645">3645</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3646"><td class="num" id="LN3646">3646</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3647"><td class="num" id="LN3647">3647</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3648"><td class="num" id="LN3648">3648</td><td class="line"> <span class='keyword'>if</span> (_log_out_is_locked_down (manager)) {</td></tr> +<tr class="codeline" data-linenumber="3649"><td class="num" id="LN3649">3649</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="3650"><td class="num" id="LN3650">3650</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3651"><td class="num" id="LN3651">3651</td><td class="line"> GSM_MANAGER_ERROR_LOCKED_DOWN,</td></tr> +<tr class="codeline" data-linenumber="3652"><td class="num" id="LN3652">3652</td><td class="line"> <span class='string_literal'>"Logout has been locked down"</span>);</td></tr> +<tr class="codeline" data-linenumber="3653"><td class="num" id="LN3653">3653</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3654"><td class="num" id="LN3654">3654</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3655"><td class="num" id="LN3655">3655</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3656"><td class="num" id="LN3656">3656</td><td class="line"> show_shutdown_dialog (manager);</td></tr> +<tr class="codeline" data-linenumber="3657"><td class="num" id="LN3657">3657</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3658"><td class="num" id="LN3658">3658</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3659"><td class="num" id="LN3659">3659</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3660"><td class="num" id="LN3660">3660</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3661"><td class="num" id="LN3661">3661</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3662"><td class="num" id="LN3662">3662</td><td class="line">gsm_manager_can_shutdown (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3663"><td class="num" id="LN3663">3663</td><td class="line"> gboolean *shutdown_available,</td></tr> +<tr class="codeline" data-linenumber="3664"><td class="num" id="LN3664">3664</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="3665"><td class="num" id="LN3665">3665</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3666"><td class="num" id="LN3666">3666</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="3667"><td class="num" id="LN3667">3667</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3668"><td class="num" id="LN3668">3668</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="3669"><td class="num" id="LN3669">3669</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3670"><td class="num" id="LN3670">3670</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: CanShutdown called"</span>);</td></tr> +<tr class="codeline" data-linenumber="3671"><td class="num" id="LN3671">3671</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3672"><td class="num" id="LN3672">3672</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3673"><td class="num" id="LN3673">3673</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3674"><td class="num" id="LN3674">3674</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3675"><td class="num" id="LN3675">3675</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3676"><td class="num" id="LN3676">3676</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="3677"><td class="num" id="LN3677">3677</td><td class="line"> *shutdown_available = gsm_systemd_can_stop (systemd)</td></tr> +<tr class="codeline" data-linenumber="3678"><td class="num" id="LN3678">3678</td><td class="line"> || gsm_systemd_can_restart (systemd)</td></tr> +<tr class="codeline" data-linenumber="3679"><td class="num" id="LN3679">3679</td><td class="line"> || gsm_systemd_can_suspend (systemd)</td></tr> +<tr class="codeline" data-linenumber="3680"><td class="num" id="LN3680">3680</td><td class="line"> || gsm_systemd_can_hibernate (systemd);</td></tr> +<tr class="codeline" data-linenumber="3681"><td class="num" id="LN3681">3681</td><td class="line"> g_object_unref (systemd);</td></tr> +<tr class="codeline" data-linenumber="3682"><td class="num" id="LN3682">3682</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3683"><td class="num" id="LN3683">3683</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3684"><td class="num" id="LN3684">3684</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3685"><td class="num" id="LN3685">3685</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="3686"><td class="num" id="LN3686">3686</td><td class="line"> *shutdown_available = !_log_out_is_locked_down (manager) &&</td></tr> +<tr class="codeline" data-linenumber="3687"><td class="num" id="LN3687">3687</td><td class="line"> (gsm_consolekit_can_stop (consolekit)</td></tr> +<tr class="codeline" data-linenumber="3688"><td class="num" id="LN3688">3688</td><td class="line"> || gsm_consolekit_can_restart (consolekit)</td></tr> +<tr class="codeline" data-linenumber="3689"><td class="num" id="LN3689">3689</td><td class="line"> || gsm_consolekit_can_suspend (consolekit)</td></tr> +<tr class="codeline" data-linenumber="3690"><td class="num" id="LN3690">3690</td><td class="line"> || gsm_consolekit_can_hibernate (consolekit));</td></tr> +<tr class="codeline" data-linenumber="3691"><td class="num" id="LN3691">3691</td><td class="line"> g_object_unref (consolekit);</td></tr> +<tr class="codeline" data-linenumber="3692"><td class="num" id="LN3692">3692</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3693"><td class="num" id="LN3693">3693</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3694"><td class="num" id="LN3694">3694</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3695"><td class="num" id="LN3695">3695</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3696"><td class="num" id="LN3696">3696</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3697"><td class="num" id="LN3697">3697</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3698"><td class="num" id="LN3698">3698</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3699"><td class="num" id="LN3699">3699</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3700"><td class="num" id="LN3700">3700</td><td class="line">gsm_manager_logout (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3701"><td class="num" id="LN3701">3701</td><td class="line"> guint logout_mode,</td></tr> +<tr class="codeline" data-linenumber="3702"><td class="num" id="LN3702">3702</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="3703"><td class="num" id="LN3703">3703</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3704"><td class="num" id="LN3704">3704</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3705"><td class="num" id="LN3705">3705</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Logout called"</span>);</td></tr> +<tr class="codeline" data-linenumber="3706"><td class="num" id="LN3706">3706</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3707"><td class="num" id="LN3707">3707</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3708"><td class="num" id="LN3708">3708</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3709"><td class="num" id="LN3709">3709</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3710"><td class="num" id="LN3710">3710</td><td class="line"> <span class='keyword'>if</span> (priv->phase != GSM_MANAGER_PHASE_RUNNING) {</td></tr> +<tr class="codeline" data-linenumber="3711"><td class="num" id="LN3711">3711</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="3712"><td class="num" id="LN3712">3712</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3713"><td class="num" id="LN3713">3713</td><td class="line"> GSM_MANAGER_ERROR_NOT_IN_RUNNING,</td></tr> +<tr class="codeline" data-linenumber="3714"><td class="num" id="LN3714">3714</td><td class="line"> <span class='string_literal'>"Shutdown interface is only available during the Running phase"</span>);</td></tr> +<tr class="codeline" data-linenumber="3715"><td class="num" id="LN3715">3715</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3716"><td class="num" id="LN3716">3716</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3717"><td class="num" id="LN3717">3717</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3718"><td class="num" id="LN3718">3718</td><td class="line"> <span class='keyword'>if</span> (_log_out_is_locked_down (manager)) {</td></tr> +<tr class="codeline" data-linenumber="3719"><td class="num" id="LN3719">3719</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="3720"><td class="num" id="LN3720">3720</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3721"><td class="num" id="LN3721">3721</td><td class="line"> GSM_MANAGER_ERROR_LOCKED_DOWN,</td></tr> +<tr class="codeline" data-linenumber="3722"><td class="num" id="LN3722">3722</td><td class="line"> <span class='string_literal'>"Logout has been locked down"</span>);</td></tr> +<tr class="codeline" data-linenumber="3723"><td class="num" id="LN3723">3723</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3724"><td class="num" id="LN3724">3724</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3725"><td class="num" id="LN3725">3725</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3726"><td class="num" id="LN3726">3726</td><td class="line"> <span class='keyword'>switch</span> (logout_mode) {</td></tr> +<tr class="codeline" data-linenumber="3727"><td class="num" id="LN3727">3727</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_MODE_NORMAL:</td></tr> +<tr class="codeline" data-linenumber="3728"><td class="num" id="LN3728">3728</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_MODE_NO_CONFIRMATION:</td></tr> +<tr class="codeline" data-linenumber="3729"><td class="num" id="LN3729">3729</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_MODE_FORCE:</td></tr> +<tr class="codeline" data-linenumber="3730"><td class="num" id="LN3730">3730</td><td class="line"> user_logout (manager, logout_mode);</td></tr> +<tr class="codeline" data-linenumber="3731"><td class="num" id="LN3731">3731</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3732"><td class="num" id="LN3732">3732</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3733"><td class="num" id="LN3733">3733</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="3734"><td class="num" id="LN3734">3734</td><td class="line"> g_debug (<span class='string_literal'>"Unknown logout mode option"</span>);</td></tr> +<tr class="codeline" data-linenumber="3735"><td class="num" id="LN3735">3735</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3736"><td class="num" id="LN3736">3736</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="3737"><td class="num" id="LN3737">3737</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3738"><td class="num" id="LN3738">3738</td><td class="line"> GSM_MANAGER_ERROR_INVALID_OPTION,</td></tr> +<tr class="codeline" data-linenumber="3739"><td class="num" id="LN3739">3739</td><td class="line"> <span class='string_literal'>"Unknown logout mode flag"</span>);</td></tr> +<tr class="codeline" data-linenumber="3740"><td class="num" id="LN3740">3740</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3741"><td class="num" id="LN3741">3741</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3742"><td class="num" id="LN3742">3742</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3743"><td class="num" id="LN3743">3743</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3744"><td class="num" id="LN3744">3744</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3745"><td class="num" id="LN3745">3745</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3746"><td class="num" id="LN3746">3746</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3747"><td class="num" id="LN3747">3747</td><td class="line">gsm_manager_register_client (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3748"><td class="num" id="LN3748">3748</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *app_id,</td></tr> +<tr class="codeline" data-linenumber="3749"><td class="num" id="LN3749">3749</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id,</td></tr> +<tr class="codeline" data-linenumber="3750"><td class="num" id="LN3750">3750</td><td class="line"> DBusGMethodInvocation *context)</td></tr> +<tr class="codeline" data-linenumber="3751"><td class="num" id="LN3751">3751</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3752"><td class="num" id="LN3752">3752</td><td class="line"> <span class='keyword'>char</span> *new_startup_id;</td></tr> +<tr class="codeline" data-linenumber="3753"><td class="num" id="LN3753">3753</td><td class="line"> <span class='keyword'>char</span> *sender;</td></tr> +<tr class="codeline" data-linenumber="3754"><td class="num" id="LN3754">3754</td><td class="line"> GsmClient *client;</td></tr> +<tr class="codeline" data-linenumber="3755"><td class="num" id="LN3755">3755</td><td class="line"> GsmApp *app;</td></tr> +<tr class="codeline" data-linenumber="3756"><td class="num" id="LN3756">3756</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3757"><td class="num" id="LN3757">3757</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3758"><td class="num" id="LN3758">3758</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3759"><td class="num" id="LN3759">3759</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3760"><td class="num" id="LN3760">3760</td><td class="line"> app = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3761"><td class="num" id="LN3761">3761</td><td class="line"> client = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3762"><td class="num" id="LN3762">3762</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3763"><td class="num" id="LN3763">3763</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: RegisterClient %s"</span>, startup_id);</td></tr> +<tr class="codeline" data-linenumber="3764"><td class="num" id="LN3764">3764</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3765"><td class="num" id="LN3765">3765</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3766"><td class="num" id="LN3766">3766</td><td class="line"> <span class='keyword'>if</span> (priv->phase >= GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="3767"><td class="num" id="LN3767">3767</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3768"><td class="num" id="LN3768">3768</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3769"><td class="num" id="LN3769">3769</td><td class="line"> g_debug (<span class='string_literal'>"Unable to register client: shutting down"</span>);</td></tr> +<tr class="codeline" data-linenumber="3770"><td class="num" id="LN3770">3770</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3771"><td class="num" id="LN3771">3771</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3772"><td class="num" id="LN3772">3772</td><td class="line"> GSM_MANAGER_ERROR_NOT_IN_RUNNING,</td></tr> +<tr class="codeline" data-linenumber="3773"><td class="num" id="LN3773">3773</td><td class="line"> <span class='string_literal'>"Unable to register client"</span>);</td></tr> +<tr class="codeline" data-linenumber="3774"><td class="num" id="LN3774">3774</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3775"><td class="num" id="LN3775">3775</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3776"><td class="num" id="LN3776">3776</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3777"><td class="num" id="LN3777">3777</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3778"><td class="num" id="LN3778">3778</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3779"><td class="num" id="LN3779">3779</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (startup_id)<span class='macro_popup'>((startup_id)==((void*)0)||(startup_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3780"><td class="num" id="LN3780">3780</td><td class="line"> new_startup_id = gsm_util_generate_startup_id ();</td></tr> +<tr class="codeline" data-linenumber="3781"><td class="num" id="LN3781">3781</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3782"><td class="num" id="LN3782">3782</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3783"><td class="num" id="LN3783">3783</td><td class="line"> client = (GsmClient *)gsm_store_find (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="3784"><td class="num" id="LN3784">3784</td><td class="line"> (GsmStoreFunc)_client_has_startup_id,</td></tr> +<tr class="codeline" data-linenumber="3785"><td class="num" id="LN3785">3785</td><td class="line"> (<span class='keyword'>char</span> *)startup_id);</td></tr> +<tr class="codeline" data-linenumber="3786"><td class="num" id="LN3786">3786</td><td class="line"> <span class='comment'>/* We can't have two clients with the same startup id. */</span></td></tr> +<tr class="codeline" data-linenumber="3787"><td class="num" id="LN3787">3787</td><td class="line"> <span class='keyword'>if</span> (client != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3788"><td class="num" id="LN3788">3788</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3789"><td class="num" id="LN3789">3789</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3790"><td class="num" id="LN3790">3790</td><td class="line"> g_debug (<span class='string_literal'>"Unable to register client: already registered"</span>);</td></tr> +<tr class="codeline" data-linenumber="3791"><td class="num" id="LN3791">3791</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3792"><td class="num" id="LN3792">3792</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3793"><td class="num" id="LN3793">3793</td><td class="line"> GSM_MANAGER_ERROR_ALREADY_REGISTERED,</td></tr> +<tr class="codeline" data-linenumber="3794"><td class="num" id="LN3794">3794</td><td class="line"> <span class='string_literal'>"Unable to register client"</span>);</td></tr> +<tr class="codeline" data-linenumber="3795"><td class="num" id="LN3795">3795</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3796"><td class="num" id="LN3796">3796</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3797"><td class="num" id="LN3797">3797</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3798"><td class="num" id="LN3798">3798</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3799"><td class="num" id="LN3799">3799</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3800"><td class="num" id="LN3800">3800</td><td class="line"> new_startup_id = <span class='macro'>g_strdup (startup_id)<span class='macro_popup'>g_strdup_inline (startup_id)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3801"><td class="num" id="LN3801">3801</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3802"><td class="num" id="LN3802">3802</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3803"><td class="num" id="LN3803">3803</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Adding new client %s to session"</span>, new_startup_id);</td></tr> +<tr class="codeline" data-linenumber="3804"><td class="num" id="LN3804">3804</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3805"><td class="num" id="LN3805">3805</td><td class="line"> <span class='keyword'>if</span> (app == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> && !<span class='macro'>IS_STRING_EMPTY (startup_id)<span class='macro_popup'>((startup_id)==((void*)0)||(startup_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3806"><td class="num" id="LN3806">3806</td><td class="line"> app = find_app_for_startup_id (manager, startup_id);</td></tr> +<tr class="codeline" data-linenumber="3807"><td class="num" id="LN3807">3807</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3808"><td class="num" id="LN3808">3808</td><td class="line"> <span class='keyword'>if</span> (app == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> && !<span class='macro'>IS_STRING_EMPTY (app_id)<span class='macro_popup'>((app_id)==((void*)0)||(app_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3809"><td class="num" id="LN3809">3809</td><td class="line"> <span class='comment'>/* try to associate this app id with a known app */</span></td></tr> +<tr class="codeline" data-linenumber="3810"><td class="num" id="LN3810">3810</td><td class="line"> app = find_app_for_app_id (manager, app_id);</td></tr> +<tr class="codeline" data-linenumber="3811"><td class="num" id="LN3811">3811</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3812"><td class="num" id="LN3812">3812</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3813"><td class="num" id="LN3813">3813</td><td class="line"> sender = dbus_g_method_get_sender (context);</td></tr> +<tr class="codeline" data-linenumber="3814"><td class="num" id="LN3814">3814</td><td class="line"> client = gsm_dbus_client_new (new_startup_id, sender);</td></tr> +<tr class="codeline" data-linenumber="3815"><td class="num" id="LN3815">3815</td><td class="line"> g_free (sender);</td></tr> +<tr class="codeline" data-linenumber="3816"><td class="num" id="LN3816">3816</td><td class="line"> <span class='keyword'>if</span> (client == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3817"><td class="num" id="LN3817">3817</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3818"><td class="num" id="LN3818">3818</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3819"><td class="num" id="LN3819">3819</td><td class="line"> g_debug (<span class='string_literal'>"Unable to create client"</span>);</td></tr> +<tr class="codeline" data-linenumber="3820"><td class="num" id="LN3820">3820</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3821"><td class="num" id="LN3821">3821</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3822"><td class="num" id="LN3822">3822</td><td class="line"> GSM_MANAGER_ERROR_GENERAL,</td></tr> +<tr class="codeline" data-linenumber="3823"><td class="num" id="LN3823">3823</td><td class="line"> <span class='string_literal'>"Unable to register client"</span>);</td></tr> +<tr class="codeline" data-linenumber="3824"><td class="num" id="LN3824">3824</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3825"><td class="num" id="LN3825">3825</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3826"><td class="num" id="LN3826">3826</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3827"><td class="num" id="LN3827">3827</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3828"><td class="num" id="LN3828">3828</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3829"><td class="num" id="LN3829">3829</td><td class="line"> gsm_store_add (priv->clients, gsm_client_peek_id (client), <span class='macro'>G_OBJECT (client)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((client)), (((GType) ((20) << (2))))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3830"><td class="num" id="LN3830">3830</td><td class="line"> <span class='comment'>/* the store will own the ref */</span></td></tr> +<tr class="codeline" data-linenumber="3831"><td class="num" id="LN3831">3831</td><td class="line"> g_object_unref (client);</td></tr> +<tr class="codeline" data-linenumber="3832"><td class="num" id="LN3832">3832</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3833"><td class="num" id="LN3833">3833</td><td class="line"> <span class='keyword'>if</span> (app != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3834"><td class="num" id="LN3834">3834</td><td class="line"> gsm_client_set_app_id (client, gsm_app_peek_app_id (app));</td></tr> +<tr class="codeline" data-linenumber="3835"><td class="num" id="LN3835">3835</td><td class="line"> gsm_app_registered (app);</td></tr> +<tr class="codeline" data-linenumber="3836"><td class="num" id="LN3836">3836</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3837"><td class="num" id="LN3837">3837</td><td class="line"> <span class='comment'>/* if an app id is specified store it in the client</span></td></tr> +<tr class="codeline" data-linenumber="3838"><td class="num" id="LN3838">3838</td><td class="line"> <span class='comment'>so we can save it later */</span></td></tr> +<tr class="codeline" data-linenumber="3839"><td class="num" id="LN3839">3839</td><td class="line"> gsm_client_set_app_id (client, app_id);</td></tr> +<tr class="codeline" data-linenumber="3840"><td class="num" id="LN3840">3840</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3841"><td class="num" id="LN3841">3841</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3842"><td class="num" id="LN3842">3842</td><td class="line"> gsm_client_set_status (client, GSM_CLIENT_REGISTERED);</td></tr> +<tr class="codeline" data-linenumber="3843"><td class="num" id="LN3843">3843</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3844"><td class="num" id="LN3844">3844</td><td class="line"> <span class='macro'>g_assert (new_startup_id != NULL)<span class='macro_popup'>do { if (new_startup_id != ((void*)0)) ; else g_assertion_message_expr<br> (((gchar*) 0), "gsm-manager.c", 3844, ((const char*) (__func__<br>)), "new_startup_id != NULL"); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3845"><td class="num" id="LN3845">3845</td><td class="line"> g_free (new_startup_id);</td></tr> +<tr class="codeline" data-linenumber="3846"><td class="num" id="LN3846">3846</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3847"><td class="num" id="LN3847">3847</td><td class="line"> dbus_g_method_return (context, gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="3848"><td class="num" id="LN3848">3848</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3849"><td class="num" id="LN3849">3849</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3850"><td class="num" id="LN3850">3850</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3851"><td class="num" id="LN3851">3851</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3852"><td class="num" id="LN3852">3852</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3853"><td class="num" id="LN3853">3853</td><td class="line">gsm_manager_unregister_client (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3854"><td class="num" id="LN3854">3854</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *client_id,</td></tr> +<tr class="codeline" data-linenumber="3855"><td class="num" id="LN3855">3855</td><td class="line"> DBusGMethodInvocation *context)</td></tr> +<tr class="codeline" data-linenumber="3856"><td class="num" id="LN3856">3856</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3857"><td class="num" id="LN3857">3857</td><td class="line"> GsmClient *client;</td></tr> +<tr class="codeline" data-linenumber="3858"><td class="num" id="LN3858">3858</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3859"><td class="num" id="LN3859">3859</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3860"><td class="num" id="LN3860">3860</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3861"><td class="num" id="LN3861">3861</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3862"><td class="num" id="LN3862">3862</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: UnregisterClient %s"</span>, client_id);</td></tr> +<tr class="codeline" data-linenumber="3863"><td class="num" id="LN3863">3863</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3864"><td class="num" id="LN3864">3864</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3865"><td class="num" id="LN3865">3865</td><td class="line"> client = (GsmClient *)gsm_store_lookup (priv->clients, client_id);</td></tr> +<tr class="codeline" data-linenumber="3866"><td class="num" id="LN3866">3866</td><td class="line"> <span class='keyword'>if</span> (client == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3867"><td class="num" id="LN3867">3867</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3868"><td class="num" id="LN3868">3868</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3869"><td class="num" id="LN3869">3869</td><td class="line"> g_debug (<span class='string_literal'>"Unable to unregister client: not registered"</span>);</td></tr> +<tr class="codeline" data-linenumber="3870"><td class="num" id="LN3870">3870</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3871"><td class="num" id="LN3871">3871</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3872"><td class="num" id="LN3872">3872</td><td class="line"> GSM_MANAGER_ERROR_NOT_REGISTERED,</td></tr> +<tr class="codeline" data-linenumber="3873"><td class="num" id="LN3873">3873</td><td class="line"> <span class='string_literal'>"Unable to unregister client"</span>);</td></tr> +<tr class="codeline" data-linenumber="3874"><td class="num" id="LN3874">3874</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3875"><td class="num" id="LN3875">3875</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3876"><td class="num" id="LN3876">3876</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3877"><td class="num" id="LN3877">3877</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3878"><td class="num" id="LN3878">3878</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3879"><td class="num" id="LN3879">3879</td><td class="line"> <span class='comment'>/* don't disconnect client here, only change the status.</span></td></tr> +<tr class="codeline" data-linenumber="3880"><td class="num" id="LN3880">3880</td><td class="line"> <span class='comment'>Wait until it leaves the bus before disconnecting it */</span></td></tr> +<tr class="codeline" data-linenumber="3881"><td class="num" id="LN3881">3881</td><td class="line"> gsm_client_set_status (client, GSM_CLIENT_UNREGISTERED);</td></tr> +<tr class="codeline" data-linenumber="3882"><td class="num" id="LN3882">3882</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3883"><td class="num" id="LN3883">3883</td><td class="line"> dbus_g_method_return (context);</td></tr> +<tr class="codeline" data-linenumber="3884"><td class="num" id="LN3884">3884</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3885"><td class="num" id="LN3885">3885</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3886"><td class="num" id="LN3886">3886</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3887"><td class="num" id="LN3887">3887</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3888"><td class="num" id="LN3888">3888</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3889"><td class="num" id="LN3889">3889</td><td class="line">gsm_manager_inhibit (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3890"><td class="num" id="LN3890">3890</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *app_id,</td></tr> +<tr class="codeline" data-linenumber="3891"><td class="num" id="LN3891">3891</td><td class="line"> guint toplevel_xid,</td></tr> +<tr class="codeline" data-linenumber="3892"><td class="num" id="LN3892">3892</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *reason,</td></tr> +<tr class="codeline" data-linenumber="3893"><td class="num" id="LN3893">3893</td><td class="line"> guint flags,</td></tr> +<tr class="codeline" data-linenumber="3894"><td class="num" id="LN3894">3894</td><td class="line"> DBusGMethodInvocation *context)</td></tr> +<tr class="codeline" data-linenumber="3895"><td class="num" id="LN3895">3895</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3896"><td class="num" id="LN3896">3896</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="3897"><td class="num" id="LN3897">3897</td><td class="line"> guint cookie;</td></tr> +<tr class="codeline" data-linenumber="3898"><td class="num" id="LN3898">3898</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3899"><td class="num" id="LN3899">3899</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3900"><td class="num" id="LN3900">3900</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3901"><td class="num" id="LN3901">3901</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3902"><td class="num" id="LN3902">3902</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Inhibit xid=%u app_id=%s reason=%s flags=%u"</span>,</td></tr> +<tr class="codeline" data-linenumber="3903"><td class="num" id="LN3903">3903</td><td class="line"> toplevel_xid,</td></tr> +<tr class="codeline" data-linenumber="3904"><td class="num" id="LN3904">3904</td><td class="line"> app_id,</td></tr> +<tr class="codeline" data-linenumber="3905"><td class="num" id="LN3905">3905</td><td class="line"> reason,</td></tr> +<tr class="codeline" data-linenumber="3906"><td class="num" id="LN3906">3906</td><td class="line"> flags);</td></tr> +<tr class="codeline" data-linenumber="3907"><td class="num" id="LN3907">3907</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3908"><td class="num" id="LN3908">3908</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3909"><td class="num" id="LN3909">3909</td><td class="line"> <span class='keyword'>if</span> (priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_FORCE) {</td></tr> +<tr class="codeline" data-linenumber="3910"><td class="num" id="LN3910">3910</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3911"><td class="num" id="LN3911">3911</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3912"><td class="num" id="LN3912">3912</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3913"><td class="num" id="LN3913">3913</td><td class="line"> GSM_MANAGER_ERROR_GENERAL,</td></tr> +<tr class="codeline" data-linenumber="3914"><td class="num" id="LN3914">3914</td><td class="line"> <span class='string_literal'>"Forced logout cannot be inhibited"</span>);</td></tr> +<tr class="codeline" data-linenumber="3915"><td class="num" id="LN3915">3915</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Unable to inhibit: %s"</span>, new_error->message);</td></tr> +<tr class="codeline" data-linenumber="3916"><td class="num" id="LN3916">3916</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3917"><td class="num" id="LN3917">3917</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3918"><td class="num" id="LN3918">3918</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3919"><td class="num" id="LN3919">3919</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3920"><td class="num" id="LN3920">3920</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3921"><td class="num" id="LN3921">3921</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (app_id)<span class='macro_popup'>((app_id)==((void*)0)||(app_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3922"><td class="num" id="LN3922">3922</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3923"><td class="num" id="LN3923">3923</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3924"><td class="num" id="LN3924">3924</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3925"><td class="num" id="LN3925">3925</td><td class="line"> GSM_MANAGER_ERROR_GENERAL,</td></tr> +<tr class="codeline" data-linenumber="3926"><td class="num" id="LN3926">3926</td><td class="line"> <span class='string_literal'>"Application ID not specified"</span>);</td></tr> +<tr class="codeline" data-linenumber="3927"><td class="num" id="LN3927">3927</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Unable to inhibit: %s"</span>, new_error->message);</td></tr> +<tr class="codeline" data-linenumber="3928"><td class="num" id="LN3928">3928</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3929"><td class="num" id="LN3929">3929</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3930"><td class="num" id="LN3930">3930</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3931"><td class="num" id="LN3931">3931</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3932"><td class="num" id="LN3932">3932</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3933"><td class="num" id="LN3933">3933</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (reason)<span class='macro_popup'>((reason)==((void*)0)||(reason)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3934"><td class="num" id="LN3934">3934</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3935"><td class="num" id="LN3935">3935</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3936"><td class="num" id="LN3936">3936</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3937"><td class="num" id="LN3937">3937</td><td class="line"> GSM_MANAGER_ERROR_GENERAL,</td></tr> +<tr class="codeline" data-linenumber="3938"><td class="num" id="LN3938">3938</td><td class="line"> <span class='string_literal'>"Reason not specified"</span>);</td></tr> +<tr class="codeline" data-linenumber="3939"><td class="num" id="LN3939">3939</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Unable to inhibit: %s"</span>, new_error->message);</td></tr> +<tr class="codeline" data-linenumber="3940"><td class="num" id="LN3940">3940</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3941"><td class="num" id="LN3941">3941</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3942"><td class="num" id="LN3942">3942</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3943"><td class="num" id="LN3943">3943</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3944"><td class="num" id="LN3944">3944</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3945"><td class="num" id="LN3945">3945</td><td class="line"> <span class='keyword'>if</span> (flags == 0) {</td></tr> +<tr class="codeline" data-linenumber="3946"><td class="num" id="LN3946">3946</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3947"><td class="num" id="LN3947">3947</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3948"><td class="num" id="LN3948">3948</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3949"><td class="num" id="LN3949">3949</td><td class="line"> GSM_MANAGER_ERROR_GENERAL,</td></tr> +<tr class="codeline" data-linenumber="3950"><td class="num" id="LN3950">3950</td><td class="line"> <span class='string_literal'>"Invalid inhibit flags"</span>);</td></tr> +<tr class="codeline" data-linenumber="3951"><td class="num" id="LN3951">3951</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Unable to inhibit: %s"</span>, new_error->message);</td></tr> +<tr class="codeline" data-linenumber="3952"><td class="num" id="LN3952">3952</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3953"><td class="num" id="LN3953">3953</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3954"><td class="num" id="LN3954">3954</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3955"><td class="num" id="LN3955">3955</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3956"><td class="num" id="LN3956">3956</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3957"><td class="num" id="LN3957">3957</td><td class="line"> cookie = _generate_unique_cookie (manager);</td></tr> +<tr class="codeline" data-linenumber="3958"><td class="num" id="LN3958">3958</td><td class="line"> inhibitor = gsm_inhibitor_new (app_id,</td></tr> +<tr class="codeline" data-linenumber="3959"><td class="num" id="LN3959">3959</td><td class="line"> toplevel_xid,</td></tr> +<tr class="codeline" data-linenumber="3960"><td class="num" id="LN3960">3960</td><td class="line"> flags,</td></tr> +<tr class="codeline" data-linenumber="3961"><td class="num" id="LN3961">3961</td><td class="line"> reason,</td></tr> +<tr class="codeline" data-linenumber="3962"><td class="num" id="LN3962">3962</td><td class="line"> dbus_g_method_get_sender (context),</td></tr> +<tr class="codeline" data-linenumber="3963"><td class="num" id="LN3963">3963</td><td class="line"> cookie);</td></tr> +<tr class="codeline" data-linenumber="3964"><td class="num" id="LN3964">3964</td><td class="line"> gsm_store_add (priv->inhibitors, gsm_inhibitor_peek_id (inhibitor), <span class='macro'>G_OBJECT (inhibitor)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((inhibitor)), (((GType) ((20) << (2))))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3965"><td class="num" id="LN3965">3965</td><td class="line"> g_object_unref (inhibitor);</td></tr> +<tr class="codeline" data-linenumber="3966"><td class="num" id="LN3966">3966</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3967"><td class="num" id="LN3967">3967</td><td class="line"> dbus_g_method_return (context, cookie);</td></tr> +<tr class="codeline" data-linenumber="3968"><td class="num" id="LN3968">3968</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3969"><td class="num" id="LN3969">3969</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3970"><td class="num" id="LN3970">3970</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3971"><td class="num" id="LN3971">3971</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3972"><td class="num" id="LN3972">3972</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3973"><td class="num" id="LN3973">3973</td><td class="line">gsm_manager_uninhibit (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3974"><td class="num" id="LN3974">3974</td><td class="line"> guint cookie,</td></tr> +<tr class="codeline" data-linenumber="3975"><td class="num" id="LN3975">3975</td><td class="line"> DBusGMethodInvocation *context)</td></tr> +<tr class="codeline" data-linenumber="3976"><td class="num" id="LN3976">3976</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3977"><td class="num" id="LN3977">3977</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="3978"><td class="num" id="LN3978">3978</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3979"><td class="num" id="LN3979">3979</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3980"><td class="num" id="LN3980">3980</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3981"><td class="num" id="LN3981">3981</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3982"><td class="num" id="LN3982">3982</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Uninhibit %u"</span>, cookie);</td></tr> +<tr class="codeline" data-linenumber="3983"><td class="num" id="LN3983">3983</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3984"><td class="num" id="LN3984">3984</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3985"><td class="num" id="LN3985">3985</td><td class="line"> inhibitor = (GsmInhibitor *)gsm_store_find (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="3986"><td class="num" id="LN3986">3986</td><td class="line"> (GsmStoreFunc)_find_by_cookie,</td></tr> +<tr class="codeline" data-linenumber="3987"><td class="num" id="LN3987">3987</td><td class="line"> &cookie);</td></tr> +<tr class="codeline" data-linenumber="3988"><td class="num" id="LN3988">3988</td><td class="line"> <span class='keyword'>if</span> (inhibitor == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3989"><td class="num" id="LN3989">3989</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3990"><td class="num" id="LN3990">3990</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3991"><td class="num" id="LN3991">3991</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3992"><td class="num" id="LN3992">3992</td><td class="line"> GSM_MANAGER_ERROR_GENERAL,</td></tr> +<tr class="codeline" data-linenumber="3993"><td class="num" id="LN3993">3993</td><td class="line"> <span class='string_literal'>"Unable to uninhibit: Invalid cookie"</span>);</td></tr> +<tr class="codeline" data-linenumber="3994"><td class="num" id="LN3994">3994</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3995"><td class="num" id="LN3995">3995</td><td class="line"> g_debug (<span class='string_literal'>"Unable to uninhibit: %s"</span>, new_error->message);</td></tr> +<tr class="codeline" data-linenumber="3996"><td class="num" id="LN3996">3996</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3997"><td class="num" id="LN3997">3997</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3998"><td class="num" id="LN3998">3998</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3999"><td class="num" id="LN3999">3999</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4000"><td class="num" id="LN4000">4000</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: removing inhibitor %s %u reason '%s' %u connection %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="4001"><td class="num" id="LN4001">4001</td><td class="line"> gsm_inhibitor_peek_app_id (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="4002"><td class="num" id="LN4002">4002</td><td class="line"> gsm_inhibitor_peek_toplevel_xid (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="4003"><td class="num" id="LN4003">4003</td><td class="line"> gsm_inhibitor_peek_reason (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="4004"><td class="num" id="LN4004">4004</td><td class="line"> gsm_inhibitor_peek_flags (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="4005"><td class="num" id="LN4005">4005</td><td class="line"> gsm_inhibitor_peek_bus_name (inhibitor));</td></tr> +<tr class="codeline" data-linenumber="4006"><td class="num" id="LN4006">4006</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4007"><td class="num" id="LN4007">4007</td><td class="line"> gsm_store_remove (priv->inhibitors, gsm_inhibitor_peek_id (inhibitor));</td></tr> +<tr class="codeline" data-linenumber="4008"><td class="num" id="LN4008">4008</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4009"><td class="num" id="LN4009">4009</td><td class="line"> dbus_g_method_return (context);</td></tr> +<tr class="codeline" data-linenumber="4010"><td class="num" id="LN4010">4010</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4011"><td class="num" id="LN4011">4011</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4012"><td class="num" id="LN4012">4012</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4013"><td class="num" id="LN4013">4013</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4014"><td class="num" id="LN4014">4014</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="4015"><td class="num" id="LN4015">4015</td><td class="line">gsm_manager_is_inhibited (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="4016"><td class="num" id="LN4016">4016</td><td class="line"> guint flags,</td></tr> +<tr class="codeline" data-linenumber="4017"><td class="num" id="LN4017">4017</td><td class="line"> gboolean *is_inhibited,</td></tr> +<tr class="codeline" data-linenumber="4018"><td class="num" id="LN4018">4018</td><td class="line"> GError *error)</td></tr> +<tr class="codeline" data-linenumber="4019"><td class="num" id="LN4019">4019</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4020"><td class="num" id="LN4020">4020</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="4021"><td class="num" id="LN4021">4021</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="4022"><td class="num" id="LN4022">4022</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4023"><td class="num" id="LN4023">4023</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4024"><td class="num" id="LN4024">4024</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4025"><td class="num" id="LN4025">4025</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="4026"><td class="num" id="LN4026">4026</td><td class="line"> <span class='keyword'>if</span> (priv->inhibitors == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span></td></tr> +<tr class="codeline" data-linenumber="4027"><td class="num" id="LN4027">4027</td><td class="line"> || gsm_store_size (priv->inhibitors) == 0) {</td></tr> +<tr class="codeline" data-linenumber="4028"><td class="num" id="LN4028">4028</td><td class="line"> *is_inhibited = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4029"><td class="num" id="LN4029">4029</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4030"><td class="num" id="LN4030">4030</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4031"><td class="num" id="LN4031">4031</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4032"><td class="num" id="LN4032">4032</td><td class="line"> inhibitor = (GsmInhibitor *) gsm_store_find (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="4033"><td class="num" id="LN4033">4033</td><td class="line"> (GsmStoreFunc)inhibitor_has_flag,</td></tr> +<tr class="codeline" data-linenumber="4034"><td class="num" id="LN4034">4034</td><td class="line"> <span class='macro'>GUINT_TO_POINTER (flags)<span class='macro_popup'>((gpointer) (gulong) (flags))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="4035"><td class="num" id="LN4035">4035</td><td class="line"> <span class='keyword'>if</span> (inhibitor == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4036"><td class="num" id="LN4036">4036</td><td class="line"> *is_inhibited = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4037"><td class="num" id="LN4037">4037</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="4038"><td class="num" id="LN4038">4038</td><td class="line"> *is_inhibited = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4039"><td class="num" id="LN4039">4039</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4040"><td class="num" id="LN4040">4040</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4041"><td class="num" id="LN4041">4041</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4042"><td class="num" id="LN4042">4042</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4043"><td class="num" id="LN4043">4043</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4044"><td class="num" id="LN4044">4044</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4045"><td class="num" id="LN4045">4045</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="4046"><td class="num" id="LN4046">4046</td><td class="line">listify_store_ids (<span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="4047"><td class="num" id="LN4047">4047</td><td class="line"> GObject *object,</td></tr> +<tr class="codeline" data-linenumber="4048"><td class="num" id="LN4048">4048</td><td class="line"> GPtrArray **array)</td></tr> +<tr class="codeline" data-linenumber="4049"><td class="num" id="LN4049">4049</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4050"><td class="num" id="LN4050">4050</td><td class="line"> g_ptr_array_add (*array, <span class='macro'>g_strdup (id)<span class='macro_popup'>g_strdup_inline (id)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="4051"><td class="num" id="LN4051">4051</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4052"><td class="num" id="LN4052">4052</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4053"><td class="num" id="LN4053">4053</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4054"><td class="num" id="LN4054">4054</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="4055"><td class="num" id="LN4055">4055</td><td class="line">gsm_manager_get_clients (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="4056"><td class="num" id="LN4056">4056</td><td class="line"> GPtrArray **clients,</td></tr> +<tr class="codeline" data-linenumber="4057"><td class="num" id="LN4057">4057</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="4058"><td class="num" id="LN4058">4058</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4059"><td class="num" id="LN4059">4059</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="4060"><td class="num" id="LN4060">4060</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4061"><td class="num" id="LN4061">4061</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4062"><td class="num" id="LN4062">4062</td><td class="line"> <span class='keyword'>if</span> (clients == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4063"><td class="num" id="LN4063">4063</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4064"><td class="num" id="LN4064">4064</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4065"><td class="num" id="LN4065">4065</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4066"><td class="num" id="LN4066">4066</td><td class="line"> *clients = g_ptr_array_new ();</td></tr> +<tr class="codeline" data-linenumber="4067"><td class="num" id="LN4067">4067</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="4068"><td class="num" id="LN4068">4068</td><td class="line"> gsm_store_foreach (priv->clients, (GsmStoreFunc)listify_store_ids, clients);</td></tr> +<tr class="codeline" data-linenumber="4069"><td class="num" id="LN4069">4069</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4070"><td class="num" id="LN4070">4070</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4071"><td class="num" id="LN4071">4071</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4072"><td class="num" id="LN4072">4072</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4073"><td class="num" id="LN4073">4073</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="4074"><td class="num" id="LN4074">4074</td><td class="line">gsm_manager_get_inhibitors (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="4075"><td class="num" id="LN4075">4075</td><td class="line"> GPtrArray **inhibitors,</td></tr> +<tr class="codeline" data-linenumber="4076"><td class="num" id="LN4076">4076</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="4077"><td class="num" id="LN4077">4077</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4078"><td class="num" id="LN4078">4078</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="4079"><td class="num" id="LN4079">4079</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4080"><td class="num" id="LN4080">4080</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4081"><td class="num" id="LN4081">4081</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4082"><td class="num" id="LN4082">4082</td><td class="line"> <span class='keyword'>if</span> (inhibitors == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4083"><td class="num" id="LN4083">4083</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4084"><td class="num" id="LN4084">4084</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4085"><td class="num" id="LN4085">4085</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4086"><td class="num" id="LN4086">4086</td><td class="line"> *inhibitors = g_ptr_array_new ();</td></tr> +<tr class="codeline" data-linenumber="4087"><td class="num" id="LN4087">4087</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="4088"><td class="num" id="LN4088">4088</td><td class="line"> gsm_store_foreach (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="4089"><td class="num" id="LN4089">4089</td><td class="line"> (GsmStoreFunc) listify_store_ids,</td></tr> +<tr class="codeline" data-linenumber="4090"><td class="num" id="LN4090">4090</td><td class="line"> inhibitors);</td></tr> +<tr class="codeline" data-linenumber="4091"><td class="num" id="LN4091">4091</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4092"><td class="num" id="LN4092">4092</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4093"><td class="num" id="LN4093">4093</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4094"><td class="num" id="LN4094">4094</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4095"><td class="num" id="LN4095">4095</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="4096"><td class="num" id="LN4096">4096</td><td class="line">_app_has_autostart_condition (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="4097"><td class="num" id="LN4097">4097</td><td class="line"> GsmApp *app,</td></tr> +<tr class="codeline" data-linenumber="4098"><td class="num" id="LN4098">4098</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *condition)</td></tr> +<tr class="codeline" data-linenumber="4099"><td class="num" id="LN4099">4099</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4100"><td class="num" id="LN4100">4100</td><td class="line"> gboolean has;</td></tr> +<tr class="codeline" data-linenumber="4101"><td class="num" id="LN4101">4101</td><td class="line"> gboolean disabled;</td></tr> +<tr class="codeline" data-linenumber="4102"><td class="num" id="LN4102">4102</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4103"><td class="num" id="LN4103">4103</td><td class="line"> has = gsm_app_has_autostart_condition (app, condition);</td></tr> +<tr class="codeline" data-linenumber="4104"><td class="num" id="LN4104">4104</td><td class="line"> disabled = gsm_app_peek_is_disabled (app);</td></tr> +<tr class="codeline" data-linenumber="4105"><td class="num" id="LN4105">4105</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4106"><td class="num" id="LN4106">4106</td><td class="line"> <span class='keyword'>return</span> has && !disabled;</td></tr> +<tr class="codeline" data-linenumber="4107"><td class="num" id="LN4107">4107</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4108"><td class="num" id="LN4108">4108</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4109"><td class="num" id="LN4109">4109</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="4110"><td class="num" id="LN4110">4110</td><td class="line">gsm_manager_is_autostart_condition_handled (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="4111"><td class="num" id="LN4111">4111</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *condition,</td></tr> +<tr class="codeline" data-linenumber="4112"><td class="num" id="LN4112">4112</td><td class="line"> gboolean *handled,</td></tr> +<tr class="codeline" data-linenumber="4113"><td class="num" id="LN4113">4113</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="4114"><td class="num" id="LN4114">4114</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4115"><td class="num" id="LN4115">4115</td><td class="line"> GsmApp *app;</td></tr> +<tr class="codeline" data-linenumber="4116"><td class="num" id="LN4116">4116</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="4117"><td class="num" id="LN4117">4117</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4118"><td class="num" id="LN4118">4118</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4119"><td class="num" id="LN4119">4119</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4120"><td class="num" id="LN4120">4120</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="4121"><td class="num" id="LN4121">4121</td><td class="line"> app = (GsmApp *) gsm_store_find (priv->apps,(</td></tr> +<tr class="codeline" data-linenumber="4122"><td class="num" id="LN4122">4122</td><td class="line"> GsmStoreFunc) _app_has_autostart_condition,</td></tr> +<tr class="codeline" data-linenumber="4123"><td class="num" id="LN4123">4123</td><td class="line"> (<span class='keyword'>char</span> *)condition);</td></tr> +<tr class="codeline" data-linenumber="4124"><td class="num" id="LN4124">4124</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4125"><td class="num" id="LN4125">4125</td><td class="line"> <span class='keyword'>if</span> (app != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4126"><td class="num" id="LN4126">4126</td><td class="line"> *handled = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4127"><td class="num" id="LN4127">4127</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="4128"><td class="num" id="LN4128">4128</td><td class="line"> *handled = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4129"><td class="num" id="LN4129">4129</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4130"><td class="num" id="LN4130">4130</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4131"><td class="num" id="LN4131">4131</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4132"><td class="num" id="LN4132">4132</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4133"><td class="num" id="LN4133">4133</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4134"><td class="num" id="LN4134">4134</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="4135"><td class="num" id="LN4135">4135</td><td class="line">append_app (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="4136"><td class="num" id="LN4136">4136</td><td class="line"> GsmApp *app)</td></tr> +<tr class="codeline" data-linenumber="4137"><td class="num" id="LN4137">4137</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4138"><td class="num" id="LN4138">4138</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *id;</td></tr> +<tr class="codeline" data-linenumber="4139"><td class="num" id="LN4139">4139</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *app_id;</td></tr> +<tr class="codeline" data-linenumber="4140"><td class="num" id="LN4140">4140</td><td class="line"> GsmApp *dup;</td></tr> +<tr class="codeline" data-linenumber="4141"><td class="num" id="LN4141">4141</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="4142"><td class="num" id="LN4142">4142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4143"><td class="num" id="LN4143">4143</td><td class="line"> id = gsm_app_peek_id (app);</td></tr> +<tr class="codeline" data-linenumber="4144"><td class="num" id="LN4144">4144</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (id)<span class='macro_popup'>((id)==((void*)0)||(id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4145"><td class="num" id="LN4145">4145</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: not adding app: no id"</span>);</td></tr> +<tr class="codeline" data-linenumber="4146"><td class="num" id="LN4146">4146</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="4147"><td class="num" id="LN4147">4147</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4148"><td class="num" id="LN4148">4148</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4149"><td class="num" id="LN4149">4149</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="4150"><td class="num" id="LN4150">4150</td><td class="line"> dup = (GsmApp *)gsm_store_lookup (priv->apps, id);</td></tr> +<tr class="codeline" data-linenumber="4151"><td class="num" id="LN4151">4151</td><td class="line"> <span class='keyword'>if</span> (dup != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4152"><td class="num" id="LN4152">4152</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: not adding app: already added"</span>);</td></tr> +<tr class="codeline" data-linenumber="4153"><td class="num" id="LN4153">4153</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="4154"><td class="num" id="LN4154">4154</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4155"><td class="num" id="LN4155">4155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4156"><td class="num" id="LN4156">4156</td><td class="line"> app_id = gsm_app_peek_app_id (app);</td></tr> +<tr class="codeline" data-linenumber="4157"><td class="num" id="LN4157">4157</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (app_id)<span class='macro_popup'>((app_id)==((void*)0)||(app_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4158"><td class="num" id="LN4158">4158</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: not adding app: no app-id"</span>);</td></tr> +<tr class="codeline" data-linenumber="4159"><td class="num" id="LN4159">4159</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="4160"><td class="num" id="LN4160">4160</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4161"><td class="num" id="LN4161">4161</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4162"><td class="num" id="LN4162">4162</td><td class="line"> dup = find_app_for_app_id (manager, app_id);</td></tr> +<tr class="codeline" data-linenumber="4163"><td class="num" id="LN4163">4163</td><td class="line"> <span class='keyword'>if</span> (dup != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4164"><td class="num" id="LN4164">4164</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: not adding app: app-id already exists"</span>);</td></tr> +<tr class="codeline" data-linenumber="4165"><td class="num" id="LN4165">4165</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="4166"><td class="num" id="LN4166">4166</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4167"><td class="num" id="LN4167">4167</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4168"><td class="num" id="LN4168">4168</td><td class="line"> gsm_store_add (priv->apps, id, <span class='macro'>G_OBJECT (app)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((app)), (((GType) ((20) << (2))))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="4169"><td class="num" id="LN4169">4169</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4170"><td class="num" id="LN4170">4170</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4171"><td class="num" id="LN4171">4171</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="4172"><td class="num" id="LN4172">4172</td><td class="line">gsm_manager_add_autostart_app (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="4173"><td class="num" id="LN4173">4173</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *path,</td></tr> +<tr class="codeline" data-linenumber="4174"><td class="num" id="LN4174">4174</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *provides)</td></tr> +<tr class="codeline" data-linenumber="4175"><td class="num" id="LN4175">4175</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4176"><td class="num" id="LN4176">4176</td><td class="line"> GsmApp *app;</td></tr> +<tr class="codeline" data-linenumber="4177"><td class="num" id="LN4177">4177</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="4178"><td class="num" id="LN4178">4178</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4179"><td class="num" id="LN4179">4179</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4180"><td class="num" id="LN4180">4180</td><td class="line"> <span class='macro'>g_return_val_if_fail (path != NULL, FALSE)<span class='macro_popup'>do { if ((path != ((void*)0))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "path != NULL"); return<br> ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4181"><td class="num" id="LN4181">4181</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4182"><td class="num" id="LN4182">4182</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="4183"><td class="num" id="LN4183">4183</td><td class="line"> <span class='comment'>/* first check to see if service is already provided */</span></td></tr> +<tr class="codeline" data-linenumber="4184"><td class="num" id="LN4184">4184</td><td class="line"> <span class='keyword'>if</span> (provides != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4185"><td class="num" id="LN4185">4185</td><td class="line"> GsmApp *dup;</td></tr> +<tr class="codeline" data-linenumber="4186"><td class="num" id="LN4186">4186</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4187"><td class="num" id="LN4187">4187</td><td class="line"> dup = (GsmApp *)gsm_store_find (priv->apps,</td></tr> +<tr class="codeline" data-linenumber="4188"><td class="num" id="LN4188">4188</td><td class="line"> (GsmStoreFunc)_find_app_provides,</td></tr> +<tr class="codeline" data-linenumber="4189"><td class="num" id="LN4189">4189</td><td class="line"> (<span class='keyword'>char</span> *)provides);</td></tr> +<tr class="codeline" data-linenumber="4190"><td class="num" id="LN4190">4190</td><td class="line"> <span class='keyword'>if</span> (dup != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4191"><td class="num" id="LN4191">4191</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: service '%s' is already provided"</span>, provides);</td></tr> +<tr class="codeline" data-linenumber="4192"><td class="num" id="LN4192">4192</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4193"><td class="num" id="LN4193">4193</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4194"><td class="num" id="LN4194">4194</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4195"><td class="num" id="LN4195">4195</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4196"><td class="num" id="LN4196">4196</td><td class="line"> app = gsm_autostart_app_new (path);</td></tr> +<tr class="codeline" data-linenumber="4197"><td class="num" id="LN4197">4197</td><td class="line"> <span class='keyword'>if</span> (app == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4198"><td class="num" id="LN4198">4198</td><td class="line"> g_warning (<span class='string_literal'>"could not read %s"</span>, path);</td></tr> +<tr class="codeline" data-linenumber="4199"><td class="num" id="LN4199">4199</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4200"><td class="num" id="LN4200">4200</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4201"><td class="num" id="LN4201">4201</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4202"><td class="num" id="LN4202">4202</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: read %s"</span>, path);</td></tr> +<tr class="codeline" data-linenumber="4203"><td class="num" id="LN4203">4203</td><td class="line"> append_app (manager, app);</td></tr> +<tr class="codeline" data-linenumber="4204"><td class="num" id="LN4204">4204</td><td class="line"> g_object_unref (app);</td></tr> +<tr class="codeline" data-linenumber="4205"><td class="num" id="LN4205">4205</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4206"><td class="num" id="LN4206">4206</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4207"><td class="num" id="LN4207">4207</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4208"><td class="num" id="LN4208">4208</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4209"><td class="num" id="LN4209">4209</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="4210"><td class="num" id="LN4210">4210</td><td class="line">gsm_manager_add_autostart_apps_from_dir (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="4211"><td class="num" id="LN4211">4211</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *path)</td></tr> +<tr class="codeline" data-linenumber="4212"><td class="num" id="LN4212">4212</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4213"><td class="num" id="LN4213">4213</td><td class="line"> GDir *dir;</td></tr> +<tr class="codeline" data-linenumber="4214"><td class="num" id="LN4214">4214</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *name;</td></tr> +<tr class="codeline" data-linenumber="4215"><td class="num" id="LN4215">4215</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4216"><td class="num" id="LN4216">4216</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4217"><td class="num" id="LN4217">4217</td><td class="line"> <span class='macro'>g_return_val_if_fail (path != NULL, FALSE)<span class='macro_popup'>do { if ((path != ((void*)0))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "path != NULL"); return<br> ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4218"><td class="num" id="LN4218">4218</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4219"><td class="num" id="LN4219">4219</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: *** Adding autostart apps for %s"</span>, path);</td></tr> +<tr class="codeline" data-linenumber="4220"><td class="num" id="LN4220">4220</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4221"><td class="num" id="LN4221">4221</td><td class="line"> dir = g_dir_open (path, 0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="4222"><td class="num" id="LN4222">4222</td><td class="line"> <span class='keyword'>if</span> (dir == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4223"><td class="num" id="LN4223">4223</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4224"><td class="num" id="LN4224">4224</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4225"><td class="num" id="LN4225">4225</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4226"><td class="num" id="LN4226">4226</td><td class="line"> <span class='keyword'>while</span> ((name = g_dir_read_name (dir))) {</td></tr> +<tr class="codeline" data-linenumber="4227"><td class="num" id="LN4227">4227</td><td class="line"> <span class='keyword'>char</span> *desktop_file;</td></tr> +<tr class="codeline" data-linenumber="4228"><td class="num" id="LN4228">4228</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4229"><td class="num" id="LN4229">4229</td><td class="line"> <span class='keyword'>if</span> (!<span class='macro'>g_str_has_suffix (name, <span class='string_literal'>".desktop"</span>)<span class='macro_popup'>(__builtin_constant_p (".desktop")? __extension__ ({ const char<br> * const __str = (name); const char * const __suffix = (".desktop"<br>); gboolean __result = (0); if (__str == ((void*)0) || __suffix<br> == ((void*)0)) __result = (g_str_has_suffix) (__str, __suffix<br>); else { const size_t __str_len = strlen (((__str) + !(__str<br>))); const size_t __suffix_len = strlen (((__suffix) + !(__suffix<br>))); if (__str_len >= __suffix_len) __result = memcmp (__str<br> + __str_len - __suffix_len, ((__suffix) + !(__suffix)), __suffix_len<br>) == 0; } __result; }) : (g_str_has_suffix) (name, ".desktop"<br>) )</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4230"><td class="num" id="LN4230">4230</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="4231"><td class="num" id="LN4231">4231</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4232"><td class="num" id="LN4232">4232</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4233"><td class="num" id="LN4233">4233</td><td class="line"> desktop_file = g_build_filename (path, name, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="4234"><td class="num" id="LN4234">4234</td><td class="line"> gsm_manager_add_autostart_app (manager, desktop_file, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="4235"><td class="num" id="LN4235">4235</td><td class="line"> g_free (desktop_file);</td></tr> +<tr class="codeline" data-linenumber="4236"><td class="num" id="LN4236">4236</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4237"><td class="num" id="LN4237">4237</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4238"><td class="num" id="LN4238">4238</td><td class="line"> g_dir_close (dir);</td></tr> +<tr class="codeline" data-linenumber="4239"><td class="num" id="LN4239">4239</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4240"><td class="num" id="LN4240">4240</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4241"><td class="num" id="LN4241">4241</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4242"><td class="num" id="LN4242">4242</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4243"><td class="num" id="LN4243">4243</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="4244"><td class="num" id="LN4244">4244</td><td class="line">gsm_manager_is_session_running (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="4245"><td class="num" id="LN4245">4245</td><td class="line"> gboolean *running,</td></tr> +<tr class="codeline" data-linenumber="4246"><td class="num" id="LN4246">4246</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="4247"><td class="num" id="LN4247">4247</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4248"><td class="num" id="LN4248">4248</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="4249"><td class="num" id="LN4249">4249</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4250"><td class="num" id="LN4250">4250</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4251"><td class="num" id="LN4251">4251</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4252"><td class="num" id="LN4252">4252</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="4253"><td class="num" id="LN4253">4253</td><td class="line"> *running = (priv->phase == GSM_MANAGER_PHASE_RUNNING);</td></tr> +<tr class="codeline" data-linenumber="4254"><td class="num" id="LN4254">4254</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4255"><td class="num" id="LN4255">4255</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-abdc03.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-abdc03.html new file mode 100644 index 0000000..97d9dcc --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-abdc03.html @@ -0,0 +1,1483 @@ +<!doctype html> +<html> +<head> +<title>main.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Using a fixed address is not portable because that address will probably not be valid in all environments or platforms --> + +<!-- BUGTYPE Use fixed address --> + +<!-- BUGCATEGORY Logic error --> + +<!-- BUGFILE /rootdir/mate-session/main.c --> + +<!-- FILENAME main.c --> + +<!-- FUNCTIONNAME main --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT abdc03895746dd678fbe5e98153d4142 --> + +<!-- BUGLINE 628 --> + +<!-- BUGCOLUMN 16 --> + +<!-- BUGPATHLENGTH 3 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>mate-session/main.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 628, column 16</a><br />Using a fixed address is not portable because that address will probably not be valid in all environments or platforms</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/mate-session -fcoverage-compilation-dir=/rootdir/mate-session -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -I /usr/include/uuid -I ../mate-submodules/libegg -D LOCALE_DIR="/usr/local/share/locale" -D DATA_DIR="/usr/local/share/mate-session" -D LIBEXECDIR="/usr/local/libexec" -D GTKBUILDER_DIR="/usr/local/share/mate-session-manager" -D I_KNOW_THE_DEVICEKIT_POWER_API_IS_SUBJECT_TO_CHANGE -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c main.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"592": 1, "593": 1, "594": 1, "595": 1, "596": 1, "597": 1, "598": 1, "599": 1, "600": 1, "601": 1, "602": 1, "603": 1, "604": 1, "605": 1, "607": 1, "608": 1, "609": 1, "610": 1, "611": 1, "612": 1, "617": 1, "623": 1, "624": 1, "625": 1, "628": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + <path class="arrow" id="arrow0"/> + <path class="arrow" id="arrow1"/> + <path class="arrow" id="arrow2"/> + <path class="arrow" id="arrow3"/> + <path class="arrow" id="arrow4"/> + <path class="arrow" id="arrow5"/> + <path class="arrow" id="arrow6"/> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 7,5,3,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2006 Novell, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Copyright (C) 2008 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* This program is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU General Public License as</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* published by the Free Software Foundation; either version 2 of the</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>* License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful, but</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>* Lesser General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>* 02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <config.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <signal.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <<span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span>.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='directive'>#include <time.h></span></td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"><span class='directive'>#include <glib.h></span></td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#include <gio/gio.h></span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"><span class='directive'>#include <dbus/dbus.h></span></td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#include "mdm-signal-handler.h"</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#include "mdm-log.h"</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='directive'>#include "gsm-consolekit.h"</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"><span class='directive'>#include "gsm-systemd.h"</span></td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"><span class='directive'>#include "gsm-util.h"</span></td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"><span class='directive'>#include "gsm-manager.h"</span></td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='directive'>#include "gsm-xsmp-server.h"</span></td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"><span class='directive'>#include "gsm-store.h"</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"><span class='directive'>#include "msm-gnome.h"</span></td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span> "org.mate.session"</span></td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_DEFAULT_SESSION_KEY<span class='macro_popup'>"default-session"</span></span> "default-session"</span></td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_REQUIRED_COMPONENTS_SCHEMA<span class='macro_popup'>"org.mate.session" ".required-components"</span></span> <span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span> ".required-components"</span></td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_REQUIRED_COMPONENTS_LIST_KEY<span class='macro_popup'>"required-components-list"</span></span> "required-components-list"</span></td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"><span class='directive'>#define <span class='macro'>ACCESSIBILITY_KEY<span class='macro_popup'>"accessibility"</span></span> "accessibility"</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"><span class='directive'>#define <span class='macro'>ACCESSIBILITY_SCHEMA<span class='macro_popup'>"org.mate.interface"</span></span> "org.mate.interface"</span></td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"><span class='directive'>#define <span class='macro'>DEBUG_SCHEMA<span class='macro_popup'>"org.mate.debug"</span></span> "org.mate.debug"</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"><span class='directive'>#define <span class='macro'>DEBUG_KEY<span class='macro_popup'>"mate-session"</span></span> "mate-session"</span></td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"><span class='directive'>#define <span class='macro'>VISUAL_SCHEMA<span class='macro_popup'>"org.mate.applications-at-visual"</span></span> "org.mate.applications-at-visual"</span></td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"><span class='directive'>#define <span class='macro'>VISUAL_KEY<span class='macro_popup'>"exec"</span></span> "exec"</span></td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"><span class='directive'>#define <span class='macro'>VISUAL_STARTUP_KEY<span class='macro_popup'>"startup"</span></span> "startup"</span></td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"><span class='directive'>#define <span class='macro'>MOBILITY_SCHEMA<span class='macro_popup'>"org.mate.applications-at-mobility"</span></span> "org.mate.applications-at-mobility"</span></td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"><span class='directive'>#define <span class='macro'>MOBILITY_KEY<span class='macro_popup'>"exec"</span></span> "exec"</span></td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='directive'>#define <span class='macro'>MOBILITY_STARTUP_KEY<span class='macro_popup'>"startup"</span></span> "startup"</span></td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"><span class='directive'>#define <span class='macro'>MATE_INTERFACE_SCHEMA<span class='macro_popup'>"org.mate.interface"</span></span> "org.mate.interface"</span></td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"><span class='directive'>#define <span class='macro'>GTK_OVERLAY_SCROLL<span class='macro_popup'>"gtk-overlay-scrolling"</span></span> "gtk-overlay-scrolling"</span></td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_DBUS_NAME<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_AUTOSAVE<span class='macro_popup'>"auto-save-session"</span></span> "auto-save-session"</span></td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"><span class='keyword'>static</span> gboolean failsafe = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"><span class='keyword'>static</span> gboolean show_version = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='keyword'>static</span> gboolean debug = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"><span class='keyword'>static</span> gboolean disable_acceleration_check = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line">initialize_gsettings (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> GSettings* settings;</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> time_t now = time (0);</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> settings = g_settings_new (<span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> <span class='keyword'>if</span> (!settings)</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> ret = g_settings_set_int (settings, <span class='string_literal'>"session-start"</span>, now);</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> g_settings_sync ();</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> g_object_unref (settings);</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> on_bus_name_lost(DBusGProxy* bus_proxy, <span class='keyword'>const</span> <span class='keyword'>char</span>* name, gpointer data)</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> g_warning(<span class='string_literal'>"Lost name on bus: %s, exiting"</span>, name);</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> exit(1);</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"><span class='keyword'>static</span> gboolean acquire_name_on_proxy(DBusGProxy* bus_proxy, <span class='keyword'>const</span> <span class='keyword'>char</span>* name)</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> guint result;</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='keyword'>if</span> (bus_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> res = dbus_g_proxy_call(bus_proxy, <span class='string_literal'>"RequestName"</span>, &error, <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>, name, <span class='macro'>G_TYPE_UINT<span class='macro_popup'>((GType) ((7) << (2)))</span></span>, 0, <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>, <span class='macro'>G_TYPE_UINT<span class='macro_popup'>((GType) ((7) << (2)))</span></span>, &result, <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> <span class='keyword'>if</span> (! res)</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> g_warning(<span class='string_literal'>"Failed to acquire %s: %s"</span>, name, error->message);</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> g_error_free(error);</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> g_warning (<span class='string_literal'>"Failed to acquire %s"</span>, name);</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER<span class='macro_popup'>1</span></span>)</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> g_warning(<span class='string_literal'>"Failed to acquire %s: %s"</span>, name, error->message);</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> g_error_free(error);</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> g_warning(<span class='string_literal'>"Failed to acquire %s"</span>, name);</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> <span class='comment'>/* register for name lost */</span></td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> dbus_g_proxy_add_signal(bus_proxy, <span class='string_literal'>"NameLost"</span>, <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>, <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> dbus_g_proxy_connect_signal(bus_proxy, <span class='string_literal'>"NameLost"</span>, <span class='macro'>G_CALLBACK(on_bus_name_lost)<span class='macro_popup'>((GCallback) (on_bus_name_lost))</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> out:</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"><span class='keyword'>static</span> gboolean acquire_name(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> DBusGProxy* bus_proxy;</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> DBusGConnection* connection;</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>if</span> (connection == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> gsm_util_init_error(<span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='string_literal'>"Could not connect to session bus: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='comment'>/* not reached */</span></td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> bus_proxy = dbus_g_proxy_new_for_name(connection, <span class='macro'>DBUS_SERVICE_DBUS<span class='macro_popup'>"org.freedesktop.DBus"</span></span>, <span class='macro'>DBUS_PATH_DBUS<span class='macro_popup'>"/org/freedesktop/DBus"</span></span>, <span class='macro'>DBUS_INTERFACE_DBUS<span class='macro_popup'>"org.freedesktop.DBus"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='keyword'>if</span> (!acquire_name_on_proxy(bus_proxy, <span class='macro'>GSM_DBUS_NAME<span class='macro_popup'>"org.gnome.SessionManager"</span></span>))</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> gsm_util_init_error(<span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='string_literal'>"%s"</span>, <span class='string_literal'>"Could not acquire name on session bus"</span>);</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='comment'>/* not reached */</span></td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> g_object_unref(bus_proxy);</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"><span class='comment'>/* This doesn't contain the required components, so we need to always</span></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='comment'>* call append_required_apps() after a call to append_default_apps(). */</span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> append_default_apps(GsmManager* manager, <span class='keyword'>const</span> <span class='keyword'>char</span>* default_session_key, <span class='keyword'>char</span>** autostart_dirs)</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> gint i;</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> gchar** default_apps;</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> GSettings* settings;</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> g_debug(<span class='string_literal'>"main: *** Adding default apps"</span>);</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='macro'>g_assert(default_session_key != NULL)<span class='macro_popup'>do { if (default_session_key != ((void*)0)) ; else g_assertion_message_expr<br> (((gchar*) 0), "main.c", 207, ((const char*) (__func__)), "default_session_key != NULL"<br>); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> <span class='macro'>g_assert(autostart_dirs != NULL)<span class='macro_popup'>do { if (autostart_dirs != ((void*)0)) ; else g_assertion_message_expr<br> (((gchar*) 0), "main.c", 208, ((const char*) (__func__)), "autostart_dirs != NULL"<br>); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> settings = g_settings_new (<span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> default_apps = g_settings_get_strv (settings, default_session_key);</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> g_object_unref(settings);</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> <span class='keyword'>for</span> (i = 0; default_apps[i]; i++)</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> <span class='keyword'>char</span>* app_path;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY((<span class='keyword'>char</span>*) default_apps[i])<span class='macro_popup'>(((char*) default_apps[i])==((void*)0)||((char*) default_apps<br>[i])[0]=='\0')</span></span>)</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> app_path = gsm_util_find_desktop_file_for_app_name(default_apps[i], autostart_dirs);</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='keyword'>if</span> (app_path != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> gsm_manager_add_autostart_app(manager, app_path, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> g_free(app_path);</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> g_strfreev (default_apps);</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> append_required_apps(GsmManager* manager)</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> gchar** required_components;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> gint i;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> GSettings* settings;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> GSettings* settings_required_components;</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> g_debug(<span class='string_literal'>"main: *** Adding required apps"</span>);</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> settings = g_settings_new (<span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> settings_required_components = g_settings_new (<span class='macro'>GSM_REQUIRED_COMPONENTS_SCHEMA<span class='macro_popup'>"org.mate.session" ".required-components"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> required_components = g_settings_get_strv(settings, <span class='macro'>GSM_REQUIRED_COMPONENTS_LIST_KEY<span class='macro_popup'>"required-components-list"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> <span class='keyword'>if</span> (required_components == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> g_warning(<span class='string_literal'>"No required applications specified"</span>);</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> <span class='keyword'>for</span> (i = 0; required_components[i]; i++)</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> <span class='keyword'>char</span>* default_provider;</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span>* component;</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY((<span class='keyword'>char</span>*) required_components[i])<span class='macro_popup'>(((char*) required_components[i])==((void*)0)||((char*) required_components<br>[i])[0]=='\0')</span></span>)</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> component = required_components[i];</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> default_provider = g_settings_get_string (settings_required_components, component);</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> g_debug (<span class='string_literal'>"main: %s looking for component: '%s'"</span>, component, default_provider);</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>if</span> (default_provider != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> <span class='keyword'>char</span>* app_path;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> app_path = gsm_util_find_desktop_file_for_app_name(default_provider, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>if</span> (app_path != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> gsm_manager_add_autostart_app(manager, app_path, component);</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> g_warning(<span class='string_literal'>"Unable to find provider '%s' of required component '%s'"</span>, default_provider, component);</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> g_free(app_path);</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> g_free(default_provider);</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> g_debug(<span class='string_literal'>"main: *** Done adding required apps"</span>);</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> g_strfreev(required_components);</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> g_object_unref(settings);</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> g_object_unref(settings_required_components);</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> append_accessibility_apps(GsmManager* manager)</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> GSettings* mobility_settings;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> GSettings* visual_settings;</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> g_debug(<span class='string_literal'>"main: *** Adding accesibility apps"</span>);</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> mobility_settings = g_settings_new (<span class='macro'>MOBILITY_SCHEMA<span class='macro_popup'>"org.mate.applications-at-mobility"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> visual_settings = g_settings_new (<span class='macro'>VISUAL_SCHEMA<span class='macro_popup'>"org.mate.applications-at-visual"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> <span class='keyword'>if</span> (g_settings_get_boolean (mobility_settings, <span class='macro'>MOBILITY_STARTUP_KEY<span class='macro_popup'>"startup"</span></span>))</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> gchar *mobility_exec;</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> mobility_exec = g_settings_get_string (mobility_settings, <span class='macro'>MOBILITY_KEY<span class='macro_popup'>"exec"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> <span class='keyword'>if</span> (mobility_exec != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> && mobility_exec[0] != 0)</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> <span class='keyword'>char</span>* app_path;</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> app_path = gsm_util_find_desktop_file_for_app_name(mobility_exec, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> <span class='keyword'>if</span> (app_path != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> gsm_manager_add_autostart_app(manager, app_path, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> g_free (app_path);</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> g_free (mobility_exec);</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (g_settings_get_boolean (visual_settings, <span class='macro'>VISUAL_STARTUP_KEY<span class='macro_popup'>"startup"</span></span>))</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> gchar *visual_exec;</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> visual_exec = g_settings_get_string (visual_settings, <span class='macro'>VISUAL_KEY<span class='macro_popup'>"exec"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> <span class='keyword'>if</span> (visual_exec != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> && visual_exec[0] != 0)</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> <span class='keyword'>char</span>* app_path;</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> app_path = gsm_util_find_desktop_file_for_app_name(visual_exec, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='keyword'>if</span> (app_path != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> gsm_manager_add_autostart_app(manager, app_path, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> g_free (app_path);</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> g_free (visual_exec);</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> g_object_unref (mobility_settings);</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> g_object_unref (visual_settings);</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> maybe_load_saved_session_apps(GsmManager* manager)</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> GsmConsolekit* consolekit = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> GsmSystemd* systemd = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>char</span>* session_type;</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> gboolean is_login;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> systemd = gsm_get_systemd();</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> session_type = gsm_systemd_get_current_session_type(systemd);</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> is_login = g_strcmp0 (session_type, <span class='macro'>GSM_SYSTEMD_SESSION_TYPE_LOGIN_WINDOW<span class='macro_popup'>"greeter"</span></span>) == 0;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> consolekit = gsm_get_consolekit();</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> session_type = gsm_consolekit_get_current_session_type(consolekit);</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> is_login = g_strcmp0 (session_type, <span class='macro'>GSM_CONSOLEKIT_SESSION_TYPE_LOGIN_WINDOW<span class='macro_popup'>"LoginWindow"</span></span>) == 0;</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>if</span> (!is_login)</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> GSettings* settings;</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> gboolean autostart;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> settings = g_settings_new (<span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> autostart = g_settings_get_boolean (settings, <span class='macro'>KEY_AUTOSAVE<span class='macro_popup'>"auto-save-session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> g_object_unref (settings);</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> <span class='keyword'>if</span> (autostart == <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>)</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> gsm_manager_add_autostart_apps_from_dir(manager, gsm_util_get_saved_session_dir());</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> <span class='keyword'>if</span> (consolekit != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> g_object_unref(consolekit);</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='keyword'>if</span> (systemd != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> g_object_unref(systemd);</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> g_free(session_type);</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> load_standard_apps (GsmManager* manager, <span class='keyword'>const</span> <span class='keyword'>char</span>* default_session_key)</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> <span class='keyword'>char</span>** autostart_dirs;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> autostart_dirs = gsm_util_get_autostart_dirs();</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> <span class='keyword'>if</span> (!failsafe)</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> maybe_load_saved_session_apps(manager);</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>for</span> (i = 0; autostart_dirs[i]; i++)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> gsm_manager_add_autostart_apps_from_dir(manager, autostart_dirs[i]);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> <span class='comment'>/* We do this at the end in case a saved session contains an</span></td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> <span class='comment'>* application that already provides one of the components. */</span></td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> append_default_apps(manager, default_session_key, autostart_dirs);</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> append_required_apps(manager);</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> append_accessibility_apps(manager);</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> g_strfreev(autostart_dirs);</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> load_override_apps(GsmManager* manager, <span class='keyword'>char</span>** override_autostart_dirs)</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> <span class='keyword'>for</span> (i = 0; override_autostart_dirs[i]; i++)</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> gsm_manager_add_autostart_apps_from_dir(manager, override_autostart_dirs[i]);</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"><span class='keyword'>static</span> gboolean signal_cb(<span class='keyword'>int</span> signo, gpointer data)</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> <span class='keyword'>int</span> ret;</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> GsmManager* manager;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> g_debug(<span class='string_literal'>"Got callback for signal %d"</span>, signo);</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> <span class='keyword'>switch</span> (signo)</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGFPE<span class='macro_popup'>8</span></span>:</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGPIPE<span class='macro_popup'>13</span></span>:</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> <span class='comment'>/* let the fatal signals interrupt us */</span></td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> g_debug (<span class='string_literal'>"Caught signal %d, shutting down abnormally."</span>, signo);</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGINT<span class='macro_popup'>2</span></span>:</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGTERM<span class='macro_popup'>15</span></span>:</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> manager = (GsmManager*) data;</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> gsm_manager_logout(manager, GSM_MANAGER_LOGOUT_MODE_FORCE, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> <span class='comment'>/* let the fatal signals interrupt us */</span></td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> g_debug(<span class='string_literal'>"Caught signal %d, shutting down normally."</span>, signo);</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGHUP<span class='macro_popup'>1</span></span>:</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> g_debug(<span class='string_literal'>"Got HUP signal"</span>);</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGUSR1<span class='macro_popup'>10</span></span>:</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> g_debug(<span class='string_literal'>"Got USR1 signal"</span>);</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> mdm_log_toggle_debug();</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> g_debug(<span class='string_literal'>"Caught unhandled signal %d"</span>, signo);</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> shutdown_cb(gpointer data)</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> GsmManager* manager = (GsmManager*) data;</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> g_debug(<span class='string_literal'>"Calling shutdown callback function"</span>);</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> <span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='comment'>* When the signal handler gets a shutdown signal, it calls</span></td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> <span class='comment'>* this function to inform GsmManager to not restart</span></td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> <span class='comment'>* applications in the off chance a handler is already queued</span></td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> <span class='comment'>* to dispatch following the below call to gtk_main_quit.</span></td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> gsm_manager_set_phase(manager, GSM_MANAGER_PHASE_EXIT);</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> gtk_main_quit();</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"><span class='keyword'>static</span> gboolean require_dbus_session(<span class='keyword'>int</span> argc, <span class='keyword'>char</span>** argv, GError** error)</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> <span class='keyword'>char</span>** new_argv;</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>if</span> (g_getenv(<span class='string_literal'>"DBUS_SESSION_BUS_ADDRESS"</span>))</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> <span class='comment'>/* Just a sanity check to prevent infinite recursion if</span></td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> <span class='comment'>* dbus-launch fails to set DBUS_SESSION_BUS_ADDRESS</span></td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='macro'>g_return_val_if_fail(!g_str_has_prefix(argv[0], <span class='string_literal'>"dbus-launch"</span>), TRUE)<span class='macro_popup'>do { if ((!(__builtin_constant_p ("dbus-launch")? __extension__<br> ({ const char * const __str = (argv[0]); const char * const __prefix<br> = ("dbus-launch"); gboolean __result = (0); if (__str == ((void<br>*)0) || __prefix == ((void*)0)) __result = (g_str_has_prefix)<br> (__str, __prefix); else { const size_t __str_len = strlen ((<br>(__str) + !(__str))); const size_t __prefix_len = strlen (((__prefix<br>) + !(__prefix))); if (__str_len >= __prefix_len) __result<br> = memcmp (((__str) + !(__str)), ((__prefix) + !(__prefix)), __prefix_len<br>) == 0; } __result; }) : (g_str_has_prefix) (argv[0], "dbus-launch"<br>) ))) { } else { g_return_if_fail_warning (((gchar*) 0), ((const<br> char*) (__func__)), "!g_str_has_prefix(argv[0], \"dbus-launch\")"<br>); return ((!(0))); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> <span class='comment'>/* +2 for our new arguments, +1 for NULL */</span></td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> new_argv = g_malloc(argc + 3 * <span class='keyword'>sizeof</span> (*argv));</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> new_argv[0] = <span class='string_literal'>"dbus-launch"</span>;</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> new_argv[1] = <span class='string_literal'>"--exit-with-session"</span>;</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < argc; i++)</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> new_argv[i + 2] = argv[i];</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> new_argv[i + 2] = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>if</span> (!execvp(<span class='string_literal'>"dbus-launch"</span>, new_argv))</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> g_set_error(error, <span class='macro'>G_SPAWN_ERROR<span class='macro_popup'>g_spawn_error_quark ()</span></span>, G_SPAWN_ERROR_FAILED, <span class='string_literal'>"No session bus and could not exec dbus-launch: %s"</span>, g_strerror(<span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span>));</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> g_free (new_argv);</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> g_free (new_argv);</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> <span class='comment'>/* Should not be reached */</span></td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line">debug_changed (GSettings *settings, gchar *key, gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> debug = g_settings_get_boolean (settings, <span class='macro'>DEBUG_KEY<span class='macro_popup'>"mate-session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> mdm_log_set_debug (debug);</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line">schema_exists (<span class='keyword'>const</span> gchar* schema_name)</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> GSettingsSchemaSource *source;</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> GSettingsSchema *schema;</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> gboolean exists;</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> source = g_settings_schema_source_get_default();</td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> schema = g_settings_schema_source_lookup (source, schema_name, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> exists = (schema != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> <span class='keyword'>if</span> (schema)</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> g_settings_schema_unref (schema);</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='keyword'>return</span> exists;</td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> set_overlay_scroll (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> GSettings *settings;</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> gboolean enabled;</td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> settings = g_settings_new (<span class='macro'>MATE_INTERFACE_SCHEMA<span class='macro_popup'>"org.mate.interface"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> enabled = g_settings_get_boolean (settings, <span class='macro'>GTK_OVERLAY_SCROLL<span class='macro_popup'>"gtk-overlay-scrolling"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> <span class='keyword'>if</span> (enabled) {</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> gsm_util_setenv (<span class='string_literal'>"GTK_OVERLAY_SCROLLING"</span>, <span class='string_literal'>"1"</span>);</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> gsm_util_setenv (<span class='string_literal'>"GTK_OVERLAY_SCROLLING"</span>, <span class='string_literal'>"0"</span>);</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> g_object_unref (settings);</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line">check_gl (gchar **gl_renderer, GError **error)</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> <span class='keyword'>int</span> status;</td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> <span class='keyword'>char</span> *argv[] = { <span class='macro'>LIBEXECDIR<span class='macro_popup'>"/usr/local/libexec"</span></span> <span class='string_literal'>"/mate-session-check-accelerated"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> };</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>if</span> (getenv (<span class='string_literal'>"DISPLAY"</span>) == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> <span class='comment'>/* Not connected to X11, someone else will take care of checking GL */</span></td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> <span class='keyword'>if</span> (!g_spawn_sync (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, (<span class='keyword'>char</span> **) argv, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, gl_renderer, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> &status, error)) {</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> <span class='keyword'>return</span> g_spawn_check_exit_status (status, error);</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"><span class='keyword'>int</span> main(<span class='keyword'>int</span> argc, <span class='keyword'>char</span>** argv)</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> <span id="start6"><span class='keyword'>struct</span></span> sigaction sa;</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span>* display_str;</td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> GsmManager* manager;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> GsmStore* client_store;</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> GsmXsmpServer* xsmp_server;</td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> GSettings* debug_settings = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> GSettings* accessibility_settings;</td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> MdmSignalHandler* signal_handler;</td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>char</span>** override_autostart_dirs = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> <span class='keyword'>char</span>* gl_renderer = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> gboolean gl_failed = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> <span class='keyword'>static</span> GOptionEntry entries[] = {</td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> {<span class='string_literal'>"autostart"</span>, 'a', 0, G_OPTION_ARG_STRING_ARRAY, &override_autostart_dirs, <span class='macro'>N_(<span class='string_literal'>"Override standard autostart directories"</span>)<span class='macro_popup'>("Override standard autostart directories")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> {<span class='string_literal'>"debug"</span>, 0, 0, G_OPTION_ARG_NONE, &debug, <span class='macro'>N_(<span class='string_literal'>"Enable debugging code"</span>)<span class='macro_popup'>("Enable debugging code")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> {<span class='string_literal'>"failsafe"</span>, 'f', 0, G_OPTION_ARG_NONE, &failsafe, <span class='macro'>N_(<span class='string_literal'>"Do not load user-specified applications"</span>)<span class='macro_popup'>("Do not load user-specified applications")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> {<span class='string_literal'>"version"</span>, 0, 0, G_OPTION_ARG_NONE, &show_version, <span class='macro'>N_(<span class='string_literal'>"Version of this application"</span>)<span class='macro_popup'>("Version of this application")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> { <span class='string_literal'>"disable-acceleration-check"</span>, 0, 0, G_OPTION_ARG_NONE, &disable_acceleration_check, <span class='macro'>N_(<span class='string_literal'>"Disable hardware acceleration check"</span>)<span class='macro_popup'>("Disable hardware acceleration check")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> },</td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> {<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, 0, 0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> }</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> <span class='comment'>/* Make sure that we have a session bus */</span></td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> <span id="start5"><span id="end6"><span class='keyword'>if</span></span></span> (<span id="start4"><span class="mrange"><span id="end5">!</span></span>require_dbus_session(argc, argv, &error)</span>)</td></tr> +<tr><td class="num"></td><td class="line"><div id="Path1" class="msg msgEvent" style="margin-left:13ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">1</div></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path2" title="Next event (2)">→</a></div></td></tr></table></div></td></tr> +<tr><td class="num"></td><td class="line"><div id="Path2" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">2</div></td><td><div class="PathNav"><a href="#Path1" title="Previous event (1)">←</a></div></td><td>Taking false branch</td><td><div class="PathNav"><a href="#EndPath" title="Next event (3)">→</a></div></td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> gsm_util_init_error(<span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='string_literal'>"%s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"><span class='directive'>#ifdef <span class='macro'>ENABLE_NLS<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line"> <span id="start1"><span id="end2"><span id="start3"><span id="end4">bindtextdomain</span></span></span></span>(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span id="start2"><span id="end3"><span class='macro'>LOCALE_DIR<span class='macro_popup'>"/usr/local/share/locale"</span></span></span></span>);</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> bind_textdomain_codeset(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='string_literal'>"UTF-8"</span>);</td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"> <span id="start0"><span id="end1">textdomain</span></span>(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line"><span class='directive'>#endif /* ENABLE_NLS */</span></td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> sa.<span class='macro'>sa_handler<span class='macro_popup'>__sigaction_handler.sa_handler</span></span> <span id="end0">=</span> <span class="mrange"><span class='macro'>SIG_IGN<span class='macro_popup'>((__sighandler_t) 1)</span></span></span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:23ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">3</div></td><td><div class="PathNav"><a href="#Path2" title="Previous event (2)">←</a></div></td><td>Using a fixed address is not portable because that address will probably not be valid in all environments or platforms</td></tr></table></div></td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> sa.sa_flags = 0;</td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> sigemptyset(&sa.sa_mask);</td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> sigaction(<span class='macro'>SIGPIPE<span class='macro_popup'>13</span></span>, &sa, 0);</td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> gtk_init_with_args(&argc, &argv, (<span class='keyword'>char</span>*) <span class='macro'>_(<span class='string_literal'>" - the MATE session manager"</span>)<span class='macro_popup'>gettext (" - the MATE session manager")</span></span>, entries, <span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, &error);</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> g_warning(<span class='string_literal'>"%s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> exit(1);</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='keyword'>if</span> (show_version)</td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> g_print(<span class='string_literal'>"%s %s\n"</span>, g_get_application_name(), <span class='macro'>VERSION<span class='macro_popup'>"1.28.0"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> exit(1);</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> gsm_util_export_activation_environment (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> gsm_util_export_user_environment (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> mdm_log_init();</td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line"> <span class='comment'>/* Allows to enable/disable debug from GSettings only if it is not set from argument */</span></td></tr> +<tr class="codeline" data-linenumber="657"><td class="num" id="LN657">657</td><td class="line"> <span class='keyword'>if</span> (!debug && schema_exists(<span class='macro'>DEBUG_SCHEMA<span class='macro_popup'>"org.mate.debug"</span></span>))</td></tr> +<tr class="codeline" data-linenumber="658"><td class="num" id="LN658">658</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="659"><td class="num" id="LN659">659</td><td class="line"> debug_settings = g_settings_new (<span class='macro'>DEBUG_SCHEMA<span class='macro_popup'>"org.mate.debug"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="660"><td class="num" id="LN660">660</td><td class="line"> <span class='macro'>g_signal_connect (debug_settings, <span class='string_literal'>"changed::"</span> DEBUG_KEY, G_CALLBACK (debug_changed), NULL)<span class='macro_popup'>g_signal_connect_data ((debug_settings), ("changed::" "mate-session"<br>), (((GCallback) (debug_changed))), (((void*)0)), ((void*)0),<br> (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="661"><td class="num" id="LN661">661</td><td class="line"> debug = g_settings_get_boolean (debug_settings, <span class='macro'>DEBUG_KEY<span class='macro_popup'>"mate-session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="662"><td class="num" id="LN662">662</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="663"><td class="num" id="LN663">663</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="664"><td class="num" id="LN664">664</td><td class="line"> mdm_log_set_debug(debug);</td></tr> +<tr class="codeline" data-linenumber="665"><td class="num" id="LN665">665</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="666"><td class="num" id="LN666">666</td><td class="line"> <span class='keyword'>if</span> (disable_acceleration_check) {</td></tr> +<tr class="codeline" data-linenumber="667"><td class="num" id="LN667">667</td><td class="line"> g_debug (<span class='string_literal'>"hardware acceleration check is disabled"</span>);</td></tr> +<tr class="codeline" data-linenumber="668"><td class="num" id="LN668">668</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="669"><td class="num" id="LN669">669</td><td class="line"> <span class='comment'>/* Check GL, if it doesn't work out then force software fallback */</span></td></tr> +<tr class="codeline" data-linenumber="670"><td class="num" id="LN670">670</td><td class="line"> <span class='keyword'>if</span> (!check_gl (&gl_renderer, &error)) {</td></tr> +<tr class="codeline" data-linenumber="671"><td class="num" id="LN671">671</td><td class="line"> gl_failed = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="672"><td class="num" id="LN672">672</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="673"><td class="num" id="LN673">673</td><td class="line"> g_debug (<span class='string_literal'>"hardware acceleration check failed: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="674"><td class="num" id="LN674">674</td><td class="line"> error? error->message : <span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="675"><td class="num" id="LN675">675</td><td class="line"> g_clear_error (&error);</td></tr> +<tr class="codeline" data-linenumber="676"><td class="num" id="LN676">676</td><td class="line"> <span class='keyword'>if</span> (g_getenv (<span class='string_literal'>"LIBGL_ALWAYS_SOFTWARE"</span>) == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="677"><td class="num" id="LN677">677</td><td class="line"> g_setenv (<span class='string_literal'>"LIBGL_ALWAYS_SOFTWARE"</span>, <span class='string_literal'>"1"</span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="678"><td class="num" id="LN678">678</td><td class="line"> <span class='keyword'>if</span> (!check_gl (&gl_renderer, &error)) {</td></tr> +<tr class="codeline" data-linenumber="679"><td class="num" id="LN679">679</td><td class="line"> g_warning (<span class='string_literal'>"software acceleration check failed: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="680"><td class="num" id="LN680">680</td><td class="line"> error? error->message : <span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="681"><td class="num" id="LN681">681</td><td class="line"> g_clear_error (&error);</td></tr> +<tr class="codeline" data-linenumber="682"><td class="num" id="LN682">682</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="683"><td class="num" id="LN683">683</td><td class="line"> gl_failed = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="684"><td class="num" id="LN684">684</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="685"><td class="num" id="LN685">685</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="686"><td class="num" id="LN686">686</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="687"><td class="num" id="LN687">687</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="688"><td class="num" id="LN688">688</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="689"><td class="num" id="LN689">689</td><td class="line"> <span class='keyword'>if</span> (gl_failed) {</td></tr> +<tr class="codeline" data-linenumber="690"><td class="num" id="LN690">690</td><td class="line"> g_warning (<span class='string_literal'>"gl_failed!"</span>);</td></tr> +<tr class="codeline" data-linenumber="691"><td class="num" id="LN691">691</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="692"><td class="num" id="LN692">692</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="693"><td class="num" id="LN693">693</td><td class="line"> <span class='keyword'>if</span> (g_getenv (<span class='string_literal'>"XDG_CURRENT_DESKTOP"</span>) == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="694"><td class="num" id="LN694">694</td><td class="line"> gsm_util_setenv (<span class='string_literal'>"XDG_CURRENT_DESKTOP"</span>, <span class='string_literal'>"MATE"</span>);</td></tr> +<tr class="codeline" data-linenumber="695"><td class="num" id="LN695">695</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="696"><td class="num" id="LN696">696</td><td class="line"> <span class='comment'>/* Set DISPLAY explicitly for all our children, in case --display</span></td></tr> +<tr class="codeline" data-linenumber="697"><td class="num" id="LN697">697</td><td class="line"> <span class='comment'>* was specified on the command line.</span></td></tr> +<tr class="codeline" data-linenumber="698"><td class="num" id="LN698">698</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="699"><td class="num" id="LN699">699</td><td class="line"> display_str = gdk_display_get_name (gdk_display_get_default());</td></tr> +<tr class="codeline" data-linenumber="700"><td class="num" id="LN700">700</td><td class="line"> gsm_util_setenv(<span class='string_literal'>"DISPLAY"</span>, display_str);</td></tr> +<tr class="codeline" data-linenumber="701"><td class="num" id="LN701">701</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="702"><td class="num" id="LN702">702</td><td class="line"> <span class='comment'>/* Some third-party programs rely on MATE_DESKTOP_SESSION_ID to</span></td></tr> +<tr class="codeline" data-linenumber="703"><td class="num" id="LN703">703</td><td class="line"> <span class='comment'>* detect if MATE is running. We keep this for compatibility reasons.</span></td></tr> +<tr class="codeline" data-linenumber="704"><td class="num" id="LN704">704</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="705"><td class="num" id="LN705">705</td><td class="line"> gsm_util_setenv(<span class='string_literal'>"MATE_DESKTOP_SESSION_ID"</span>, <span class='string_literal'>"this-is-deprecated"</span>);</td></tr> +<tr class="codeline" data-linenumber="706"><td class="num" id="LN706">706</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="707"><td class="num" id="LN707">707</td><td class="line"> <span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="708"><td class="num" id="LN708">708</td><td class="line"> <span class='comment'>* Make sure gsettings is set up correctly. If not, then bail.</span></td></tr> +<tr class="codeline" data-linenumber="709"><td class="num" id="LN709">709</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="710"><td class="num" id="LN710">710</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="711"><td class="num" id="LN711">711</td><td class="line"> <span class='keyword'>if</span> (initialize_gsettings () != <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>)</td></tr> +<tr class="codeline" data-linenumber="712"><td class="num" id="LN712">712</td><td class="line"> exit (1);</td></tr> +<tr class="codeline" data-linenumber="713"><td class="num" id="LN713">713</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="714"><td class="num" id="LN714">714</td><td class="line"> <span class='comment'>/* Look if accessibility is enabled */</span></td></tr> +<tr class="codeline" data-linenumber="715"><td class="num" id="LN715">715</td><td class="line"> accessibility_settings = g_settings_new (<span class='macro'>ACCESSIBILITY_SCHEMA<span class='macro_popup'>"org.mate.interface"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="716"><td class="num" id="LN716">716</td><td class="line"> <span class='keyword'>if</span> (g_settings_get_boolean (accessibility_settings, <span class='macro'>ACCESSIBILITY_KEY<span class='macro_popup'>"accessibility"</span></span>))</td></tr> +<tr class="codeline" data-linenumber="717"><td class="num" id="LN717">717</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="718"><td class="num" id="LN718">718</td><td class="line"> gsm_util_setenv(<span class='string_literal'>"GTK_MODULES"</span>, <span class='string_literal'>"gail:atk-bridge"</span>);</td></tr> +<tr class="codeline" data-linenumber="719"><td class="num" id="LN719">719</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="720"><td class="num" id="LN720">720</td><td class="line"> g_object_unref (accessibility_settings);</td></tr> +<tr class="codeline" data-linenumber="721"><td class="num" id="LN721">721</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="722"><td class="num" id="LN722">722</td><td class="line"> client_store = gsm_store_new();</td></tr> +<tr class="codeline" data-linenumber="723"><td class="num" id="LN723">723</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="724"><td class="num" id="LN724">724</td><td class="line"> xsmp_server = gsm_xsmp_server_new(client_store);</td></tr> +<tr class="codeline" data-linenumber="725"><td class="num" id="LN725">725</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="726"><td class="num" id="LN726">726</td><td class="line"> <span class='comment'>/* Now make sure they succeeded. (They'll call</span></td></tr> +<tr class="codeline" data-linenumber="727"><td class="num" id="LN727">727</td><td class="line"> <span class='comment'>* gsm_util_init_error() if they failed.)</span></td></tr> +<tr class="codeline" data-linenumber="728"><td class="num" id="LN728">728</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="729"><td class="num" id="LN729">729</td><td class="line"> acquire_name();</td></tr> +<tr class="codeline" data-linenumber="730"><td class="num" id="LN730">730</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="731"><td class="num" id="LN731">731</td><td class="line"> <span class='comment'>/* Starts gnome compat mode */</span></td></tr> +<tr class="codeline" data-linenumber="732"><td class="num" id="LN732">732</td><td class="line"> msm_gnome_start();</td></tr> +<tr class="codeline" data-linenumber="733"><td class="num" id="LN733">733</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="734"><td class="num" id="LN734">734</td><td class="line"> <span class='comment'>/* Set to use Gtk3 overlay scroll */</span></td></tr> +<tr class="codeline" data-linenumber="735"><td class="num" id="LN735">735</td><td class="line"> set_overlay_scroll ();</td></tr> +<tr class="codeline" data-linenumber="736"><td class="num" id="LN736">736</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="737"><td class="num" id="LN737">737</td><td class="line"> manager = gsm_manager_new(client_store, failsafe);</td></tr> +<tr class="codeline" data-linenumber="738"><td class="num" id="LN738">738</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="739"><td class="num" id="LN739">739</td><td class="line"> signal_handler = mdm_signal_handler_new();</td></tr> +<tr class="codeline" data-linenumber="740"><td class="num" id="LN740">740</td><td class="line"> mdm_signal_handler_add_fatal(signal_handler);</td></tr> +<tr class="codeline" data-linenumber="741"><td class="num" id="LN741">741</td><td class="line"> mdm_signal_handler_add(signal_handler, <span class='macro'>SIGFPE<span class='macro_popup'>8</span></span>, signal_cb, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="742"><td class="num" id="LN742">742</td><td class="line"> mdm_signal_handler_add(signal_handler, <span class='macro'>SIGHUP<span class='macro_popup'>1</span></span>, signal_cb, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="743"><td class="num" id="LN743">743</td><td class="line"> mdm_signal_handler_add(signal_handler, <span class='macro'>SIGUSR1<span class='macro_popup'>10</span></span>, signal_cb, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="744"><td class="num" id="LN744">744</td><td class="line"> mdm_signal_handler_add(signal_handler, <span class='macro'>SIGTERM<span class='macro_popup'>15</span></span>, signal_cb, manager);</td></tr> +<tr class="codeline" data-linenumber="745"><td class="num" id="LN745">745</td><td class="line"> mdm_signal_handler_add(signal_handler, <span class='macro'>SIGINT<span class='macro_popup'>2</span></span>, signal_cb, manager);</td></tr> +<tr class="codeline" data-linenumber="746"><td class="num" id="LN746">746</td><td class="line"> mdm_signal_handler_set_fatal_func(signal_handler, shutdown_cb, manager);</td></tr> +<tr class="codeline" data-linenumber="747"><td class="num" id="LN747">747</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="748"><td class="num" id="LN748">748</td><td class="line"> <span class='keyword'>if</span> (override_autostart_dirs != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="749"><td class="num" id="LN749">749</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="750"><td class="num" id="LN750">750</td><td class="line"> load_override_apps(manager, override_autostart_dirs);</td></tr> +<tr class="codeline" data-linenumber="751"><td class="num" id="LN751">751</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="752"><td class="num" id="LN752">752</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="753"><td class="num" id="LN753">753</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="754"><td class="num" id="LN754">754</td><td class="line"> load_standard_apps(manager, <span class='macro'>GSM_DEFAULT_SESSION_KEY<span class='macro_popup'>"default-session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="755"><td class="num" id="LN755">755</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="756"><td class="num" id="LN756">756</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="757"><td class="num" id="LN757">757</td><td class="line"> gsm_xsmp_server_start(xsmp_server);</td></tr> +<tr class="codeline" data-linenumber="758"><td class="num" id="LN758">758</td><td class="line"> _gsm_manager_set_renderer (manager, gl_renderer);</td></tr> +<tr class="codeline" data-linenumber="759"><td class="num" id="LN759">759</td><td class="line"> gsm_manager_start(manager);</td></tr> +<tr class="codeline" data-linenumber="760"><td class="num" id="LN760">760</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="761"><td class="num" id="LN761">761</td><td class="line"> gtk_main();</td></tr> +<tr class="codeline" data-linenumber="762"><td class="num" id="LN762">762</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="763"><td class="num" id="LN763">763</td><td class="line"> <span class='keyword'>if</span> (xsmp_server != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="764"><td class="num" id="LN764">764</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="765"><td class="num" id="LN765">765</td><td class="line"> g_object_unref(xsmp_server);</td></tr> +<tr class="codeline" data-linenumber="766"><td class="num" id="LN766">766</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="767"><td class="num" id="LN767">767</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="768"><td class="num" id="LN768">768</td><td class="line"> <span class='keyword'>if</span> (manager != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="769"><td class="num" id="LN769">769</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="770"><td class="num" id="LN770">770</td><td class="line"> g_debug(<span class='string_literal'>"Unreffing manager"</span>);</td></tr> +<tr class="codeline" data-linenumber="771"><td class="num" id="LN771">771</td><td class="line"> g_object_unref(manager);</td></tr> +<tr class="codeline" data-linenumber="772"><td class="num" id="LN772">772</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="773"><td class="num" id="LN773">773</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="774"><td class="num" id="LN774">774</td><td class="line"> <span class='keyword'>if</span> (gl_renderer != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="775"><td class="num" id="LN775">775</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="776"><td class="num" id="LN776">776</td><td class="line"> g_free (gl_renderer);</td></tr> +<tr class="codeline" data-linenumber="777"><td class="num" id="LN777">777</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="778"><td class="num" id="LN778">778</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="779"><td class="num" id="LN779">779</td><td class="line"> <span class='keyword'>if</span> (client_store != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="780"><td class="num" id="LN780">780</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="781"><td class="num" id="LN781">781</td><td class="line"> g_object_unref(client_store);</td></tr> +<tr class="codeline" data-linenumber="782"><td class="num" id="LN782">782</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="783"><td class="num" id="LN783">783</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="784"><td class="num" id="LN784">784</td><td class="line"> <span class='keyword'>if</span> (debug_settings != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="785"><td class="num" id="LN785">785</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="786"><td class="num" id="LN786">786</td><td class="line"> g_object_unref(debug_settings);</td></tr> +<tr class="codeline" data-linenumber="787"><td class="num" id="LN787">787</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="788"><td class="num" id="LN788">788</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="789"><td class="num" id="LN789">789</td><td class="line"> msm_gnome_stop();</td></tr> +<tr class="codeline" data-linenumber="790"><td class="num" id="LN790">790</td><td class="line"> mdm_log_shutdown();</td></tr> +<tr class="codeline" data-linenumber="791"><td class="num" id="LN791">791</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="792"><td class="num" id="LN792">792</td><td class="line"> <span class='keyword'>return</span> 0;</td></tr> +<tr class="codeline" data-linenumber="793"><td class="num" id="LN793">793</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="794"><td class="num" id="LN794">794</td><td class="line"> </td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-b8f564.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-b8f564.html new file mode 100644 index 0000000..ccf13c8 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-b8f564.html @@ -0,0 +1,2089 @@ +<!doctype html> +<html> +<head> +<title>eggsmclient-xsmp.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption --> + +<!-- BUGTYPE Cast from non-struct type to struct type --> + +<!-- BUGCATEGORY Logic error --> + +<!-- BUGFILE /rootdir/mate-submodules/libegg/eggsmclient-xsmp.c --> + +<!-- FILENAME eggsmclient-xsmp.c --> + +<!-- FUNCTIONNAME array_prop --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT b8f564960b65bf4fae4d59c6aee36738 --> + +<!-- BUGLINE 1199 --> + +<!-- BUGCOLUMN 18 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>mate-submodules/libegg/eggsmclient-xsmp.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 1199, column 18</a><br />Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name eggsmclient-xsmp.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/mate-submodules/libegg -fcoverage-compilation-dir=/rootdir/mate-submodules/libegg -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I ../.. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/freetype2 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/harfbuzz -I /usr/include/uuid -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -D EGG_SM_CLIENT_BACKEND_XSMP -D G_LOG_DOMAIN="EggSMClient" -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/freetype2 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/harfbuzz -I /usr/include/uuid -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -D PIC -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c eggsmclient-xsmp.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"1199": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2007 Novell, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Inspired by various other pieces of code including GsmClient (C)</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* 2001 Havoc Pennington, MateClient (C) 1998 Carsten Schaar, and twm</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* session code (C) 1998 The Open Group.</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* This library is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>* License as published by the Free Software Foundation; either</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* version 2 of the License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* This library is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* Library General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>* License along with this library; if not, write to the</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>* Boston, MA 02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include "config.h"</span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include "eggsmclient.h"</span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include "eggsmclient-private.h"</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include "eggdesktopfile.h"</span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include <<span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span>.h></span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include <fcntl.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#include <X11/SM/SMlib.h></span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#include <gdk/gdk.h></span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"><span class='directive'>#ifdef GDK_WINDOWING_X11</span></td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"><span class='directive'>#define <span class='macro'>EGG_TYPE_SM_CLIENT_XSMP<span class='macro_popup'>(egg_sm_client_xsmp_get_type ())</span></span> (egg_sm_client_xsmp_get_type ())</span></td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"><span class='directive'>#define <span class='macro'>EGG_SM_CLIENT_XSMP(obj)<span class='macro_popup'>((((EggSMClientXSMP*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((obj)), ((egg_sm_client_xsmp_get_type ()))))))</span></span> (<span class='macro'>G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMP)<span class='macro_popup'>(((EggSMClientXSMP*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((obj)), ((egg_sm_client_xsmp_get_type ())))))</span></span>)</span></td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"><span class='directive'>#define <span class='macro'>EGG_SM_CLIENT_XSMP_CLASS(klass)<span class='macro_popup'>((((EggSMClientXSMPClass*) (void *) g_type_check_class_cast (<br>(GTypeClass*) ((klass)), ((egg_sm_client_xsmp_get_type ()))))<br>))</span></span> (<span class='macro'>G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMPClass)<span class='macro_popup'>(((EggSMClientXSMPClass*) (void *) g_type_check_class_cast ((<br>GTypeClass*) ((klass)), ((egg_sm_client_xsmp_get_type ())))))</span></span>)</span></td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='directive'>#define <span class='macro'>EGG_IS_SM_CLIENT_XSMP(obj)<span class='macro_popup'>(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (<br>(obj)); GType __t = ((egg_sm_client_xsmp_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))</span></span> (<span class='macro'>G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT_XSMP)<span class='macro_popup'>((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (<br>(obj)); GType __t = ((egg_sm_client_xsmp_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; })))</span></span>)</span></td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"><span class='directive'>#define <span class='macro'>EGG_IS_SM_CLIENT_XSMP_CLASS(klass)<span class='macro_popup'>(((__extension__ ({ GTypeClass *__class = (GTypeClass*) ((klass<br>)); GType __t = ((egg_sm_client_xsmp_get_type ())); gboolean __r<br>; if (!__class) __r = (0); else if (__class->g_type == __t<br>) __r = (!(0)); else __r = g_type_check_class_is_a (__class, __t<br>); __r; }))))</span></span> (<span class='macro'>G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT_XSMP)<span class='macro_popup'>((__extension__ ({ GTypeClass *__class = (GTypeClass*) ((klass<br>)); GType __t = ((egg_sm_client_xsmp_get_type ())); gboolean __r<br>; if (!__class) __r = (0); else if (__class->g_type == __t<br>) __r = (!(0)); else __r = g_type_check_class_is_a (__class, __t<br>); __r; })))</span></span>)</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='directive'>#define <span class='macro'>EGG_SM_CLIENT_XSMP_GET_CLASS(obj)<span class='macro_popup'>((((EggSMClientXSMPClass*) (((GTypeInstance*) ((obj)))->g_class<br>))))</span></span> (<span class='macro'>G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMPClass)<span class='macro_popup'>(((EggSMClientXSMPClass*) (((GTypeInstance*) ((obj)))->g_class<br>)))</span></span>)</span></td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span> _EggSMClientXSMP EggSMClientXSMP;</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span> _EggSMClientXSMPClass EggSMClientXSMPClass;</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"><span class='comment'>/* These mostly correspond to the similarly-named states in section</span></td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> <span class='comment'>* 9.1 of the XSMP spec. Some of the states there aren't represented</span></td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> <span class='comment'>* here, because we don't need them. SHUTDOWN_CANCELLED is slightly</span></td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> <span class='comment'>* different from the spec; we use it when the client is IDLE after a</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> <span class='comment'>* ShutdownCancelled message, but the application is still interacting</span></td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> <span class='comment'>* and doesn't know the shutdown has been cancelled yet.</span></td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>enum</span></td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> XSMP_STATE_IDLE,</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> XSMP_STATE_SAVE_YOURSELF,</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> XSMP_STATE_INTERACT_REQUEST,</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> XSMP_STATE_INTERACT,</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> XSMP_STATE_SAVE_YOURSELF_DONE,</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> XSMP_STATE_SHUTDOWN_CANCELLED,</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> XSMP_STATE_CONNECTION_CLOSED</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">} EggSMClientXSMPState;</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>const</span> <span class='keyword'>char</span> *state_names[] =</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> <span class='string_literal'>"idle"</span>,</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> <span class='string_literal'>"save-yourself"</span>,</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> <span class='string_literal'>"interact-request"</span>,</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> <span class='string_literal'>"interact"</span>,</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"> <span class='string_literal'>"save-yourself-done"</span>,</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> <span class='string_literal'>"shutdown-cancelled"</span>,</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> <span class='string_literal'>"connection-closed"</span></td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"><span class='directive'>#define <span class='macro'>EGG_SM_CLIENT_XSMP_STATE(xsmp)<span class='macro_popup'>(state_names[(xsmp)->state])</span></span> (state_names[(xsmp)->state])</span></td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"><span class='keyword'>struct</span> _EggSMClientXSMP</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> EggSMClient parent;</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> SmcConn connection;</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> <span class='keyword'>char</span> *client_id;</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> EggSMClientXSMPState state;</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> <span class='keyword'>char</span> **restart_command;</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> gboolean set_restart_command;</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> <span class='keyword'>int</span> restart_style;</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> <span class='keyword'>char</span> **discard_command;</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> gboolean set_discard_command;</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> guint idle;</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> <span class='comment'>/* Current SaveYourself state */</span></td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> guint expecting_initial_save_yourself : 1;</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> guint need_save_state : 1;</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> guint need_quit_requested : 1;</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> guint interact_errors : 1;</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> guint shutting_down : 1;</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='comment'>/* Todo list */</span></td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> guint waiting_to_set_initial_properties : 1;</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> guint waiting_to_emit_quit : 1;</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> guint waiting_to_emit_quit_cancelled : 1;</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> guint waiting_to_save_myself : 1;</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"><span class='keyword'>struct</span> _EggSMClientXSMPClass</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> EggSMClientClass parent_class;</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> sm_client_xsmp_startup (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *client_id);</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> sm_client_xsmp_set_restart_command (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> <span class='keyword'>int</span> argc,</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> **argv);</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> sm_client_xsmp_set_discard_command (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> <span class='keyword'>int</span> argc,</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> **argv);</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> sm_client_xsmp_will_quit (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> gboolean will_quit);</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"><span class='keyword'>static</span> gboolean sm_client_xsmp_end_session (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> EggSMClientEndStyle style,</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> gboolean request_confirmation);</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> xsmp_save_yourself (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> SmPointer client_data,</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> <span class='keyword'>int</span> save_style,</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> shutdown,</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> <span class='keyword'>int</span> interact_style,</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> fast);</td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> xsmp_die (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> SmPointer client_data);</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> xsmp_save_complete (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> SmPointer client_data);</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> xsmp_shutdown_cancelled (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> SmPointer client_data);</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> xsmp_interact (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> SmPointer client_data);</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"><span class='keyword'>static</span> SmProp *array_prop (<span class='keyword'>const</span> <span class='keyword'>char</span> *name,</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> ...);</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"><span class='keyword'>static</span> SmProp *ptrarray_prop (<span class='keyword'>const</span> <span class='keyword'>char</span> *name,</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> GPtrArray *values);</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"><span class='keyword'>static</span> SmProp *string_prop (<span class='keyword'>const</span> <span class='keyword'>char</span> *name,</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *value);</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"><span class='keyword'>static</span> SmProp *card8_prop (<span class='keyword'>const</span> <span class='keyword'>char</span> *name,</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>char</span> value);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> set_properties (EggSMClientXSMP *xsmp, ...);</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> delete_properties (EggSMClientXSMP *xsmp, ...);</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"><span class='keyword'>static</span> GPtrArray *generate_command (<span class='keyword'>char</span> **restart_command,</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *client_id,</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *state_file);</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> save_state (EggSMClientXSMP *xsmp);</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> do_save_yourself (EggSMClientXSMP *xsmp);</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> update_pending_events (EggSMClientXSMP *xsmp);</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> ice_init (<span class='keyword'>void</span>);</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"><span class='keyword'>static</span> gboolean process_ice_messages (IceConn ice_conn);</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> smc_error_handler (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> swap,</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> <span class='keyword'>int</span> offending_minor_opcode,</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>long</span> offending_sequence,</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>int</span> error_class,</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='keyword'>int</span> severity,</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> SmPointer values);</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"><span class='macro'>G_DEFINE_TYPE (EggSMClientXSMP, egg_sm_client_xsmp, EGG_TYPE_SM_CLIENT)<span class='macro_popup'>static void egg_sm_client_xsmp_init (EggSMClientXSMP *self); static<br> void egg_sm_client_xsmp_class_init (EggSMClientXSMPClass *klass<br>); static GType egg_sm_client_xsmp_get_type_once (void); static<br> gpointer egg_sm_client_xsmp_parent_class = ((void*)0); static<br> gint EggSMClientXSMP_private_offset; static void egg_sm_client_xsmp_class_intern_init<br> (gpointer klass) { egg_sm_client_xsmp_parent_class = g_type_class_peek_parent<br> (klass); if (EggSMClientXSMP_private_offset != 0) g_type_class_adjust_private_offset<br> (klass, &EggSMClientXSMP_private_offset); egg_sm_client_xsmp_class_init<br> ((EggSMClientXSMPClass*) klass); } __attribute__ ((__unused__<br>)) static inline gpointer egg_sm_client_xsmp_get_instance_private<br> (EggSMClientXSMP *self) { return (((gpointer) ((guint8*) (self<br>) + (glong) (EggSMClientXSMP_private_offset)))); } GType egg_sm_client_xsmp_get_type<br> (void) { static GType static_g_define_type_id = 0; if ((__extension__<br> ({ _Static_assert (sizeof *(&static_g_define_type_id) ==<br> sizeof (gpointer), "Expression evaluates to false"); (void) (<br>0 ? (gpointer) * (&static_g_define_type_id) : ((void*)0))<br>; (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); __typeof__<br> (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__<br> ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id<br>); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)<br>; gapg_temp_newval; })) && g_once_init_enter_pointer (<br>&static_g_define_type_id)); })) ) { GType g_define_type_id<br> = egg_sm_client_xsmp_get_type_once (); (__extension__ ({ _Static_assert<br> (sizeof *(&static_g_define_type_id) == sizeof (gpointer)<br>, "Expression evaluates to false"); 0 ? (void) (*(&static_g_define_type_id<br>) = (g_define_type_id)) : (void) 0; g_once_init_leave_pointer<br> ((&static_g_define_type_id), (gpointer) (guintptr) (g_define_type_id<br>)); })) ; } return static_g_define_type_id; } __attribute__ (<br>(__noinline__)) static GType egg_sm_client_xsmp_get_type_once<br> (void) { GType g_define_type_id = g_type_register_static_simple<br> ((egg_sm_client_get_type ()), g_intern_static_string ("EggSMClientXSMP"<br>), sizeof (EggSMClientXSMPClass), (GClassInitFunc)(void (*)(void<br>)) egg_sm_client_xsmp_class_intern_init, sizeof (EggSMClientXSMP<br>), (GInstanceInitFunc)(void (*)(void)) egg_sm_client_xsmp_init<br>, (GTypeFlags) 0); { {{};} } return g_define_type_id; }</span></span></td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line">egg_sm_client_xsmp_init (EggSMClientXSMP *xsmp)</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> xsmp->state = XSMP_STATE_CONNECTION_CLOSED;</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> xsmp->connection = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> xsmp->restart_style = <span class='macro'>SmRestartIfRunning<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line">egg_sm_client_xsmp_class_init (EggSMClientXSMPClass *klass)</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> EggSMClientClass *sm_client_class = EGG_SM_CLIENT_CLASS (klass);</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> sm_client_class->startup = sm_client_xsmp_startup;</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> sm_client_class->set_restart_command = sm_client_xsmp_set_restart_command;</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> sm_client_class->set_discard_command = sm_client_xsmp_set_discard_command;</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> sm_client_class->will_quit = sm_client_xsmp_will_quit;</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> sm_client_class->end_session = sm_client_xsmp_end_session;</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">EggSMClient *</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line">egg_sm_client_xsmp_new (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='keyword'>if</span> (!g_getenv (<span class='string_literal'>"SESSION_MANAGER"</span>))</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> <span class='keyword'>return</span> g_object_new (<span class='macro'>EGG_TYPE_SM_CLIENT_XSMP<span class='macro_popup'>(egg_sm_client_xsmp_get_type ())</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line">sm_client_xsmp_set_initial_properties (gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> EggSMClientXSMP *xsmp = user_data;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> EggDesktopFile *desktop_file;</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> GPtrArray *clone, *restart;</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> <span class='keyword'>char</span> pid_str[64];</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='keyword'>if</span> (xsmp->idle)</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> g_source_remove (xsmp->idle);</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> xsmp->idle = 0;</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> xsmp->waiting_to_set_initial_properties = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> <span class='keyword'>if</span> (egg_sm_client_get_mode () == EGG_SM_CLIENT_MODE_NO_RESTART)</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> xsmp->restart_style = <span class='macro'>SmRestartNever<span class='macro_popup'>3</span></span>;</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> <span class='comment'>/* Parse info out of desktop file */</span></td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> desktop_file = egg_get_desktop_file ();</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> <span class='keyword'>if</span> (desktop_file)</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> GError *err = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> <span class='keyword'>char</span> **argv;</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='keyword'>int</span> argc;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> <span class='keyword'>if</span> (xsmp->restart_style == <span class='macro'>SmRestartIfRunning<span class='macro_popup'>0</span></span>)</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>if</span> (egg_desktop_file_get_boolean (desktop_file,</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> <span class='string_literal'>"X-MATE-AutoRestart"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>))</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> xsmp->restart_style = <span class='macro'>SmRestartImmediately<span class='macro_popup'>2</span></span>;</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> <span class='keyword'>if</span> (!xsmp->set_restart_command)</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> <span class='keyword'>char</span> *cmdline;</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> cmdline = egg_desktop_file_parse_exec (desktop_file, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &err);</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> <span class='keyword'>if</span> (cmdline && g_shell_parse_argv (cmdline, &argc, &argv, &err))</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> egg_sm_client_set_restart_command (EGG_SM_CLIENT (xsmp),</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> argc, (<span class='keyword'>const</span> <span class='keyword'>char</span> **)argv);</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> g_strfreev (argv);</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> g_warning (<span class='string_literal'>"Could not parse Exec line in desktop file: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> err->message);</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> g_error_free (err);</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> g_free (cmdline);</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> <span class='keyword'>if</span> (!xsmp->set_restart_command)</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> xsmp->restart_command = g_strsplit (g_get_prgname (), <span class='string_literal'>" "</span>, -1);</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> clone = generate_command (xsmp->restart_command, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> restart = generate_command (xsmp->restart_command, xsmp->client_id, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> g_debug (<span class='string_literal'>"Setting initial properties"</span>);</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> <span class='comment'>/* Program, CloneCommand, RestartCommand, and UserID are required.</span></td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> <span class='comment'>* ProcessID isn't required, but the SM may be able to do something</span></td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='comment'>* useful with it.</span></td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> g_snprintf (pid_str, <span class='keyword'>sizeof</span> (pid_str), <span class='string_literal'>"%lu"</span>, (gulong) getpid ());</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> set_properties (xsmp,</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> string_prop (<span class='macro'>SmProgram<span class='macro_popup'>"Program"</span></span>, g_get_prgname ()),</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> ptrarray_prop (<span class='macro'>SmCloneCommand<span class='macro_popup'>"CloneCommand"</span></span>, clone),</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> ptrarray_prop (<span class='macro'>SmRestartCommand<span class='macro_popup'>"RestartCommand"</span></span>, restart),</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> string_prop (<span class='macro'>SmUserID<span class='macro_popup'>"UserID"</span></span>, g_get_user_name ()),</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> string_prop (<span class='macro'>SmProcessID<span class='macro_popup'>"ProcessID"</span></span>, pid_str),</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> card8_prop (<span class='macro'>SmRestartStyleHint<span class='macro_popup'>"RestartStyleHint"</span></span>, xsmp->restart_style),</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> g_ptr_array_free (clone, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> g_ptr_array_free (restart, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> <span class='keyword'>if</span> (desktop_file)</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> set_properties (xsmp,</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> string_prop (<span class='string_literal'>"_GSM_DesktopFile"</span>, egg_desktop_file_get_source (desktop_file)),</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> update_pending_events (xsmp);</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"><span class='comment'>/* This gets called from two different places: xsmp_die() (when the</span></td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> <span class='comment'>* server asks us to disconnect) and process_ice_messages() (when the</span></td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> <span class='comment'>* server disconnects unexpectedly).</span></td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line">sm_client_xsmp_disconnect (EggSMClientXSMP *xsmp)</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> SmcConn connection;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> <span class='keyword'>if</span> (!xsmp->connection)</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> g_debug (<span class='string_literal'>"Disconnecting"</span>);</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> connection = xsmp->connection;</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> xsmp->connection = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> SmcCloseConnection (connection, 0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> xsmp->state = XSMP_STATE_CONNECTION_CLOSED;</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> xsmp->waiting_to_save_myself = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> update_pending_events (xsmp);</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line">sm_client_xsmp_startup (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *client_id)</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> SmcCallbacks callbacks;</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>char</span> *ret_client_id;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> <span class='keyword'>char</span> error_string_ret[256];</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> xsmp->client_id = <span class='macro'>g_strdup (client_id)<span class='macro_popup'>g_strdup_inline (client_id)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> ice_init ();</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> SmcSetErrorHandler (smc_error_handler);</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> callbacks.save_yourself.callback = xsmp_save_yourself;</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> callbacks.die.callback = xsmp_die;</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> callbacks.save_complete.callback = xsmp_save_complete;</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> callbacks.shutdown_cancelled.callback = xsmp_shutdown_cancelled;</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> callbacks.save_yourself.client_data = xsmp;</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> callbacks.die.client_data = xsmp;</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> callbacks.save_complete.client_data = xsmp;</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> callbacks.shutdown_cancelled.client_data = xsmp;</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> client_id = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> error_string_ret[0] = '\0';</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> xsmp->connection =</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> SmcOpenConnection (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, xsmp, <span class='macro'>SmProtoMajor<span class='macro_popup'>1</span></span>, <span class='macro'>SmProtoMinor<span class='macro_popup'>0</span></span>,</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='macro'>SmcSaveYourselfProcMask<span class='macro_popup'>(1L << 0)</span></span> | <span class='macro'>SmcDieProcMask<span class='macro_popup'>(1L << 1)</span></span> |</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='macro'>SmcSaveCompleteProcMask<span class='macro_popup'>(1L << 2)</span></span> |</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='macro'>SmcShutdownCancelledProcMask<span class='macro_popup'>(1L << 3)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> &callbacks,</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> xsmp->client_id, &ret_client_id,</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='keyword'>sizeof</span> (error_string_ret), error_string_ret);</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='keyword'>if</span> (!xsmp->connection)</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> g_warning (<span class='string_literal'>"Failed to connect to the session manager: %s\n"</span>,</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> error_string_ret[0] ?</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> error_string_ret : <span class='string_literal'>"no error message given"</span>);</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> xsmp->state = XSMP_STATE_CONNECTION_CLOSED;</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='comment'>/* We expect a pointless initial SaveYourself if either (a) we</span></td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> <span class='comment'>* didn't have an initial client ID, or (b) we DID have an initial</span></td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> <span class='comment'>* client ID, but the server rejected it and gave us a new one.</span></td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>if</span> (!xsmp->client_id ||</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> (ret_client_id && strcmp (xsmp->client_id, ret_client_id) != 0))</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> xsmp->expecting_initial_save_yourself = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>if</span> (ret_client_id)</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> g_free (xsmp->client_id);</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> xsmp->client_id = <span class='macro'>g_strdup (ret_client_id)<span class='macro_popup'>g_strdup_inline (ret_client_id)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> free (ret_client_id);</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"><span class='directive'>#ifdef GDK_WINDOWING_X11</span></td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>GDK_IS_X11_DISPLAY (gdk_display_get_default ())<span class='macro_popup'>(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (<br>(gdk_display_get_default ())); GType __t = ((gdk_x11_display_get_type<br>())); gboolean __r; if (!__inst) __r = (0); else if (__inst-><br>g_class && __inst->g_class->g_type == __t) __r =<br> (!(0)); else __r = g_type_check_instance_is_a (__inst, __t);<br> __r; }))))</span></span>)</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> gdk_x11_set_sm_client_id (xsmp->client_id);</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> g_debug (<span class='string_literal'>"Got client ID \"%s\""</span>, xsmp->client_id);</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> xsmp->state = XSMP_STATE_IDLE;</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='comment'>/* Do not set the initial properties until we reach the main loop,</span></td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> <span class='comment'>* so that the application has a chance to call</span></td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> <span class='comment'>* egg_set_desktop_file(). (This may also help the session manager</span></td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> <span class='comment'>* have a better idea of when the application is fully up and</span></td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> <span class='comment'>* running.)</span></td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> xsmp->waiting_to_set_initial_properties = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> xsmp->idle = g_idle_add (sm_client_xsmp_set_initial_properties, client);</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line">sm_client_xsmp_set_restart_command (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> <span class='keyword'>int</span> argc,</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> **argv)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client;</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> g_strfreev (xsmp->restart_command);</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> xsmp->restart_command = <span class='macro'>g_new (<span class='keyword'>char</span> *, argc + 1)<span class='macro_popup'>((char * *) g_malloc_n ((argc + 1), sizeof (char *)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < argc; i++)</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> xsmp->restart_command[i] = <span class='macro'>g_strdup (argv[i])<span class='macro_popup'>g_strdup_inline (argv[i])</span></span>;</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> xsmp->restart_command[i] = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> xsmp->set_restart_command = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line">sm_client_xsmp_set_discard_command (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> <span class='keyword'>int</span> argc,</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> **argv)</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client;</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> g_strfreev (xsmp->discard_command);</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> xsmp->discard_command = <span class='macro'>g_new (<span class='keyword'>char</span> *, argc + 1)<span class='macro_popup'>((char * *) g_malloc_n ((argc + 1), sizeof (char *)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < argc; i++)</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> xsmp->discard_command[i] = <span class='macro'>g_strdup (argv[i])<span class='macro_popup'>g_strdup_inline (argv[i])</span></span>;</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> xsmp->discard_command[i] = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> xsmp->set_discard_command = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line">sm_client_xsmp_will_quit (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> gboolean will_quit)</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client;</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> <span class='keyword'>if</span> (xsmp->state == XSMP_STATE_CONNECTION_CLOSED)</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> <span class='comment'>/* The session manager has already exited! Schedule a quit</span></td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> <span class='comment'>* signal.</span></td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> xsmp->waiting_to_emit_quit = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> update_pending_events (xsmp);</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED)</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> <span class='comment'>/* We received a ShutdownCancelled message while the application</span></td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> <span class='comment'>* was interacting; Schedule a quit_cancelled signal.</span></td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> xsmp->waiting_to_emit_quit_cancelled = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> update_pending_events (xsmp);</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> <span class='macro'>g_return_if_fail (xsmp->state == XSMP_STATE_INTERACT)<span class='macro_popup'>do { if ((xsmp->state == XSMP_STATE_INTERACT)) { } else { g_return_if_fail_warning<br> ("EggSMClient", ((const char*) (__func__)), "xsmp->state == XSMP_STATE_INTERACT"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> g_debug (<span class='string_literal'>"Sending InteractDone(%s)"</span>, will_quit ? <span class='string_literal'>"False"</span> : <span class='string_literal'>"True"</span>);</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> SmcInteractDone (xsmp->connection, !will_quit);</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>if</span> (will_quit && xsmp->need_save_state)</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> save_state (xsmp);</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> g_debug (<span class='string_literal'>"Sending SaveYourselfDone(%s)"</span>, will_quit ? <span class='string_literal'>"True"</span> : <span class='string_literal'>"False"</span>);</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> SmcSaveYourselfDone (xsmp->connection, will_quit);</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE;</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line">sm_client_xsmp_end_session (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> EggSMClientEndStyle style,</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> gboolean request_confirmation)</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client;</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> <span class='keyword'>int</span> save_type;</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> <span class='comment'>/* To end the session via XSMP, we have to send a</span></td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> <span class='comment'>* SaveYourselfRequest. We aren't allowed to do that if anything</span></td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> <span class='comment'>* else is going on, but we don't want to expose this fact to the</span></td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> <span class='comment'>* application. So we do our best to patch things up here...</span></td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> <span class='comment'>* In the worst case, this method might block for some length of</span></td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> <span class='comment'>* time in process_ice_messages, but the only time that code path is</span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> <span class='comment'>* honestly likely to get hit is if the application tries to end the</span></td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> <span class='comment'>* session as the very first thing it does, in which case it</span></td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> <span class='comment'>* probably won't actually block anyway. It's not worth gunking up</span></td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> <span class='comment'>* the API to try to deal nicely with the other 0.01% of cases where</span></td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> <span class='comment'>* this happens.</span></td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> <span class='keyword'>while</span> (xsmp->state != XSMP_STATE_IDLE ||</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> xsmp->expecting_initial_save_yourself)</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> <span class='comment'>/* If we're already shutting down, we don't need to do anything. */</span></td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> <span class='keyword'>if</span> (xsmp->shutting_down)</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> <span class='keyword'>switch</span> (xsmp->state)</td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> <span class='keyword'>case</span> XSMP_STATE_CONNECTION_CLOSED:</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>case</span> XSMP_STATE_SAVE_YOURSELF:</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> <span class='comment'>/* Trying to log out from the save_state callback? Whatever.</span></td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> <span class='comment'>* Abort the save_state.</span></td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> SmcSaveYourselfDone (xsmp->connection, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE;</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> <span class='keyword'>case</span> XSMP_STATE_INTERACT_REQUEST:</td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>case</span> XSMP_STATE_INTERACT:</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> <span class='keyword'>case</span> XSMP_STATE_SHUTDOWN_CANCELLED:</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> <span class='comment'>/* Already in a shutdown-related state, just ignore</span></td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> <span class='comment'>* the new shutdown request...</span></td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='keyword'>case</span> XSMP_STATE_IDLE:</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='keyword'>if</span> (xsmp->waiting_to_set_initial_properties)</td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> sm_client_xsmp_set_initial_properties (xsmp);</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> <span class='keyword'>if</span> (!xsmp->expecting_initial_save_yourself)</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> <span class='comment'>/* else fall through */</span></td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> <span class='keyword'>case</span> XSMP_STATE_SAVE_YOURSELF_DONE:</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> <span class='comment'>/* We need to wait for some response from the server.*/</span></td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> process_ice_messages (SmcGetIceConnection (xsmp->connection));</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> <span class='comment'>/* Hm... shouldn't happen */</span></td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> <span class='comment'>/* xfce4-session will do the wrong thing if we pass SmSaveGlobal and</span></td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='comment'>* the user chooses to save the session. But mate-session will do</span></td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> <span class='comment'>* the wrong thing if we pass SmSaveBoth and the user chooses NOT to</span></td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> <span class='comment'>* save the session... Sigh.</span></td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> <span class='keyword'>if</span> (!strcmp (SmcVendor (xsmp->connection), <span class='string_literal'>"xfce4-session"</span>))</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> save_type = <span class='macro'>SmSaveBoth<span class='macro_popup'>2</span></span>;</td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> save_type = <span class='macro'>SmSaveGlobal<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> g_debug (<span class='string_literal'>"Sending SaveYourselfRequest(SmSaveGlobal, Shutdown, SmInteractStyleAny, %sFast)"</span>, request_confirmation ? <span class='string_literal'>"!"</span> : <span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> SmcRequestSaveYourself (xsmp->connection,</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> save_type,</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> <span class='macro'>True<span class='macro_popup'>1</span></span>, <span class='comment'>/* shutdown */</span></td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> <span class='macro'>SmInteractStyleAny<span class='macro_popup'>2</span></span>,</td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> !request_confirmation, <span class='comment'>/* fast */</span></td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='macro'>True<span class='macro_popup'>1</span></span> <span class='comment'>/* global */</span>);</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line">idle_do_pending_events (gpointer data)</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> EggSMClientXSMP *xsmp = data;</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> EggSMClient *client = data;</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> xsmp->idle = 0;</td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> <span class='keyword'>if</span> (xsmp->waiting_to_emit_quit)</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> xsmp->waiting_to_emit_quit = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> egg_sm_client_quit (client);</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>if</span> (xsmp->waiting_to_emit_quit_cancelled)</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> xsmp->waiting_to_emit_quit_cancelled = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> egg_sm_client_quit_cancelled (client);</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> xsmp->state = XSMP_STATE_IDLE;</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>if</span> (xsmp->waiting_to_save_myself)</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> xsmp->waiting_to_save_myself = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> do_save_yourself (xsmp);</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line">update_pending_events (EggSMClientXSMP *xsmp)</td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> gboolean want_idle =</td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> xsmp->waiting_to_emit_quit ||</td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> xsmp->waiting_to_emit_quit_cancelled ||</td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> xsmp->waiting_to_save_myself;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> <span class='keyword'>if</span> (want_idle)</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> <span class='keyword'>if</span> (xsmp->idle == 0)</td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> xsmp->idle = g_idle_add (idle_do_pending_events, xsmp);</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> <span class='keyword'>if</span> (xsmp->idle != 0)</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> g_source_remove (xsmp->idle);</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> xsmp->idle = 0;</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line">fix_broken_state (EggSMClientXSMP *xsmp, <span class='keyword'>const</span> <span class='keyword'>char</span> *message,</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> gboolean send_interact_done,</td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> gboolean send_save_yourself_done)</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> g_warning (<span class='string_literal'>"Received XSMP %s message in state %s: client or server error"</span>,</td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"> message, <span class='macro'>EGG_SM_CLIENT_XSMP_STATE (xsmp)<span class='macro_popup'>(state_names[(xsmp)->state])</span></span>);</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line"> <span class='comment'>/* Forget any pending SaveYourself plans we had */</span></td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> xsmp->waiting_to_save_myself = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> update_pending_events (xsmp);</td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> <span class='keyword'>if</span> (send_interact_done)</td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> SmcInteractDone (xsmp->connection, <span class='macro'>False<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> <span class='keyword'>if</span> (send_save_yourself_done)</td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> SmcSaveYourselfDone (xsmp->connection, <span class='macro'>True<span class='macro_popup'>1</span></span>);</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> xsmp->state = send_save_yourself_done ? XSMP_STATE_SAVE_YOURSELF_DONE : XSMP_STATE_IDLE;</td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"><span class='comment'>/* SM callbacks */</span></td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line">xsmp_save_yourself (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> SmPointer client_data,</td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> <span class='keyword'>int</span> save_type,</td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> shutdown,</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> <span class='keyword'>int</span> interact_style,</td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> fast)</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> EggSMClientXSMP *xsmp = client_data;</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> gboolean wants_quit_requested;</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"> g_debug (<span class='string_literal'>"Received SaveYourself(%s, %s, %s, %s) in state %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> save_type == <span class='macro'>SmSaveLocal<span class='macro_popup'>1</span></span> ? <span class='string_literal'>"SmSaveLocal"</span> :</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> save_type == <span class='macro'>SmSaveGlobal<span class='macro_popup'>0</span></span> ? <span class='string_literal'>"SmSaveGlobal"</span> : <span class='string_literal'>"SmSaveBoth"</span>,</td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> shutdown ? <span class='string_literal'>"Shutdown"</span> : <span class='string_literal'>"!Shutdown"</span>,</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line"> interact_style == <span class='macro'>SmInteractStyleAny<span class='macro_popup'>2</span></span> ? <span class='string_literal'>"SmInteractStyleAny"</span> :</td></tr> +<tr class="codeline" data-linenumber="657"><td class="num" id="LN657">657</td><td class="line"> interact_style == <span class='macro'>SmInteractStyleErrors<span class='macro_popup'>1</span></span> ? <span class='string_literal'>"SmInteractStyleErrors"</span> :</td></tr> +<tr class="codeline" data-linenumber="658"><td class="num" id="LN658">658</td><td class="line"> <span class='string_literal'>"SmInteractStyleNone"</span>, fast ? <span class='string_literal'>"Fast"</span> : <span class='string_literal'>"!Fast"</span>,</td></tr> +<tr class="codeline" data-linenumber="659"><td class="num" id="LN659">659</td><td class="line"> <span class='macro'>EGG_SM_CLIENT_XSMP_STATE (xsmp)<span class='macro_popup'>(state_names[(xsmp)->state])</span></span>);</td></tr> +<tr class="codeline" data-linenumber="660"><td class="num" id="LN660">660</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="661"><td class="num" id="LN661">661</td><td class="line"> <span class='keyword'>if</span> (xsmp->state != XSMP_STATE_IDLE &&</td></tr> +<tr class="codeline" data-linenumber="662"><td class="num" id="LN662">662</td><td class="line"> xsmp->state != XSMP_STATE_SHUTDOWN_CANCELLED)</td></tr> +<tr class="codeline" data-linenumber="663"><td class="num" id="LN663">663</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="664"><td class="num" id="LN664">664</td><td class="line"> fix_broken_state (xsmp, <span class='string_literal'>"SaveYourself"</span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="665"><td class="num" id="LN665">665</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="666"><td class="num" id="LN666">666</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="667"><td class="num" id="LN667">667</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="668"><td class="num" id="LN668">668</td><td class="line"> <span class='keyword'>if</span> (xsmp->waiting_to_set_initial_properties)</td></tr> +<tr class="codeline" data-linenumber="669"><td class="num" id="LN669">669</td><td class="line"> sm_client_xsmp_set_initial_properties (xsmp);</td></tr> +<tr class="codeline" data-linenumber="670"><td class="num" id="LN670">670</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="671"><td class="num" id="LN671">671</td><td class="line"> <span class='comment'>/* If this is the initial SaveYourself, ignore it; we've already set</span></td></tr> +<tr class="codeline" data-linenumber="672"><td class="num" id="LN672">672</td><td class="line"> <span class='comment'>* properties and there's no reason to actually save state too.</span></td></tr> +<tr class="codeline" data-linenumber="673"><td class="num" id="LN673">673</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="674"><td class="num" id="LN674">674</td><td class="line"> <span class='keyword'>if</span> (xsmp->expecting_initial_save_yourself)</td></tr> +<tr class="codeline" data-linenumber="675"><td class="num" id="LN675">675</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="676"><td class="num" id="LN676">676</td><td class="line"> xsmp->expecting_initial_save_yourself = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="677"><td class="num" id="LN677">677</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="678"><td class="num" id="LN678">678</td><td class="line"> <span class='keyword'>if</span> (save_type == <span class='macro'>SmSaveLocal<span class='macro_popup'>1</span></span> &&</td></tr> +<tr class="codeline" data-linenumber="679"><td class="num" id="LN679">679</td><td class="line"> interact_style == <span class='macro'>SmInteractStyleNone<span class='macro_popup'>0</span></span> &&</td></tr> +<tr class="codeline" data-linenumber="680"><td class="num" id="LN680">680</td><td class="line"> !shutdown && !fast)</td></tr> +<tr class="codeline" data-linenumber="681"><td class="num" id="LN681">681</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="682"><td class="num" id="LN682">682</td><td class="line"> g_debug (<span class='string_literal'>"Sending SaveYourselfDone(True) for initial SaveYourself"</span>);</td></tr> +<tr class="codeline" data-linenumber="683"><td class="num" id="LN683">683</td><td class="line"> SmcSaveYourselfDone (xsmp->connection, <span class='macro'>True<span class='macro_popup'>1</span></span>);</td></tr> +<tr class="codeline" data-linenumber="684"><td class="num" id="LN684">684</td><td class="line"> <span class='comment'>/* As explained in the comment at the end of</span></td></tr> +<tr class="codeline" data-linenumber="685"><td class="num" id="LN685">685</td><td class="line"> <span class='comment'>* do_save_yourself(), SAVE_YOURSELF_DONE is the correct</span></td></tr> +<tr class="codeline" data-linenumber="686"><td class="num" id="LN686">686</td><td class="line"> <span class='comment'>* state here, not IDLE.</span></td></tr> +<tr class="codeline" data-linenumber="687"><td class="num" id="LN687">687</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="688"><td class="num" id="LN688">688</td><td class="line"> xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE;</td></tr> +<tr class="codeline" data-linenumber="689"><td class="num" id="LN689">689</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="690"><td class="num" id="LN690">690</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="691"><td class="num" id="LN691">691</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="692"><td class="num" id="LN692">692</td><td class="line"> g_warning (<span class='string_literal'>"First SaveYourself was not the expected one!"</span>);</td></tr> +<tr class="codeline" data-linenumber="693"><td class="num" id="LN693">693</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="694"><td class="num" id="LN694">694</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="695"><td class="num" id="LN695">695</td><td class="line"> <span class='comment'>/* Even ignoring the "fast" flag completely, there are still 18</span></td></tr> +<tr class="codeline" data-linenumber="696"><td class="num" id="LN696">696</td><td class="line"> <span class='comment'>* different combinations of save_type, shutdown and interact_style.</span></td></tr> +<tr class="codeline" data-linenumber="697"><td class="num" id="LN697">697</td><td class="line"> <span class='comment'>* We interpret them as follows:</span></td></tr> +<tr class="codeline" data-linenumber="698"><td class="num" id="LN698">698</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="699"><td class="num" id="LN699">699</td><td class="line"> <span class='comment'>* Type Shutdown Interact Interpretation</span></td></tr> +<tr class="codeline" data-linenumber="700"><td class="num" id="LN700">700</td><td class="line"> <span class='comment'>* G F A/E/N do nothing (1)</span></td></tr> +<tr class="codeline" data-linenumber="701"><td class="num" id="LN701">701</td><td class="line"> <span class='comment'>* G T N do nothing (1)*</span></td></tr> +<tr class="codeline" data-linenumber="702"><td class="num" id="LN702">702</td><td class="line"> <span class='comment'>* G T A/E quit_requested (2)</span></td></tr> +<tr class="codeline" data-linenumber="703"><td class="num" id="LN703">703</td><td class="line"> <span class='comment'>* L/B F A/E/N save_state (3)</span></td></tr> +<tr class="codeline" data-linenumber="704"><td class="num" id="LN704">704</td><td class="line"> <span class='comment'>* L/B T N save_state (3)*</span></td></tr> +<tr class="codeline" data-linenumber="705"><td class="num" id="LN705">705</td><td class="line"> <span class='comment'>* L/B T A/E quit_requested, then save_state (4)</span></td></tr> +<tr class="codeline" data-linenumber="706"><td class="num" id="LN706">706</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="707"><td class="num" id="LN707">707</td><td class="line"> <span class='comment'>* 1. Do nothing, because the SM asked us to do something</span></td></tr> +<tr class="codeline" data-linenumber="708"><td class="num" id="LN708">708</td><td class="line"> <span class='comment'>* uninteresting (save open files, but then don't quit</span></td></tr> +<tr class="codeline" data-linenumber="709"><td class="num" id="LN709">709</td><td class="line"> <span class='comment'>* afterward) or rude (save open files without asking the user</span></td></tr> +<tr class="codeline" data-linenumber="710"><td class="num" id="LN710">710</td><td class="line"> <span class='comment'>* for confirmation).</span></td></tr> +<tr class="codeline" data-linenumber="711"><td class="num" id="LN711">711</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="712"><td class="num" id="LN712">712</td><td class="line"> <span class='comment'>* 2. Request interaction and then emit ::quit_requested. This</span></td></tr> +<tr class="codeline" data-linenumber="713"><td class="num" id="LN713">713</td><td class="line"> <span class='comment'>* perhaps isn't quite correct for the SmInteractStyleErrors</span></td></tr> +<tr class="codeline" data-linenumber="714"><td class="num" id="LN714">714</td><td class="line"> <span class='comment'>* case, but we don't care.</span></td></tr> +<tr class="codeline" data-linenumber="715"><td class="num" id="LN715">715</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="716"><td class="num" id="LN716">716</td><td class="line"> <span class='comment'>* 3. Emit ::save_state. The SmSaveBoth SaveYourselfs in these</span></td></tr> +<tr class="codeline" data-linenumber="717"><td class="num" id="LN717">717</td><td class="line"> <span class='comment'>* rows essentially get demoted to SmSaveLocal, because their</span></td></tr> +<tr class="codeline" data-linenumber="718"><td class="num" id="LN718">718</td><td class="line"> <span class='comment'>* Global halves correspond to "do nothing".</span></td></tr> +<tr class="codeline" data-linenumber="719"><td class="num" id="LN719">719</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="720"><td class="num" id="LN720">720</td><td class="line"> <span class='comment'>* 4. Request interaction, emit ::quit_requested, and then emit</span></td></tr> +<tr class="codeline" data-linenumber="721"><td class="num" id="LN721">721</td><td class="line"> <span class='comment'>* ::save_state after interacting. This is the SmSaveBoth</span></td></tr> +<tr class="codeline" data-linenumber="722"><td class="num" id="LN722">722</td><td class="line"> <span class='comment'>* equivalent of #2, but we also promote SmSaveLocal shutdown</span></td></tr> +<tr class="codeline" data-linenumber="723"><td class="num" id="LN723">723</td><td class="line"> <span class='comment'>* SaveYourselfs to SmSaveBoth here, because we want to give</span></td></tr> +<tr class="codeline" data-linenumber="724"><td class="num" id="LN724">724</td><td class="line"> <span class='comment'>* the user a chance to save open files before quitting.</span></td></tr> +<tr class="codeline" data-linenumber="725"><td class="num" id="LN725">725</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="726"><td class="num" id="LN726">726</td><td class="line"> <span class='comment'>* (* It would be nice if we could do something useful when the</span></td></tr> +<tr class="codeline" data-linenumber="727"><td class="num" id="LN727">727</td><td class="line"> <span class='comment'>* session manager sends a SaveYourself with shutdown True and</span></td></tr> +<tr class="codeline" data-linenumber="728"><td class="num" id="LN728">728</td><td class="line"> <span class='comment'>* SmInteractStyleNone. But we can't, so we just pretend it didn't</span></td></tr> +<tr class="codeline" data-linenumber="729"><td class="num" id="LN729">729</td><td class="line"> <span class='comment'>* even tell us it was shutting down. The docs for ::quit mention</span></td></tr> +<tr class="codeline" data-linenumber="730"><td class="num" id="LN730">730</td><td class="line"> <span class='comment'>* that it might not always be preceded by ::quit_requested.)</span></td></tr> +<tr class="codeline" data-linenumber="731"><td class="num" id="LN731">731</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="732"><td class="num" id="LN732">732</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="733"><td class="num" id="LN733">733</td><td class="line"> <span class='comment'>/* As an optimization, we don't actually request interaction and</span></td></tr> +<tr class="codeline" data-linenumber="734"><td class="num" id="LN734">734</td><td class="line"> <span class='comment'>* emit ::quit_requested if the application isn't listening to the</span></td></tr> +<tr class="codeline" data-linenumber="735"><td class="num" id="LN735">735</td><td class="line"> <span class='comment'>* signal.</span></td></tr> +<tr class="codeline" data-linenumber="736"><td class="num" id="LN736">736</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="737"><td class="num" id="LN737">737</td><td class="line"> wants_quit_requested = g_signal_has_handler_pending (xsmp, g_signal_lookup (<span class='string_literal'>"quit_requested"</span>, <span class='macro'>EGG_TYPE_SM_CLIENT<span class='macro_popup'>(egg_sm_client_get_type ())</span></span>), 0, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="738"><td class="num" id="LN738">738</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="739"><td class="num" id="LN739">739</td><td class="line"> xsmp->need_save_state = (save_type != <span class='macro'>SmSaveGlobal<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="740"><td class="num" id="LN740">740</td><td class="line"> xsmp->need_quit_requested = (shutdown && wants_quit_requested &&</td></tr> +<tr class="codeline" data-linenumber="741"><td class="num" id="LN741">741</td><td class="line"> interact_style != <span class='macro'>SmInteractStyleNone<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="742"><td class="num" id="LN742">742</td><td class="line"> xsmp->interact_errors = (interact_style == <span class='macro'>SmInteractStyleErrors<span class='macro_popup'>1</span></span>);</td></tr> +<tr class="codeline" data-linenumber="743"><td class="num" id="LN743">743</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="744"><td class="num" id="LN744">744</td><td class="line"> xsmp->shutting_down = shutdown;</td></tr> +<tr class="codeline" data-linenumber="745"><td class="num" id="LN745">745</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="746"><td class="num" id="LN746">746</td><td class="line"> do_save_yourself (xsmp);</td></tr> +<tr class="codeline" data-linenumber="747"><td class="num" id="LN747">747</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="748"><td class="num" id="LN748">748</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="749"><td class="num" id="LN749">749</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="750"><td class="num" id="LN750">750</td><td class="line">do_save_yourself (EggSMClientXSMP *xsmp)</td></tr> +<tr class="codeline" data-linenumber="751"><td class="num" id="LN751">751</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="752"><td class="num" id="LN752">752</td><td class="line"> <span class='keyword'>if</span> (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED)</td></tr> +<tr class="codeline" data-linenumber="753"><td class="num" id="LN753">753</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="754"><td class="num" id="LN754">754</td><td class="line"> <span class='comment'>/* The SM cancelled a previous SaveYourself, but we haven't yet</span></td></tr> +<tr class="codeline" data-linenumber="755"><td class="num" id="LN755">755</td><td class="line"> <span class='comment'>* had a chance to tell the application, so we can't start</span></td></tr> +<tr class="codeline" data-linenumber="756"><td class="num" id="LN756">756</td><td class="line"> <span class='comment'>* processing this SaveYourself yet.</span></td></tr> +<tr class="codeline" data-linenumber="757"><td class="num" id="LN757">757</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="758"><td class="num" id="LN758">758</td><td class="line"> xsmp->waiting_to_save_myself = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="759"><td class="num" id="LN759">759</td><td class="line"> update_pending_events (xsmp);</td></tr> +<tr class="codeline" data-linenumber="760"><td class="num" id="LN760">760</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="761"><td class="num" id="LN761">761</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="762"><td class="num" id="LN762">762</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="763"><td class="num" id="LN763">763</td><td class="line"> <span class='keyword'>if</span> (xsmp->need_quit_requested)</td></tr> +<tr class="codeline" data-linenumber="764"><td class="num" id="LN764">764</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="765"><td class="num" id="LN765">765</td><td class="line"> xsmp->state = XSMP_STATE_INTERACT_REQUEST;</td></tr> +<tr class="codeline" data-linenumber="766"><td class="num" id="LN766">766</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="767"><td class="num" id="LN767">767</td><td class="line"> g_debug (<span class='string_literal'>"Sending InteractRequest(%s)"</span>,</td></tr> +<tr class="codeline" data-linenumber="768"><td class="num" id="LN768">768</td><td class="line"> xsmp->interact_errors ? <span class='string_literal'>"Error"</span> : <span class='string_literal'>"Normal"</span>);</td></tr> +<tr class="codeline" data-linenumber="769"><td class="num" id="LN769">769</td><td class="line"> SmcInteractRequest (xsmp->connection,</td></tr> +<tr class="codeline" data-linenumber="770"><td class="num" id="LN770">770</td><td class="line"> xsmp->interact_errors ? <span class='macro'>SmDialogError<span class='macro_popup'>0</span></span> : <span class='macro'>SmDialogNormal<span class='macro_popup'>1</span></span>,</td></tr> +<tr class="codeline" data-linenumber="771"><td class="num" id="LN771">771</td><td class="line"> xsmp_interact,</td></tr> +<tr class="codeline" data-linenumber="772"><td class="num" id="LN772">772</td><td class="line"> xsmp);</td></tr> +<tr class="codeline" data-linenumber="773"><td class="num" id="LN773">773</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="774"><td class="num" id="LN774">774</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="775"><td class="num" id="LN775">775</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="776"><td class="num" id="LN776">776</td><td class="line"> <span class='keyword'>if</span> (xsmp->need_save_state)</td></tr> +<tr class="codeline" data-linenumber="777"><td class="num" id="LN777">777</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="778"><td class="num" id="LN778">778</td><td class="line"> save_state (xsmp);</td></tr> +<tr class="codeline" data-linenumber="779"><td class="num" id="LN779">779</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="780"><td class="num" id="LN780">780</td><td class="line"> <span class='comment'>/* Though unlikely, the client could have been disconnected</span></td></tr> +<tr class="codeline" data-linenumber="781"><td class="num" id="LN781">781</td><td class="line"> <span class='comment'>* while the application was saving its state.</span></td></tr> +<tr class="codeline" data-linenumber="782"><td class="num" id="LN782">782</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="783"><td class="num" id="LN783">783</td><td class="line"> <span class='keyword'>if</span> (!xsmp->connection)</td></tr> +<tr class="codeline" data-linenumber="784"><td class="num" id="LN784">784</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="785"><td class="num" id="LN785">785</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="786"><td class="num" id="LN786">786</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="787"><td class="num" id="LN787">787</td><td class="line"> g_debug (<span class='string_literal'>"Sending SaveYourselfDone(True)"</span>);</td></tr> +<tr class="codeline" data-linenumber="788"><td class="num" id="LN788">788</td><td class="line"> SmcSaveYourselfDone (xsmp->connection, <span class='macro'>True<span class='macro_popup'>1</span></span>);</td></tr> +<tr class="codeline" data-linenumber="789"><td class="num" id="LN789">789</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="790"><td class="num" id="LN790">790</td><td class="line"> <span class='comment'>/* The client state diagram in the XSMP spec says that after a</span></td></tr> +<tr class="codeline" data-linenumber="791"><td class="num" id="LN791">791</td><td class="line"> <span class='comment'>* non-shutdown SaveYourself, we go directly back to "idle". But</span></td></tr> +<tr class="codeline" data-linenumber="792"><td class="num" id="LN792">792</td><td class="line"> <span class='comment'>* everything else in both the XSMP spec and the libSM docs</span></td></tr> +<tr class="codeline" data-linenumber="793"><td class="num" id="LN793">793</td><td class="line"> <span class='comment'>* disagrees.</span></td></tr> +<tr class="codeline" data-linenumber="794"><td class="num" id="LN794">794</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="795"><td class="num" id="LN795">795</td><td class="line"> xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE;</td></tr> +<tr class="codeline" data-linenumber="796"><td class="num" id="LN796">796</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="797"><td class="num" id="LN797">797</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="798"><td class="num" id="LN798">798</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="799"><td class="num" id="LN799">799</td><td class="line">save_state (EggSMClientXSMP *xsmp)</td></tr> +<tr class="codeline" data-linenumber="800"><td class="num" id="LN800">800</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="801"><td class="num" id="LN801">801</td><td class="line"> GKeyFile *state_file;</td></tr> +<tr class="codeline" data-linenumber="802"><td class="num" id="LN802">802</td><td class="line"> <span class='keyword'>char</span> *state_file_path, *data;</td></tr> +<tr class="codeline" data-linenumber="803"><td class="num" id="LN803">803</td><td class="line"> EggDesktopFile *desktop_file;</td></tr> +<tr class="codeline" data-linenumber="804"><td class="num" id="LN804">804</td><td class="line"> GPtrArray *restart, *discard;</td></tr> +<tr class="codeline" data-linenumber="805"><td class="num" id="LN805">805</td><td class="line"> <span class='keyword'>int</span> offset, fd;</td></tr> +<tr class="codeline" data-linenumber="806"><td class="num" id="LN806">806</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="807"><td class="num" id="LN807">807</td><td class="line"> <span class='comment'>/* We set xsmp->state before emitting save_state, but our caller is</span></td></tr> +<tr class="codeline" data-linenumber="808"><td class="num" id="LN808">808</td><td class="line"> <span class='comment'>* responsible for setting it back afterward.</span></td></tr> +<tr class="codeline" data-linenumber="809"><td class="num" id="LN809">809</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="810"><td class="num" id="LN810">810</td><td class="line"> xsmp->state = XSMP_STATE_SAVE_YOURSELF;</td></tr> +<tr class="codeline" data-linenumber="811"><td class="num" id="LN811">811</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="812"><td class="num" id="LN812">812</td><td class="line"> state_file = egg_sm_client_save_state ((EggSMClient *)xsmp);</td></tr> +<tr class="codeline" data-linenumber="813"><td class="num" id="LN813">813</td><td class="line"> <span class='keyword'>if</span> (!state_file)</td></tr> +<tr class="codeline" data-linenumber="814"><td class="num" id="LN814">814</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="815"><td class="num" id="LN815">815</td><td class="line"> restart = generate_command (xsmp->restart_command, xsmp->client_id, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="816"><td class="num" id="LN816">816</td><td class="line"> set_properties (xsmp,</td></tr> +<tr class="codeline" data-linenumber="817"><td class="num" id="LN817">817</td><td class="line"> ptrarray_prop (<span class='macro'>SmRestartCommand<span class='macro_popup'>"RestartCommand"</span></span>, restart),</td></tr> +<tr class="codeline" data-linenumber="818"><td class="num" id="LN818">818</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="819"><td class="num" id="LN819">819</td><td class="line"> g_ptr_array_free (restart, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="820"><td class="num" id="LN820">820</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="821"><td class="num" id="LN821">821</td><td class="line"> <span class='keyword'>if</span> (xsmp->set_discard_command)</td></tr> +<tr class="codeline" data-linenumber="822"><td class="num" id="LN822">822</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="823"><td class="num" id="LN823">823</td><td class="line"> discard = generate_command (xsmp->discard_command, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="824"><td class="num" id="LN824">824</td><td class="line"> set_properties (xsmp,</td></tr> +<tr class="codeline" data-linenumber="825"><td class="num" id="LN825">825</td><td class="line"> ptrarray_prop (<span class='macro'>SmDiscardCommand<span class='macro_popup'>"DiscardCommand"</span></span>, discard),</td></tr> +<tr class="codeline" data-linenumber="826"><td class="num" id="LN826">826</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="827"><td class="num" id="LN827">827</td><td class="line"> g_ptr_array_free (discard, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="828"><td class="num" id="LN828">828</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="829"><td class="num" id="LN829">829</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="830"><td class="num" id="LN830">830</td><td class="line"> delete_properties (xsmp, <span class='macro'>SmDiscardCommand<span class='macro_popup'>"DiscardCommand"</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="831"><td class="num" id="LN831">831</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="832"><td class="num" id="LN832">832</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="833"><td class="num" id="LN833">833</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="834"><td class="num" id="LN834">834</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="835"><td class="num" id="LN835">835</td><td class="line"> desktop_file = egg_get_desktop_file ();</td></tr> +<tr class="codeline" data-linenumber="836"><td class="num" id="LN836">836</td><td class="line"> <span class='keyword'>if</span> (desktop_file)</td></tr> +<tr class="codeline" data-linenumber="837"><td class="num" id="LN837">837</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="838"><td class="num" id="LN838">838</td><td class="line"> GKeyFile *merged_file;</td></tr> +<tr class="codeline" data-linenumber="839"><td class="num" id="LN839">839</td><td class="line"> <span class='keyword'>char</span> *desktop_file_path;</td></tr> +<tr class="codeline" data-linenumber="840"><td class="num" id="LN840">840</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="841"><td class="num" id="LN841">841</td><td class="line"> merged_file = g_key_file_new ();</td></tr> +<tr class="codeline" data-linenumber="842"><td class="num" id="LN842">842</td><td class="line"> desktop_file_path =</td></tr> +<tr class="codeline" data-linenumber="843"><td class="num" id="LN843">843</td><td class="line"> g_filename_from_uri (egg_desktop_file_get_source (desktop_file),</td></tr> +<tr class="codeline" data-linenumber="844"><td class="num" id="LN844">844</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="845"><td class="num" id="LN845">845</td><td class="line"> <span class='keyword'>if</span> (desktop_file_path &&</td></tr> +<tr class="codeline" data-linenumber="846"><td class="num" id="LN846">846</td><td class="line"> g_key_file_load_from_file (merged_file, desktop_file_path,</td></tr> +<tr class="codeline" data-linenumber="847"><td class="num" id="LN847">847</td><td class="line"> G_KEY_FILE_KEEP_COMMENTS |</td></tr> +<tr class="codeline" data-linenumber="848"><td class="num" id="LN848">848</td><td class="line"> G_KEY_FILE_KEEP_TRANSLATIONS, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>))</td></tr> +<tr class="codeline" data-linenumber="849"><td class="num" id="LN849">849</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="850"><td class="num" id="LN850">850</td><td class="line"> guint g, k, i;</td></tr> +<tr class="codeline" data-linenumber="851"><td class="num" id="LN851">851</td><td class="line"> <span class='keyword'>char</span> **groups, **keys, *value, *exec;</td></tr> +<tr class="codeline" data-linenumber="852"><td class="num" id="LN852">852</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="853"><td class="num" id="LN853">853</td><td class="line"> groups = g_key_file_get_groups (state_file, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="854"><td class="num" id="LN854">854</td><td class="line"> <span class='keyword'>for</span> (g = 0; groups[g]; g++)</td></tr> +<tr class="codeline" data-linenumber="855"><td class="num" id="LN855">855</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="856"><td class="num" id="LN856">856</td><td class="line"> keys = g_key_file_get_keys (state_file, groups[g], <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="857"><td class="num" id="LN857">857</td><td class="line"> <span class='keyword'>for</span> (k = 0; keys[k]; k++)</td></tr> +<tr class="codeline" data-linenumber="858"><td class="num" id="LN858">858</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="859"><td class="num" id="LN859">859</td><td class="line"> value = g_key_file_get_value (state_file, groups[g],</td></tr> +<tr class="codeline" data-linenumber="860"><td class="num" id="LN860">860</td><td class="line"> keys[k], <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="861"><td class="num" id="LN861">861</td><td class="line"> <span class='keyword'>if</span> (value)</td></tr> +<tr class="codeline" data-linenumber="862"><td class="num" id="LN862">862</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="863"><td class="num" id="LN863">863</td><td class="line"> g_key_file_set_value (merged_file, groups[g],</td></tr> +<tr class="codeline" data-linenumber="864"><td class="num" id="LN864">864</td><td class="line"> keys[k], value);</td></tr> +<tr class="codeline" data-linenumber="865"><td class="num" id="LN865">865</td><td class="line"> g_free (value);</td></tr> +<tr class="codeline" data-linenumber="866"><td class="num" id="LN866">866</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="867"><td class="num" id="LN867">867</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="868"><td class="num" id="LN868">868</td><td class="line"> g_strfreev (keys);</td></tr> +<tr class="codeline" data-linenumber="869"><td class="num" id="LN869">869</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="870"><td class="num" id="LN870">870</td><td class="line"> g_strfreev (groups);</td></tr> +<tr class="codeline" data-linenumber="871"><td class="num" id="LN871">871</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="872"><td class="num" id="LN872">872</td><td class="line"> g_key_file_free (state_file);</td></tr> +<tr class="codeline" data-linenumber="873"><td class="num" id="LN873">873</td><td class="line"> state_file = merged_file;</td></tr> +<tr class="codeline" data-linenumber="874"><td class="num" id="LN874">874</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="875"><td class="num" id="LN875">875</td><td class="line"> <span class='comment'>/* Update Exec key using "--sm-client-state-file %k" */</span></td></tr> +<tr class="codeline" data-linenumber="876"><td class="num" id="LN876">876</td><td class="line"> restart = generate_command (xsmp->restart_command,</td></tr> +<tr class="codeline" data-linenumber="877"><td class="num" id="LN877">877</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='string_literal'>"%k"</span>);</td></tr> +<tr class="codeline" data-linenumber="878"><td class="num" id="LN878">878</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < restart->len; i++)</td></tr> +<tr class="codeline" data-linenumber="879"><td class="num" id="LN879">879</td><td class="line"> restart->pdata[i] = g_shell_quote (restart->pdata[i]);</td></tr> +<tr class="codeline" data-linenumber="880"><td class="num" id="LN880">880</td><td class="line"> g_ptr_array_add (restart, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="881"><td class="num" id="LN881">881</td><td class="line"> exec = g_strjoinv (<span class='string_literal'>" "</span>, (<span class='keyword'>char</span> **)restart->pdata);</td></tr> +<tr class="codeline" data-linenumber="882"><td class="num" id="LN882">882</td><td class="line"> g_strfreev ((<span class='keyword'>char</span> **)restart->pdata);</td></tr> +<tr class="codeline" data-linenumber="883"><td class="num" id="LN883">883</td><td class="line"> g_ptr_array_free (restart, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="884"><td class="num" id="LN884">884</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="885"><td class="num" id="LN885">885</td><td class="line"> g_key_file_set_string (state_file, <span class='macro'>EGG_DESKTOP_FILE_GROUP<span class='macro_popup'>"Desktop Entry"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="886"><td class="num" id="LN886">886</td><td class="line"> <span class='macro'>EGG_DESKTOP_FILE_KEY_EXEC<span class='macro_popup'>"Exec"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="887"><td class="num" id="LN887">887</td><td class="line"> exec);</td></tr> +<tr class="codeline" data-linenumber="888"><td class="num" id="LN888">888</td><td class="line"> g_free (exec);</td></tr> +<tr class="codeline" data-linenumber="889"><td class="num" id="LN889">889</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="890"><td class="num" id="LN890">890</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="891"><td class="num" id="LN891">891</td><td class="line"> desktop_file = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="892"><td class="num" id="LN892">892</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="893"><td class="num" id="LN893">893</td><td class="line"> g_free (desktop_file_path);</td></tr> +<tr class="codeline" data-linenumber="894"><td class="num" id="LN894">894</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="895"><td class="num" id="LN895">895</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="896"><td class="num" id="LN896">896</td><td class="line"> <span class='comment'>/* Now write state_file to disk. (We can't use mktemp(), because</span></td></tr> +<tr class="codeline" data-linenumber="897"><td class="num" id="LN897">897</td><td class="line"> <span class='comment'>* that requires the filename to end with "XXXXXX", and we want</span></td></tr> +<tr class="codeline" data-linenumber="898"><td class="num" id="LN898">898</td><td class="line"> <span class='comment'>* it to end with ".desktop".)</span></td></tr> +<tr class="codeline" data-linenumber="899"><td class="num" id="LN899">899</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="900"><td class="num" id="LN900">900</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="901"><td class="num" id="LN901">901</td><td class="line"> data = g_key_file_to_data (state_file, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="902"><td class="num" id="LN902">902</td><td class="line"> g_key_file_free (state_file);</td></tr> +<tr class="codeline" data-linenumber="903"><td class="num" id="LN903">903</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="904"><td class="num" id="LN904">904</td><td class="line"> offset = 0;</td></tr> +<tr class="codeline" data-linenumber="905"><td class="num" id="LN905">905</td><td class="line"> <span class='keyword'>while</span> (1)</td></tr> +<tr class="codeline" data-linenumber="906"><td class="num" id="LN906">906</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="907"><td class="num" id="LN907">907</td><td class="line"> state_file_path = g_strdup_printf (<span class='string_literal'>"%s%csession-state%c%s-%ld.%s"</span>,</td></tr> +<tr class="codeline" data-linenumber="908"><td class="num" id="LN908">908</td><td class="line"> g_get_user_config_dir (),</td></tr> +<tr class="codeline" data-linenumber="909"><td class="num" id="LN909">909</td><td class="line"> <span class='macro'>G_DIR_SEPARATOR<span class='macro_popup'>'/'</span></span>, <span class='macro'>G_DIR_SEPARATOR<span class='macro_popup'>'/'</span></span>,</td></tr> +<tr class="codeline" data-linenumber="910"><td class="num" id="LN910">910</td><td class="line"> g_get_prgname (),</td></tr> +<tr class="codeline" data-linenumber="911"><td class="num" id="LN911">911</td><td class="line"> (<span class='keyword'>long</span>)time (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) + offset,</td></tr> +<tr class="codeline" data-linenumber="912"><td class="num" id="LN912">912</td><td class="line"> desktop_file ? <span class='string_literal'>"desktop"</span> : <span class='string_literal'>"state"</span>);</td></tr> +<tr class="codeline" data-linenumber="913"><td class="num" id="LN913">913</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="914"><td class="num" id="LN914">914</td><td class="line"> fd = open (state_file_path, <span class='macro'>O_WRONLY<span class='macro_popup'>01</span></span> | <span class='macro'>O_CREAT<span class='macro_popup'>0100</span></span> | <span class='macro'>O_EXCL<span class='macro_popup'>0200</span></span>, 0644);</td></tr> +<tr class="codeline" data-linenumber="915"><td class="num" id="LN915">915</td><td class="line"> <span class='keyword'>if</span> (fd == -1)</td></tr> +<tr class="codeline" data-linenumber="916"><td class="num" id="LN916">916</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="917"><td class="num" id="LN917">917</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span> == <span class='macro'>EEXIST<span class='macro_popup'>17</span></span>)</td></tr> +<tr class="codeline" data-linenumber="918"><td class="num" id="LN918">918</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="919"><td class="num" id="LN919">919</td><td class="line"> offset++;</td></tr> +<tr class="codeline" data-linenumber="920"><td class="num" id="LN920">920</td><td class="line"> g_free (state_file_path);</td></tr> +<tr class="codeline" data-linenumber="921"><td class="num" id="LN921">921</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="922"><td class="num" id="LN922">922</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="923"><td class="num" id="LN923">923</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (<span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span> == <span class='macro'>ENOTDIR<span class='macro_popup'>20</span></span> || <span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span> == <span class='macro'>ENOENT<span class='macro_popup'>2</span></span>)</td></tr> +<tr class="codeline" data-linenumber="924"><td class="num" id="LN924">924</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="925"><td class="num" id="LN925">925</td><td class="line"> <span class='keyword'>char</span> *sep = strrchr (state_file_path, <span class='macro'>G_DIR_SEPARATOR<span class='macro_popup'>'/'</span></span>);</td></tr> +<tr class="codeline" data-linenumber="926"><td class="num" id="LN926">926</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="927"><td class="num" id="LN927">927</td><td class="line"> *sep = '\0';</td></tr> +<tr class="codeline" data-linenumber="928"><td class="num" id="LN928">928</td><td class="line"> <span class='keyword'>if</span> (g_mkdir_with_parents (state_file_path, 0755) != 0)</td></tr> +<tr class="codeline" data-linenumber="929"><td class="num" id="LN929">929</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="930"><td class="num" id="LN930">930</td><td class="line"> g_warning (<span class='string_literal'>"Could not create directory '%s'"</span>,</td></tr> +<tr class="codeline" data-linenumber="931"><td class="num" id="LN931">931</td><td class="line"> state_file_path);</td></tr> +<tr class="codeline" data-linenumber="932"><td class="num" id="LN932">932</td><td class="line"> g_free (state_file_path);</td></tr> +<tr class="codeline" data-linenumber="933"><td class="num" id="LN933">933</td><td class="line"> state_file_path = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="934"><td class="num" id="LN934">934</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="935"><td class="num" id="LN935">935</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="936"><td class="num" id="LN936">936</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="937"><td class="num" id="LN937">937</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="938"><td class="num" id="LN938">938</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="939"><td class="num" id="LN939">939</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="940"><td class="num" id="LN940">940</td><td class="line"> g_warning (<span class='string_literal'>"Could not create file '%s': %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="941"><td class="num" id="LN941">941</td><td class="line"> state_file_path, g_strerror (<span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span>));</td></tr> +<tr class="codeline" data-linenumber="942"><td class="num" id="LN942">942</td><td class="line"> g_free (state_file_path);</td></tr> +<tr class="codeline" data-linenumber="943"><td class="num" id="LN943">943</td><td class="line"> state_file_path = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="944"><td class="num" id="LN944">944</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="945"><td class="num" id="LN945">945</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="946"><td class="num" id="LN946">946</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="947"><td class="num" id="LN947">947</td><td class="line"> close (fd);</td></tr> +<tr class="codeline" data-linenumber="948"><td class="num" id="LN948">948</td><td class="line"> g_file_set_contents (state_file_path, data, -1, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="949"><td class="num" id="LN949">949</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="950"><td class="num" id="LN950">950</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="951"><td class="num" id="LN951">951</td><td class="line"> g_free (data);</td></tr> +<tr class="codeline" data-linenumber="952"><td class="num" id="LN952">952</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="953"><td class="num" id="LN953">953</td><td class="line"> restart = generate_command (xsmp->restart_command, xsmp->client_id,</td></tr> +<tr class="codeline" data-linenumber="954"><td class="num" id="LN954">954</td><td class="line"> state_file_path);</td></tr> +<tr class="codeline" data-linenumber="955"><td class="num" id="LN955">955</td><td class="line"> set_properties (xsmp,</td></tr> +<tr class="codeline" data-linenumber="956"><td class="num" id="LN956">956</td><td class="line"> ptrarray_prop (<span class='macro'>SmRestartCommand<span class='macro_popup'>"RestartCommand"</span></span>, restart),</td></tr> +<tr class="codeline" data-linenumber="957"><td class="num" id="LN957">957</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="958"><td class="num" id="LN958">958</td><td class="line"> g_ptr_array_free (restart, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="959"><td class="num" id="LN959">959</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="960"><td class="num" id="LN960">960</td><td class="line"> <span class='keyword'>if</span> (state_file_path)</td></tr> +<tr class="codeline" data-linenumber="961"><td class="num" id="LN961">961</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="962"><td class="num" id="LN962">962</td><td class="line"> set_properties (xsmp,</td></tr> +<tr class="codeline" data-linenumber="963"><td class="num" id="LN963">963</td><td class="line"> array_prop (<span class='macro'>SmDiscardCommand<span class='macro_popup'>"DiscardCommand"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="964"><td class="num" id="LN964">964</td><td class="line"> <span class='string_literal'>"/bin/rm"</span>, <span class='string_literal'>"-rf"</span>, state_file_path,</td></tr> +<tr class="codeline" data-linenumber="965"><td class="num" id="LN965">965</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>),</td></tr> +<tr class="codeline" data-linenumber="966"><td class="num" id="LN966">966</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="967"><td class="num" id="LN967">967</td><td class="line"> g_free (state_file_path);</td></tr> +<tr class="codeline" data-linenumber="968"><td class="num" id="LN968">968</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="969"><td class="num" id="LN969">969</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="970"><td class="num" id="LN970">970</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="971"><td class="num" id="LN971">971</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="972"><td class="num" id="LN972">972</td><td class="line">xsmp_interact (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="973"><td class="num" id="LN973">973</td><td class="line"> SmPointer client_data)</td></tr> +<tr class="codeline" data-linenumber="974"><td class="num" id="LN974">974</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="975"><td class="num" id="LN975">975</td><td class="line"> EggSMClientXSMP *xsmp = client_data;</td></tr> +<tr class="codeline" data-linenumber="976"><td class="num" id="LN976">976</td><td class="line"> EggSMClient *client = client_data;</td></tr> +<tr class="codeline" data-linenumber="977"><td class="num" id="LN977">977</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="978"><td class="num" id="LN978">978</td><td class="line"> g_debug (<span class='string_literal'>"Received Interact message in state %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="979"><td class="num" id="LN979">979</td><td class="line"> <span class='macro'>EGG_SM_CLIENT_XSMP_STATE (xsmp)<span class='macro_popup'>(state_names[(xsmp)->state])</span></span>);</td></tr> +<tr class="codeline" data-linenumber="980"><td class="num" id="LN980">980</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="981"><td class="num" id="LN981">981</td><td class="line"> <span class='keyword'>if</span> (xsmp->state != XSMP_STATE_INTERACT_REQUEST)</td></tr> +<tr class="codeline" data-linenumber="982"><td class="num" id="LN982">982</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="983"><td class="num" id="LN983">983</td><td class="line"> fix_broken_state (xsmp, <span class='string_literal'>"Interact"</span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="984"><td class="num" id="LN984">984</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="985"><td class="num" id="LN985">985</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="986"><td class="num" id="LN986">986</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="987"><td class="num" id="LN987">987</td><td class="line"> xsmp->state = XSMP_STATE_INTERACT;</td></tr> +<tr class="codeline" data-linenumber="988"><td class="num" id="LN988">988</td><td class="line"> egg_sm_client_quit_requested (client);</td></tr> +<tr class="codeline" data-linenumber="989"><td class="num" id="LN989">989</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="990"><td class="num" id="LN990">990</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="991"><td class="num" id="LN991">991</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="992"><td class="num" id="LN992">992</td><td class="line">xsmp_die (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="993"><td class="num" id="LN993">993</td><td class="line"> SmPointer client_data)</td></tr> +<tr class="codeline" data-linenumber="994"><td class="num" id="LN994">994</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="995"><td class="num" id="LN995">995</td><td class="line"> EggSMClientXSMP *xsmp = client_data;</td></tr> +<tr class="codeline" data-linenumber="996"><td class="num" id="LN996">996</td><td class="line"> EggSMClient *client = client_data;</td></tr> +<tr class="codeline" data-linenumber="997"><td class="num" id="LN997">997</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="998"><td class="num" id="LN998">998</td><td class="line"> g_debug (<span class='string_literal'>"Received Die message in state %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="999"><td class="num" id="LN999">999</td><td class="line"> <span class='macro'>EGG_SM_CLIENT_XSMP_STATE (xsmp)<span class='macro_popup'>(state_names[(xsmp)->state])</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1000"><td class="num" id="LN1000">1000</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1001"><td class="num" id="LN1001">1001</td><td class="line"> sm_client_xsmp_disconnect (xsmp);</td></tr> +<tr class="codeline" data-linenumber="1002"><td class="num" id="LN1002">1002</td><td class="line"> egg_sm_client_quit (client);</td></tr> +<tr class="codeline" data-linenumber="1003"><td class="num" id="LN1003">1003</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1004"><td class="num" id="LN1004">1004</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1005"><td class="num" id="LN1005">1005</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1006"><td class="num" id="LN1006">1006</td><td class="line">xsmp_save_complete (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="1007"><td class="num" id="LN1007">1007</td><td class="line"> SmPointer client_data)</td></tr> +<tr class="codeline" data-linenumber="1008"><td class="num" id="LN1008">1008</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1009"><td class="num" id="LN1009">1009</td><td class="line"> EggSMClientXSMP *xsmp = client_data;</td></tr> +<tr class="codeline" data-linenumber="1010"><td class="num" id="LN1010">1010</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1011"><td class="num" id="LN1011">1011</td><td class="line"> g_debug (<span class='string_literal'>"Received SaveComplete message in state %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="1012"><td class="num" id="LN1012">1012</td><td class="line"> <span class='macro'>EGG_SM_CLIENT_XSMP_STATE (xsmp)<span class='macro_popup'>(state_names[(xsmp)->state])</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1013"><td class="num" id="LN1013">1013</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1014"><td class="num" id="LN1014">1014</td><td class="line"> <span class='keyword'>if</span> (xsmp->state == XSMP_STATE_SAVE_YOURSELF_DONE)</td></tr> +<tr class="codeline" data-linenumber="1015"><td class="num" id="LN1015">1015</td><td class="line"> xsmp->state = XSMP_STATE_IDLE;</td></tr> +<tr class="codeline" data-linenumber="1016"><td class="num" id="LN1016">1016</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="1017"><td class="num" id="LN1017">1017</td><td class="line"> fix_broken_state (xsmp, <span class='string_literal'>"SaveComplete"</span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1018"><td class="num" id="LN1018">1018</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1019"><td class="num" id="LN1019">1019</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1020"><td class="num" id="LN1020">1020</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1021"><td class="num" id="LN1021">1021</td><td class="line">xsmp_shutdown_cancelled (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="1022"><td class="num" id="LN1022">1022</td><td class="line"> SmPointer client_data)</td></tr> +<tr class="codeline" data-linenumber="1023"><td class="num" id="LN1023">1023</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1024"><td class="num" id="LN1024">1024</td><td class="line"> EggSMClientXSMP *xsmp = client_data;</td></tr> +<tr class="codeline" data-linenumber="1025"><td class="num" id="LN1025">1025</td><td class="line"> EggSMClient *client = client_data;</td></tr> +<tr class="codeline" data-linenumber="1026"><td class="num" id="LN1026">1026</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1027"><td class="num" id="LN1027">1027</td><td class="line"> g_debug (<span class='string_literal'>"Received ShutdownCancelled message in state %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="1028"><td class="num" id="LN1028">1028</td><td class="line"> <span class='macro'>EGG_SM_CLIENT_XSMP_STATE (xsmp)<span class='macro_popup'>(state_names[(xsmp)->state])</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1029"><td class="num" id="LN1029">1029</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1030"><td class="num" id="LN1030">1030</td><td class="line"> xsmp->shutting_down = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1031"><td class="num" id="LN1031">1031</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1032"><td class="num" id="LN1032">1032</td><td class="line"> <span class='keyword'>if</span> (xsmp->state == XSMP_STATE_SAVE_YOURSELF_DONE)</td></tr> +<tr class="codeline" data-linenumber="1033"><td class="num" id="LN1033">1033</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1034"><td class="num" id="LN1034">1034</td><td class="line"> <span class='comment'>/* We've finished interacting and now the SM has agreed to</span></td></tr> +<tr class="codeline" data-linenumber="1035"><td class="num" id="LN1035">1035</td><td class="line"> <span class='comment'>* cancel the shutdown.</span></td></tr> +<tr class="codeline" data-linenumber="1036"><td class="num" id="LN1036">1036</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1037"><td class="num" id="LN1037">1037</td><td class="line"> xsmp->state = XSMP_STATE_IDLE;</td></tr> +<tr class="codeline" data-linenumber="1038"><td class="num" id="LN1038">1038</td><td class="line"> egg_sm_client_quit_cancelled (client);</td></tr> +<tr class="codeline" data-linenumber="1039"><td class="num" id="LN1039">1039</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1040"><td class="num" id="LN1040">1040</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED)</td></tr> +<tr class="codeline" data-linenumber="1041"><td class="num" id="LN1041">1041</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1042"><td class="num" id="LN1042">1042</td><td class="line"> <span class='comment'>/* Hm... ok, so we got a shutdown SaveYourself, which got</span></td></tr> +<tr class="codeline" data-linenumber="1043"><td class="num" id="LN1043">1043</td><td class="line"> <span class='comment'>* cancelled, but the application was still interacting, so we</span></td></tr> +<tr class="codeline" data-linenumber="1044"><td class="num" id="LN1044">1044</td><td class="line"> <span class='comment'>* didn't tell it yet, and then *another* SaveYourself arrived,</span></td></tr> +<tr class="codeline" data-linenumber="1045"><td class="num" id="LN1045">1045</td><td class="line"> <span class='comment'>* which we must still be waiting to tell the app about, except</span></td></tr> +<tr class="codeline" data-linenumber="1046"><td class="num" id="LN1046">1046</td><td class="line"> <span class='comment'>* that now that SaveYourself has been cancelled too! Dizzy yet?</span></td></tr> +<tr class="codeline" data-linenumber="1047"><td class="num" id="LN1047">1047</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1048"><td class="num" id="LN1048">1048</td><td class="line"> xsmp->waiting_to_save_myself = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1049"><td class="num" id="LN1049">1049</td><td class="line"> update_pending_events (xsmp);</td></tr> +<tr class="codeline" data-linenumber="1050"><td class="num" id="LN1050">1050</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1051"><td class="num" id="LN1051">1051</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="1052"><td class="num" id="LN1052">1052</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1053"><td class="num" id="LN1053">1053</td><td class="line"> g_debug (<span class='string_literal'>"Sending SaveYourselfDone(False)"</span>);</td></tr> +<tr class="codeline" data-linenumber="1054"><td class="num" id="LN1054">1054</td><td class="line"> SmcSaveYourselfDone (xsmp->connection, <span class='macro'>False<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1055"><td class="num" id="LN1055">1055</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1056"><td class="num" id="LN1056">1056</td><td class="line"> <span class='keyword'>if</span> (xsmp->state == XSMP_STATE_INTERACT)</td></tr> +<tr class="codeline" data-linenumber="1057"><td class="num" id="LN1057">1057</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1058"><td class="num" id="LN1058">1058</td><td class="line"> <span class='comment'>/* The application is currently interacting, so we can't</span></td></tr> +<tr class="codeline" data-linenumber="1059"><td class="num" id="LN1059">1059</td><td class="line"> <span class='comment'>* tell it about the cancellation yet; we will wait until</span></td></tr> +<tr class="codeline" data-linenumber="1060"><td class="num" id="LN1060">1060</td><td class="line"> <span class='comment'>* after it calls egg_sm_client_will_quit().</span></td></tr> +<tr class="codeline" data-linenumber="1061"><td class="num" id="LN1061">1061</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1062"><td class="num" id="LN1062">1062</td><td class="line"> xsmp->state = XSMP_STATE_SHUTDOWN_CANCELLED;</td></tr> +<tr class="codeline" data-linenumber="1063"><td class="num" id="LN1063">1063</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1064"><td class="num" id="LN1064">1064</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="1065"><td class="num" id="LN1065">1065</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1066"><td class="num" id="LN1066">1066</td><td class="line"> <span class='comment'>/* The shutdown was cancelled before the application got a</span></td></tr> +<tr class="codeline" data-linenumber="1067"><td class="num" id="LN1067">1067</td><td class="line"> <span class='comment'>* chance to interact.</span></td></tr> +<tr class="codeline" data-linenumber="1068"><td class="num" id="LN1068">1068</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1069"><td class="num" id="LN1069">1069</td><td class="line"> xsmp->state = XSMP_STATE_IDLE;</td></tr> +<tr class="codeline" data-linenumber="1070"><td class="num" id="LN1070">1070</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1071"><td class="num" id="LN1071">1071</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1072"><td class="num" id="LN1072">1072</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1073"><td class="num" id="LN1073">1073</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1074"><td class="num" id="LN1074">1074</td><td class="line"><span class='comment'>/* Utilities */</span></td></tr> +<tr class="codeline" data-linenumber="1075"><td class="num" id="LN1075">1075</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1076"><td class="num" id="LN1076">1076</td><td class="line"><span class='comment'>/* Create a restart/clone/Exec command based on @restart_command.</span></td></tr> +<tr class="codeline" data-linenumber="1077"><td class="num" id="LN1077">1077</td><td class="line"> <span class='comment'>* If @client_id is non-%NULL, add "--sm-client-id @client_id".</span></td></tr> +<tr class="codeline" data-linenumber="1078"><td class="num" id="LN1078">1078</td><td class="line"> <span class='comment'>* If @state_file is non-%NULL, add "--sm-client-state-file @state_file".</span></td></tr> +<tr class="codeline" data-linenumber="1079"><td class="num" id="LN1079">1079</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="1080"><td class="num" id="LN1080">1080</td><td class="line"> <span class='comment'>* None of the input strings are g_strdup()ed; the caller must keep</span></td></tr> +<tr class="codeline" data-linenumber="1081"><td class="num" id="LN1081">1081</td><td class="line"> <span class='comment'>* them around until it is done with the returned GPtrArray, and must</span></td></tr> +<tr class="codeline" data-linenumber="1082"><td class="num" id="LN1082">1082</td><td class="line"> <span class='comment'>* then free the array, but not its contents.</span></td></tr> +<tr class="codeline" data-linenumber="1083"><td class="num" id="LN1083">1083</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1084"><td class="num" id="LN1084">1084</td><td class="line"><span class='keyword'>static</span> GPtrArray *</td></tr> +<tr class="codeline" data-linenumber="1085"><td class="num" id="LN1085">1085</td><td class="line">generate_command (<span class='keyword'>char</span> **restart_command, <span class='keyword'>const</span> <span class='keyword'>char</span> *client_id,</td></tr> +<tr class="codeline" data-linenumber="1086"><td class="num" id="LN1086">1086</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *state_file)</td></tr> +<tr class="codeline" data-linenumber="1087"><td class="num" id="LN1087">1087</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1088"><td class="num" id="LN1088">1088</td><td class="line"> GPtrArray *cmd;</td></tr> +<tr class="codeline" data-linenumber="1089"><td class="num" id="LN1089">1089</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="1090"><td class="num" id="LN1090">1090</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1091"><td class="num" id="LN1091">1091</td><td class="line"> cmd = g_ptr_array_new ();</td></tr> +<tr class="codeline" data-linenumber="1092"><td class="num" id="LN1092">1092</td><td class="line"> g_ptr_array_add (cmd, restart_command[0]);</td></tr> +<tr class="codeline" data-linenumber="1093"><td class="num" id="LN1093">1093</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1094"><td class="num" id="LN1094">1094</td><td class="line"> <span class='keyword'>if</span> (client_id)</td></tr> +<tr class="codeline" data-linenumber="1095"><td class="num" id="LN1095">1095</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1096"><td class="num" id="LN1096">1096</td><td class="line"> g_ptr_array_add (cmd, (<span class='keyword'>char</span> *)<span class='string_literal'>"--sm-client-id"</span>);</td></tr> +<tr class="codeline" data-linenumber="1097"><td class="num" id="LN1097">1097</td><td class="line"> g_ptr_array_add (cmd, (<span class='keyword'>char</span> *)client_id);</td></tr> +<tr class="codeline" data-linenumber="1098"><td class="num" id="LN1098">1098</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1099"><td class="num" id="LN1099">1099</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1100"><td class="num" id="LN1100">1100</td><td class="line"> <span class='keyword'>if</span> (state_file)</td></tr> +<tr class="codeline" data-linenumber="1101"><td class="num" id="LN1101">1101</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1102"><td class="num" id="LN1102">1102</td><td class="line"> g_ptr_array_add (cmd, (<span class='keyword'>char</span> *)<span class='string_literal'>"--sm-client-state-file"</span>);</td></tr> +<tr class="codeline" data-linenumber="1103"><td class="num" id="LN1103">1103</td><td class="line"> g_ptr_array_add (cmd, (<span class='keyword'>char</span> *)state_file);</td></tr> +<tr class="codeline" data-linenumber="1104"><td class="num" id="LN1104">1104</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1105"><td class="num" id="LN1105">1105</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1106"><td class="num" id="LN1106">1106</td><td class="line"> <span class='keyword'>for</span> (i = 1; restart_command[i]; i++)</td></tr> +<tr class="codeline" data-linenumber="1107"><td class="num" id="LN1107">1107</td><td class="line"> g_ptr_array_add (cmd, restart_command[i]);</td></tr> +<tr class="codeline" data-linenumber="1108"><td class="num" id="LN1108">1108</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1109"><td class="num" id="LN1109">1109</td><td class="line"> <span class='keyword'>return</span> cmd;</td></tr> +<tr class="codeline" data-linenumber="1110"><td class="num" id="LN1110">1110</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1111"><td class="num" id="LN1111">1111</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1112"><td class="num" id="LN1112">1112</td><td class="line"><span class='comment'>/* Takes a NULL-terminated list of SmProp * values, created by</span></td></tr> +<tr class="codeline" data-linenumber="1113"><td class="num" id="LN1113">1113</td><td class="line"> <span class='comment'>* array_prop, ptrarray_prop, string_prop, card8_prop, sets them, and</span></td></tr> +<tr class="codeline" data-linenumber="1114"><td class="num" id="LN1114">1114</td><td class="line"> <span class='comment'>* frees them.</span></td></tr> +<tr class="codeline" data-linenumber="1115"><td class="num" id="LN1115">1115</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1116"><td class="num" id="LN1116">1116</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1117"><td class="num" id="LN1117">1117</td><td class="line">set_properties (EggSMClientXSMP *xsmp, ...)</td></tr> +<tr class="codeline" data-linenumber="1118"><td class="num" id="LN1118">1118</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1119"><td class="num" id="LN1119">1119</td><td class="line"> GPtrArray *props;</td></tr> +<tr class="codeline" data-linenumber="1120"><td class="num" id="LN1120">1120</td><td class="line"> SmProp *prop;</td></tr> +<tr class="codeline" data-linenumber="1121"><td class="num" id="LN1121">1121</td><td class="line"> va_list ap;</td></tr> +<tr class="codeline" data-linenumber="1122"><td class="num" id="LN1122">1122</td><td class="line"> guint i;</td></tr> +<tr class="codeline" data-linenumber="1123"><td class="num" id="LN1123">1123</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1124"><td class="num" id="LN1124">1124</td><td class="line"> props = g_ptr_array_new ();</td></tr> +<tr class="codeline" data-linenumber="1125"><td class="num" id="LN1125">1125</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1126"><td class="num" id="LN1126">1126</td><td class="line"> <span class='macro'>va_start (ap, xsmp)<span class='macro_popup'>__builtin_va_start(ap, xsmp)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1127"><td class="num" id="LN1127">1127</td><td class="line"> <span class='keyword'>while</span> ((prop = <span class='macro'>va_arg (ap, SmProp *)<span class='macro_popup'>__builtin_va_arg(ap, SmProp *)</span></span>))</td></tr> +<tr class="codeline" data-linenumber="1128"><td class="num" id="LN1128">1128</td><td class="line"> g_ptr_array_add (props, prop);</td></tr> +<tr class="codeline" data-linenumber="1129"><td class="num" id="LN1129">1129</td><td class="line"> <span class='macro'>va_end (ap)<span class='macro_popup'>__builtin_va_end(ap)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1130"><td class="num" id="LN1130">1130</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1131"><td class="num" id="LN1131">1131</td><td class="line"> <span class='keyword'>if</span> (xsmp->connection)</td></tr> +<tr class="codeline" data-linenumber="1132"><td class="num" id="LN1132">1132</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1133"><td class="num" id="LN1133">1133</td><td class="line"> SmcSetProperties (xsmp->connection, props->len,</td></tr> +<tr class="codeline" data-linenumber="1134"><td class="num" id="LN1134">1134</td><td class="line"> (SmProp **)props->pdata);</td></tr> +<tr class="codeline" data-linenumber="1135"><td class="num" id="LN1135">1135</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1136"><td class="num" id="LN1136">1136</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1137"><td class="num" id="LN1137">1137</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < props->len; i++)</td></tr> +<tr class="codeline" data-linenumber="1138"><td class="num" id="LN1138">1138</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1139"><td class="num" id="LN1139">1139</td><td class="line"> prop = props->pdata[i];</td></tr> +<tr class="codeline" data-linenumber="1140"><td class="num" id="LN1140">1140</td><td class="line"> g_free (prop->vals);</td></tr> +<tr class="codeline" data-linenumber="1141"><td class="num" id="LN1141">1141</td><td class="line"> g_free (prop);</td></tr> +<tr class="codeline" data-linenumber="1142"><td class="num" id="LN1142">1142</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1143"><td class="num" id="LN1143">1143</td><td class="line"> g_ptr_array_free (props, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1144"><td class="num" id="LN1144">1144</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1145"><td class="num" id="LN1145">1145</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1146"><td class="num" id="LN1146">1146</td><td class="line"><span class='comment'>/* Takes a NULL-terminated list of property names and deletes them. */</span></td></tr> +<tr class="codeline" data-linenumber="1147"><td class="num" id="LN1147">1147</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1148"><td class="num" id="LN1148">1148</td><td class="line">delete_properties (EggSMClientXSMP *xsmp, ...)</td></tr> +<tr class="codeline" data-linenumber="1149"><td class="num" id="LN1149">1149</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1150"><td class="num" id="LN1150">1150</td><td class="line"> GPtrArray *props;</td></tr> +<tr class="codeline" data-linenumber="1151"><td class="num" id="LN1151">1151</td><td class="line"> <span class='keyword'>char</span> *prop;</td></tr> +<tr class="codeline" data-linenumber="1152"><td class="num" id="LN1152">1152</td><td class="line"> va_list ap;</td></tr> +<tr class="codeline" data-linenumber="1153"><td class="num" id="LN1153">1153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1154"><td class="num" id="LN1154">1154</td><td class="line"> <span class='keyword'>if</span> (!xsmp->connection)</td></tr> +<tr class="codeline" data-linenumber="1155"><td class="num" id="LN1155">1155</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1156"><td class="num" id="LN1156">1156</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1157"><td class="num" id="LN1157">1157</td><td class="line"> props = g_ptr_array_new ();</td></tr> +<tr class="codeline" data-linenumber="1158"><td class="num" id="LN1158">1158</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1159"><td class="num" id="LN1159">1159</td><td class="line"> <span class='macro'>va_start (ap, xsmp)<span class='macro_popup'>__builtin_va_start(ap, xsmp)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1160"><td class="num" id="LN1160">1160</td><td class="line"> <span class='keyword'>while</span> ((prop = <span class='macro'>va_arg (ap, <span class='keyword'>char</span> *)<span class='macro_popup'>__builtin_va_arg(ap, char *)</span></span>))</td></tr> +<tr class="codeline" data-linenumber="1161"><td class="num" id="LN1161">1161</td><td class="line"> g_ptr_array_add (props, prop);</td></tr> +<tr class="codeline" data-linenumber="1162"><td class="num" id="LN1162">1162</td><td class="line"> <span class='macro'>va_end (ap)<span class='macro_popup'>__builtin_va_end(ap)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1163"><td class="num" id="LN1163">1163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1164"><td class="num" id="LN1164">1164</td><td class="line"> SmcDeleteProperties (xsmp->connection, props->len,</td></tr> +<tr class="codeline" data-linenumber="1165"><td class="num" id="LN1165">1165</td><td class="line"> (<span class='keyword'>char</span> **)props->pdata);</td></tr> +<tr class="codeline" data-linenumber="1166"><td class="num" id="LN1166">1166</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1167"><td class="num" id="LN1167">1167</td><td class="line"> g_ptr_array_free (props, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1168"><td class="num" id="LN1168">1168</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1169"><td class="num" id="LN1169">1169</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1170"><td class="num" id="LN1170">1170</td><td class="line"><span class='comment'>/* Takes an array of strings and creates a LISTofARRAY8 property. The</span></td></tr> +<tr class="codeline" data-linenumber="1171"><td class="num" id="LN1171">1171</td><td class="line"> <span class='comment'>* strings are neither dupped nor freed; they need to remain valid</span></td></tr> +<tr class="codeline" data-linenumber="1172"><td class="num" id="LN1172">1172</td><td class="line"> <span class='comment'>* until you're done with the SmProp.</span></td></tr> +<tr class="codeline" data-linenumber="1173"><td class="num" id="LN1173">1173</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1174"><td class="num" id="LN1174">1174</td><td class="line"><span class='keyword'>static</span> SmProp *</td></tr> +<tr class="codeline" data-linenumber="1175"><td class="num" id="LN1175">1175</td><td class="line">array_prop (<span class='keyword'>const</span> <span class='keyword'>char</span> *name, ...)</td></tr> +<tr class="codeline" data-linenumber="1176"><td class="num" id="LN1176">1176</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1177"><td class="num" id="LN1177">1177</td><td class="line"> SmProp *prop;</td></tr> +<tr class="codeline" data-linenumber="1178"><td class="num" id="LN1178">1178</td><td class="line"> SmPropValue pv;</td></tr> +<tr class="codeline" data-linenumber="1179"><td class="num" id="LN1179">1179</td><td class="line"> GArray *vals;</td></tr> +<tr class="codeline" data-linenumber="1180"><td class="num" id="LN1180">1180</td><td class="line"> <span class='keyword'>char</span> *value;</td></tr> +<tr class="codeline" data-linenumber="1181"><td class="num" id="LN1181">1181</td><td class="line"> va_list ap;</td></tr> +<tr class="codeline" data-linenumber="1182"><td class="num" id="LN1182">1182</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1183"><td class="num" id="LN1183">1183</td><td class="line"> prop = <span class='macro'>g_new (SmProp, 1)<span class='macro_popup'>((SmProp *) g_malloc_n ((1), sizeof (SmProp)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1184"><td class="num" id="LN1184">1184</td><td class="line"> prop->name = (<span class='keyword'>char</span> *)name;</td></tr> +<tr class="codeline" data-linenumber="1185"><td class="num" id="LN1185">1185</td><td class="line"> prop->type = (<span class='keyword'>char</span> *)<span class='macro'>SmLISTofARRAY8<span class='macro_popup'>"LISTofARRAY8"</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1186"><td class="num" id="LN1186">1186</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1187"><td class="num" id="LN1187">1187</td><td class="line"> vals = g_array_new (<span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>, <span class='keyword'>sizeof</span> (SmPropValue));</td></tr> +<tr class="codeline" data-linenumber="1188"><td class="num" id="LN1188">1188</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1189"><td class="num" id="LN1189">1189</td><td class="line"> <span class='macro'>va_start (ap, name)<span class='macro_popup'>__builtin_va_start(ap, name)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1190"><td class="num" id="LN1190">1190</td><td class="line"> <span class='keyword'>while</span> ((value = <span class='macro'>va_arg (ap, <span class='keyword'>char</span> *)<span class='macro_popup'>__builtin_va_arg(ap, char *)</span></span>))</td></tr> +<tr class="codeline" data-linenumber="1191"><td class="num" id="LN1191">1191</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1192"><td class="num" id="LN1192">1192</td><td class="line"> pv.length = strlen (value);</td></tr> +<tr class="codeline" data-linenumber="1193"><td class="num" id="LN1193">1193</td><td class="line"> pv.value = value;</td></tr> +<tr class="codeline" data-linenumber="1194"><td class="num" id="LN1194">1194</td><td class="line"> <span class='macro'>g_array_append_val (vals, pv)<span class='macro_popup'>g_array_append_vals (vals, &(pv), 1)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1195"><td class="num" id="LN1195">1195</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1196"><td class="num" id="LN1196">1196</td><td class="line"> <span class='macro'>va_end (ap)<span class='macro_popup'>__builtin_va_end(ap)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1197"><td class="num" id="LN1197">1197</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1198"><td class="num" id="LN1198">1198</td><td class="line"> prop->num_vals = vals->len;</td></tr> +<tr class="codeline" data-linenumber="1199"><td class="num" id="LN1199">1199</td><td class="line"> prop->vals = <span class="mrange"><span class="mrange">(SmPropValue *)vals->data</span></span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:18ex; max-width:31em">Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption</div></td></tr> +<tr class="codeline" data-linenumber="1200"><td class="num" id="LN1200">1200</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1201"><td class="num" id="LN1201">1201</td><td class="line"> g_array_free (vals, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1202"><td class="num" id="LN1202">1202</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1203"><td class="num" id="LN1203">1203</td><td class="line"> <span class='keyword'>return</span> prop;</td></tr> +<tr class="codeline" data-linenumber="1204"><td class="num" id="LN1204">1204</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1205"><td class="num" id="LN1205">1205</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1206"><td class="num" id="LN1206">1206</td><td class="line"><span class='comment'>/* Takes a GPtrArray of strings and creates a LISTofARRAY8 property.</span></td></tr> +<tr class="codeline" data-linenumber="1207"><td class="num" id="LN1207">1207</td><td class="line"> <span class='comment'>* The array contents are neither dupped nor freed; they need to</span></td></tr> +<tr class="codeline" data-linenumber="1208"><td class="num" id="LN1208">1208</td><td class="line"> <span class='comment'>* remain valid until you're done with the SmProp.</span></td></tr> +<tr class="codeline" data-linenumber="1209"><td class="num" id="LN1209">1209</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1210"><td class="num" id="LN1210">1210</td><td class="line"><span class='keyword'>static</span> SmProp *</td></tr> +<tr class="codeline" data-linenumber="1211"><td class="num" id="LN1211">1211</td><td class="line">ptrarray_prop (<span class='keyword'>const</span> <span class='keyword'>char</span> *name, GPtrArray *values)</td></tr> +<tr class="codeline" data-linenumber="1212"><td class="num" id="LN1212">1212</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1213"><td class="num" id="LN1213">1213</td><td class="line"> SmProp *prop;</td></tr> +<tr class="codeline" data-linenumber="1214"><td class="num" id="LN1214">1214</td><td class="line"> SmPropValue pv;</td></tr> +<tr class="codeline" data-linenumber="1215"><td class="num" id="LN1215">1215</td><td class="line"> GArray *vals;</td></tr> +<tr class="codeline" data-linenumber="1216"><td class="num" id="LN1216">1216</td><td class="line"> guint i;</td></tr> +<tr class="codeline" data-linenumber="1217"><td class="num" id="LN1217">1217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1218"><td class="num" id="LN1218">1218</td><td class="line"> prop = <span class='macro'>g_new (SmProp, 1)<span class='macro_popup'>((SmProp *) g_malloc_n ((1), sizeof (SmProp)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1219"><td class="num" id="LN1219">1219</td><td class="line"> prop->name = (<span class='keyword'>char</span> *)name;</td></tr> +<tr class="codeline" data-linenumber="1220"><td class="num" id="LN1220">1220</td><td class="line"> prop->type = (<span class='keyword'>char</span> *)<span class='macro'>SmLISTofARRAY8<span class='macro_popup'>"LISTofARRAY8"</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1221"><td class="num" id="LN1221">1221</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1222"><td class="num" id="LN1222">1222</td><td class="line"> vals = g_array_new (<span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>, <span class='keyword'>sizeof</span> (SmPropValue));</td></tr> +<tr class="codeline" data-linenumber="1223"><td class="num" id="LN1223">1223</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1224"><td class="num" id="LN1224">1224</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < values->len; i++)</td></tr> +<tr class="codeline" data-linenumber="1225"><td class="num" id="LN1225">1225</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1226"><td class="num" id="LN1226">1226</td><td class="line"> pv.length = strlen (values->pdata[i]);</td></tr> +<tr class="codeline" data-linenumber="1227"><td class="num" id="LN1227">1227</td><td class="line"> pv.value = values->pdata[i];</td></tr> +<tr class="codeline" data-linenumber="1228"><td class="num" id="LN1228">1228</td><td class="line"> <span class='macro'>g_array_append_val (vals, pv)<span class='macro_popup'>g_array_append_vals (vals, &(pv), 1)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1229"><td class="num" id="LN1229">1229</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1230"><td class="num" id="LN1230">1230</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1231"><td class="num" id="LN1231">1231</td><td class="line"> prop->num_vals = vals->len;</td></tr> +<tr class="codeline" data-linenumber="1232"><td class="num" id="LN1232">1232</td><td class="line"> prop->vals = (SmPropValue *)vals->data;</td></tr> +<tr class="codeline" data-linenumber="1233"><td class="num" id="LN1233">1233</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1234"><td class="num" id="LN1234">1234</td><td class="line"> g_array_free (vals, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1235"><td class="num" id="LN1235">1235</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1236"><td class="num" id="LN1236">1236</td><td class="line"> <span class='keyword'>return</span> prop;</td></tr> +<tr class="codeline" data-linenumber="1237"><td class="num" id="LN1237">1237</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1238"><td class="num" id="LN1238">1238</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1239"><td class="num" id="LN1239">1239</td><td class="line"><span class='comment'>/* Takes a string and creates an ARRAY8 property. The string is</span></td></tr> +<tr class="codeline" data-linenumber="1240"><td class="num" id="LN1240">1240</td><td class="line"> <span class='comment'>* neither dupped nor freed; it needs to remain valid until you're</span></td></tr> +<tr class="codeline" data-linenumber="1241"><td class="num" id="LN1241">1241</td><td class="line"> <span class='comment'>* done with the SmProp.</span></td></tr> +<tr class="codeline" data-linenumber="1242"><td class="num" id="LN1242">1242</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1243"><td class="num" id="LN1243">1243</td><td class="line"><span class='keyword'>static</span> SmProp *</td></tr> +<tr class="codeline" data-linenumber="1244"><td class="num" id="LN1244">1244</td><td class="line">string_prop (<span class='keyword'>const</span> <span class='keyword'>char</span> *name, <span class='keyword'>const</span> <span class='keyword'>char</span> *value)</td></tr> +<tr class="codeline" data-linenumber="1245"><td class="num" id="LN1245">1245</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1246"><td class="num" id="LN1246">1246</td><td class="line"> SmProp *prop;</td></tr> +<tr class="codeline" data-linenumber="1247"><td class="num" id="LN1247">1247</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1248"><td class="num" id="LN1248">1248</td><td class="line"> prop = <span class='macro'>g_new (SmProp, 1)<span class='macro_popup'>((SmProp *) g_malloc_n ((1), sizeof (SmProp)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1249"><td class="num" id="LN1249">1249</td><td class="line"> prop->name = (<span class='keyword'>char</span> *)name;</td></tr> +<tr class="codeline" data-linenumber="1250"><td class="num" id="LN1250">1250</td><td class="line"> prop->type = (<span class='keyword'>char</span> *)<span class='macro'>SmARRAY8<span class='macro_popup'>"ARRAY8"</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1251"><td class="num" id="LN1251">1251</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1252"><td class="num" id="LN1252">1252</td><td class="line"> prop->num_vals = 1;</td></tr> +<tr class="codeline" data-linenumber="1253"><td class="num" id="LN1253">1253</td><td class="line"> prop->vals = <span class='macro'>g_new (SmPropValue, 1)<span class='macro_popup'>((SmPropValue *) g_malloc_n ((1), sizeof (SmPropValue)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1254"><td class="num" id="LN1254">1254</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1255"><td class="num" id="LN1255">1255</td><td class="line"> prop->vals[0].length = strlen (value);</td></tr> +<tr class="codeline" data-linenumber="1256"><td class="num" id="LN1256">1256</td><td class="line"> prop->vals[0].value = (<span class='keyword'>char</span> *)value;</td></tr> +<tr class="codeline" data-linenumber="1257"><td class="num" id="LN1257">1257</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1258"><td class="num" id="LN1258">1258</td><td class="line"> <span class='keyword'>return</span> prop;</td></tr> +<tr class="codeline" data-linenumber="1259"><td class="num" id="LN1259">1259</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1260"><td class="num" id="LN1260">1260</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1261"><td class="num" id="LN1261">1261</td><td class="line"><span class='comment'>/* Takes a char and creates a CARD8 property. */</span></td></tr> +<tr class="codeline" data-linenumber="1262"><td class="num" id="LN1262">1262</td><td class="line"><span class='keyword'>static</span> SmProp *</td></tr> +<tr class="codeline" data-linenumber="1263"><td class="num" id="LN1263">1263</td><td class="line">card8_prop (<span class='keyword'>const</span> <span class='keyword'>char</span> *name, <span class='keyword'>unsigned</span> <span class='keyword'>char</span> value)</td></tr> +<tr class="codeline" data-linenumber="1264"><td class="num" id="LN1264">1264</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1265"><td class="num" id="LN1265">1265</td><td class="line"> SmProp *prop;</td></tr> +<tr class="codeline" data-linenumber="1266"><td class="num" id="LN1266">1266</td><td class="line"> <span class='keyword'>char</span> *card8val;</td></tr> +<tr class="codeline" data-linenumber="1267"><td class="num" id="LN1267">1267</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1268"><td class="num" id="LN1268">1268</td><td class="line"> <span class='comment'>/* To avoid having to allocate and free prop->vals[0], we cheat and</span></td></tr> +<tr class="codeline" data-linenumber="1269"><td class="num" id="LN1269">1269</td><td class="line"> <span class='comment'>* make vals a 2-element-long array and then use the second element</span></td></tr> +<tr class="codeline" data-linenumber="1270"><td class="num" id="LN1270">1270</td><td class="line"> <span class='comment'>* to store value.</span></td></tr> +<tr class="codeline" data-linenumber="1271"><td class="num" id="LN1271">1271</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1272"><td class="num" id="LN1272">1272</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1273"><td class="num" id="LN1273">1273</td><td class="line"> prop = <span class='macro'>g_new (SmProp, 1)<span class='macro_popup'>((SmProp *) g_malloc_n ((1), sizeof (SmProp)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1274"><td class="num" id="LN1274">1274</td><td class="line"> prop->name = (<span class='keyword'>char</span> *)name;</td></tr> +<tr class="codeline" data-linenumber="1275"><td class="num" id="LN1275">1275</td><td class="line"> prop->type = (<span class='keyword'>char</span> *)<span class='macro'>SmCARD8<span class='macro_popup'>"CARD8"</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1276"><td class="num" id="LN1276">1276</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1277"><td class="num" id="LN1277">1277</td><td class="line"> prop->num_vals = 1;</td></tr> +<tr class="codeline" data-linenumber="1278"><td class="num" id="LN1278">1278</td><td class="line"> prop->vals = <span class='macro'>g_new (SmPropValue, 2)<span class='macro_popup'>((SmPropValue *) g_malloc_n ((2), sizeof (SmPropValue)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1279"><td class="num" id="LN1279">1279</td><td class="line"> card8val = (<span class='keyword'>char</span> *)(&prop->vals[1]);</td></tr> +<tr class="codeline" data-linenumber="1280"><td class="num" id="LN1280">1280</td><td class="line"> card8val[0] = value;</td></tr> +<tr class="codeline" data-linenumber="1281"><td class="num" id="LN1281">1281</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1282"><td class="num" id="LN1282">1282</td><td class="line"> prop->vals[0].length = 1;</td></tr> +<tr class="codeline" data-linenumber="1283"><td class="num" id="LN1283">1283</td><td class="line"> prop->vals[0].value = card8val;</td></tr> +<tr class="codeline" data-linenumber="1284"><td class="num" id="LN1284">1284</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1285"><td class="num" id="LN1285">1285</td><td class="line"> <span class='keyword'>return</span> prop;</td></tr> +<tr class="codeline" data-linenumber="1286"><td class="num" id="LN1286">1286</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1287"><td class="num" id="LN1287">1287</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1288"><td class="num" id="LN1288">1288</td><td class="line"><span class='comment'>/* ICE code. This makes no effort to play nice with anyone else trying</span></td></tr> +<tr class="codeline" data-linenumber="1289"><td class="num" id="LN1289">1289</td><td class="line"> <span class='comment'>* to use libICE. Fortunately, no one uses libICE for anything other</span></td></tr> +<tr class="codeline" data-linenumber="1290"><td class="num" id="LN1290">1290</td><td class="line"> <span class='comment'>* than SM. (DCOP uses ICE, but it has its own private copy of</span></td></tr> +<tr class="codeline" data-linenumber="1291"><td class="num" id="LN1291">1291</td><td class="line"> <span class='comment'>* libICE.)</span></td></tr> +<tr class="codeline" data-linenumber="1292"><td class="num" id="LN1292">1292</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="1293"><td class="num" id="LN1293">1293</td><td class="line"> <span class='comment'>* When this moves to gtk, it will need to be cleverer, to avoid</span></td></tr> +<tr class="codeline" data-linenumber="1294"><td class="num" id="LN1294">1294</td><td class="line"> <span class='comment'>* tripping over old apps that use MateClient or that use libSM</span></td></tr> +<tr class="codeline" data-linenumber="1295"><td class="num" id="LN1295">1295</td><td class="line"> <span class='comment'>* directly.</span></td></tr> +<tr class="codeline" data-linenumber="1296"><td class="num" id="LN1296">1296</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1297"><td class="num" id="LN1297">1297</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1298"><td class="num" id="LN1298">1298</td><td class="line"><span class='directive'>#include <X11/ICE/ICElib.h></span></td></tr> +<tr class="codeline" data-linenumber="1299"><td class="num" id="LN1299">1299</td><td class="line"><span class='directive'>#include <fcntl.h></span></td></tr> +<tr class="codeline" data-linenumber="1300"><td class="num" id="LN1300">1300</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1301"><td class="num" id="LN1301">1301</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> ice_error_handler (IceConn ice_conn,</td></tr> +<tr class="codeline" data-linenumber="1302"><td class="num" id="LN1302">1302</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> swap,</td></tr> +<tr class="codeline" data-linenumber="1303"><td class="num" id="LN1303">1303</td><td class="line"> <span class='keyword'>int</span> offending_minor_opcode,</td></tr> +<tr class="codeline" data-linenumber="1304"><td class="num" id="LN1304">1304</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>long</span> offending_sequence,</td></tr> +<tr class="codeline" data-linenumber="1305"><td class="num" id="LN1305">1305</td><td class="line"> <span class='keyword'>int</span> error_class,</td></tr> +<tr class="codeline" data-linenumber="1306"><td class="num" id="LN1306">1306</td><td class="line"> <span class='keyword'>int</span> severity,</td></tr> +<tr class="codeline" data-linenumber="1307"><td class="num" id="LN1307">1307</td><td class="line"> IcePointer values);</td></tr> +<tr class="codeline" data-linenumber="1308"><td class="num" id="LN1308">1308</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> ice_io_error_handler (IceConn ice_conn);</td></tr> +<tr class="codeline" data-linenumber="1309"><td class="num" id="LN1309">1309</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> ice_connection_watch (IceConn ice_conn,</td></tr> +<tr class="codeline" data-linenumber="1310"><td class="num" id="LN1310">1310</td><td class="line"> IcePointer client_data,</td></tr> +<tr class="codeline" data-linenumber="1311"><td class="num" id="LN1311">1311</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> opening,</td></tr> +<tr class="codeline" data-linenumber="1312"><td class="num" id="LN1312">1312</td><td class="line"> IcePointer *watch_data);</td></tr> +<tr class="codeline" data-linenumber="1313"><td class="num" id="LN1313">1313</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1314"><td class="num" id="LN1314">1314</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1315"><td class="num" id="LN1315">1315</td><td class="line">ice_init (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="1316"><td class="num" id="LN1316">1316</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1317"><td class="num" id="LN1317">1317</td><td class="line"> IceSetIOErrorHandler (ice_io_error_handler);</td></tr> +<tr class="codeline" data-linenumber="1318"><td class="num" id="LN1318">1318</td><td class="line"> IceSetErrorHandler (ice_error_handler);</td></tr> +<tr class="codeline" data-linenumber="1319"><td class="num" id="LN1319">1319</td><td class="line"> IceAddConnectionWatch (ice_connection_watch, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1320"><td class="num" id="LN1320">1320</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1321"><td class="num" id="LN1321">1321</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1322"><td class="num" id="LN1322">1322</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1323"><td class="num" id="LN1323">1323</td><td class="line">process_ice_messages (IceConn ice_conn)</td></tr> +<tr class="codeline" data-linenumber="1324"><td class="num" id="LN1324">1324</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1325"><td class="num" id="LN1325">1325</td><td class="line"> IceProcessMessagesStatus status;</td></tr> +<tr class="codeline" data-linenumber="1326"><td class="num" id="LN1326">1326</td><td class="line"> status = IceProcessMessages (ice_conn, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1327"><td class="num" id="LN1327">1327</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1328"><td class="num" id="LN1328">1328</td><td class="line"> <span class='keyword'>switch</span> (status)</td></tr> +<tr class="codeline" data-linenumber="1329"><td class="num" id="LN1329">1329</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1330"><td class="num" id="LN1330">1330</td><td class="line"> <span class='keyword'>case</span> IceProcessMessagesSuccess:</td></tr> +<tr class="codeline" data-linenumber="1331"><td class="num" id="LN1331">1331</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1332"><td class="num" id="LN1332">1332</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1333"><td class="num" id="LN1333">1333</td><td class="line"> <span class='keyword'>case</span> IceProcessMessagesIOError:</td></tr> +<tr class="codeline" data-linenumber="1334"><td class="num" id="LN1334">1334</td><td class="line"> sm_client_xsmp_disconnect (IceGetConnectionContext (ice_conn));</td></tr> +<tr class="codeline" data-linenumber="1335"><td class="num" id="LN1335">1335</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1336"><td class="num" id="LN1336">1336</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1337"><td class="num" id="LN1337">1337</td><td class="line"> <span class='keyword'>case</span> IceProcessMessagesConnectionClosed:</td></tr> +<tr class="codeline" data-linenumber="1338"><td class="num" id="LN1338">1338</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1339"><td class="num" id="LN1339">1339</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1340"><td class="num" id="LN1340">1340</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="1341"><td class="num" id="LN1341">1341</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr ("EggSMClient", "eggsmclient-xsmp.c"<br>, 1341, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1342"><td class="num" id="LN1342">1342</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1343"><td class="num" id="LN1343">1343</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1344"><td class="num" id="LN1344">1344</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1345"><td class="num" id="LN1345">1345</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1346"><td class="num" id="LN1346">1346</td><td class="line">ice_iochannel_watch (GIOChannel *channel,</td></tr> +<tr class="codeline" data-linenumber="1347"><td class="num" id="LN1347">1347</td><td class="line"> GIOCondition condition,</td></tr> +<tr class="codeline" data-linenumber="1348"><td class="num" id="LN1348">1348</td><td class="line"> gpointer client_data)</td></tr> +<tr class="codeline" data-linenumber="1349"><td class="num" id="LN1349">1349</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1350"><td class="num" id="LN1350">1350</td><td class="line"> <span class='keyword'>return</span> process_ice_messages (client_data);</td></tr> +<tr class="codeline" data-linenumber="1351"><td class="num" id="LN1351">1351</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1352"><td class="num" id="LN1352">1352</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1353"><td class="num" id="LN1353">1353</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1354"><td class="num" id="LN1354">1354</td><td class="line">ice_connection_watch (IceConn ice_conn,</td></tr> +<tr class="codeline" data-linenumber="1355"><td class="num" id="LN1355">1355</td><td class="line"> IcePointer client_data,</td></tr> +<tr class="codeline" data-linenumber="1356"><td class="num" id="LN1356">1356</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> opening,</td></tr> +<tr class="codeline" data-linenumber="1357"><td class="num" id="LN1357">1357</td><td class="line"> IcePointer *watch_data)</td></tr> +<tr class="codeline" data-linenumber="1358"><td class="num" id="LN1358">1358</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1359"><td class="num" id="LN1359">1359</td><td class="line"> guint watch_id;</td></tr> +<tr class="codeline" data-linenumber="1360"><td class="num" id="LN1360">1360</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1361"><td class="num" id="LN1361">1361</td><td class="line"> <span class='keyword'>if</span> (opening)</td></tr> +<tr class="codeline" data-linenumber="1362"><td class="num" id="LN1362">1362</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1363"><td class="num" id="LN1363">1363</td><td class="line"> GIOChannel *channel;</td></tr> +<tr class="codeline" data-linenumber="1364"><td class="num" id="LN1364">1364</td><td class="line"> <span class='keyword'>int</span> fd = IceConnectionNumber (ice_conn);</td></tr> +<tr class="codeline" data-linenumber="1365"><td class="num" id="LN1365">1365</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1366"><td class="num" id="LN1366">1366</td><td class="line"> fcntl (fd, <span class='macro'>F_SETFD<span class='macro_popup'>2</span></span>, fcntl (fd, <span class='macro'>F_GETFD<span class='macro_popup'>1</span></span>, 0) | <span class='macro'>FD_CLOEXEC<span class='macro_popup'>1</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1367"><td class="num" id="LN1367">1367</td><td class="line"> channel = g_io_channel_unix_new (fd);</td></tr> +<tr class="codeline" data-linenumber="1368"><td class="num" id="LN1368">1368</td><td class="line"> watch_id = g_io_add_watch (channel, G_IO_IN | G_IO_ERR,</td></tr> +<tr class="codeline" data-linenumber="1369"><td class="num" id="LN1369">1369</td><td class="line"> ice_iochannel_watch, ice_conn);</td></tr> +<tr class="codeline" data-linenumber="1370"><td class="num" id="LN1370">1370</td><td class="line"> g_io_channel_unref (channel);</td></tr> +<tr class="codeline" data-linenumber="1371"><td class="num" id="LN1371">1371</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1372"><td class="num" id="LN1372">1372</td><td class="line"> *watch_data = <span class='macro'>GUINT_TO_POINTER (watch_id)<span class='macro_popup'>((gpointer) (gulong) (watch_id))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1373"><td class="num" id="LN1373">1373</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1374"><td class="num" id="LN1374">1374</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="1375"><td class="num" id="LN1375">1375</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1376"><td class="num" id="LN1376">1376</td><td class="line"> watch_id = <span class='macro'>GPOINTER_TO_UINT (*watch_data)<span class='macro_popup'>((guint) (gulong) (*watch_data))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1377"><td class="num" id="LN1377">1377</td><td class="line"> g_source_remove (watch_id);</td></tr> +<tr class="codeline" data-linenumber="1378"><td class="num" id="LN1378">1378</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1379"><td class="num" id="LN1379">1379</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1380"><td class="num" id="LN1380">1380</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1381"><td class="num" id="LN1381">1381</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1382"><td class="num" id="LN1382">1382</td><td class="line">ice_error_handler (IceConn ice_conn,</td></tr> +<tr class="codeline" data-linenumber="1383"><td class="num" id="LN1383">1383</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> swap,</td></tr> +<tr class="codeline" data-linenumber="1384"><td class="num" id="LN1384">1384</td><td class="line"> <span class='keyword'>int</span> offending_minor_opcode,</td></tr> +<tr class="codeline" data-linenumber="1385"><td class="num" id="LN1385">1385</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>long</span> offending_sequence,</td></tr> +<tr class="codeline" data-linenumber="1386"><td class="num" id="LN1386">1386</td><td class="line"> <span class='keyword'>int</span> error_class,</td></tr> +<tr class="codeline" data-linenumber="1387"><td class="num" id="LN1387">1387</td><td class="line"> <span class='keyword'>int</span> severity,</td></tr> +<tr class="codeline" data-linenumber="1388"><td class="num" id="LN1388">1388</td><td class="line"> IcePointer values)</td></tr> +<tr class="codeline" data-linenumber="1389"><td class="num" id="LN1389">1389</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1390"><td class="num" id="LN1390">1390</td><td class="line"> <span class='comment'>/* Do nothing */</span></td></tr> +<tr class="codeline" data-linenumber="1391"><td class="num" id="LN1391">1391</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1392"><td class="num" id="LN1392">1392</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1393"><td class="num" id="LN1393">1393</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1394"><td class="num" id="LN1394">1394</td><td class="line">ice_io_error_handler (IceConn ice_conn)</td></tr> +<tr class="codeline" data-linenumber="1395"><td class="num" id="LN1395">1395</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1396"><td class="num" id="LN1396">1396</td><td class="line"> <span class='comment'>/* Do nothing */</span></td></tr> +<tr class="codeline" data-linenumber="1397"><td class="num" id="LN1397">1397</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1398"><td class="num" id="LN1398">1398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1399"><td class="num" id="LN1399">1399</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1400"><td class="num" id="LN1400">1400</td><td class="line">smc_error_handler (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="1401"><td class="num" id="LN1401">1401</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> swap,</td></tr> +<tr class="codeline" data-linenumber="1402"><td class="num" id="LN1402">1402</td><td class="line"> <span class='keyword'>int</span> offending_minor_opcode,</td></tr> +<tr class="codeline" data-linenumber="1403"><td class="num" id="LN1403">1403</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>long</span> offending_sequence,</td></tr> +<tr class="codeline" data-linenumber="1404"><td class="num" id="LN1404">1404</td><td class="line"> <span class='keyword'>int</span> error_class,</td></tr> +<tr class="codeline" data-linenumber="1405"><td class="num" id="LN1405">1405</td><td class="line"> <span class='keyword'>int</span> severity,</td></tr> +<tr class="codeline" data-linenumber="1406"><td class="num" id="LN1406">1406</td><td class="line"> SmPointer values)</td></tr> +<tr class="codeline" data-linenumber="1407"><td class="num" id="LN1407">1407</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1408"><td class="num" id="LN1408">1408</td><td class="line"> <span class='comment'>/* Do nothing */</span></td></tr> +<tr class="codeline" data-linenumber="1409"><td class="num" id="LN1409">1409</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-bd4e55.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-bd4e55.html new file mode 100644 index 0000000..73d7f5b --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-bd4e55.html @@ -0,0 +1,1197 @@ +<!doctype html> +<html> +<head> +<title>mate-session-check-accelerated-gl-helper.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC This statement is never executed --> + +<!-- BUGTYPE Unreachable code --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/tools/mate-session-check-accelerated-gl-helper.c --> + +<!-- FILENAME mate-session-check-accelerated-gl-helper.c --> + +<!-- FUNCTIONNAME main --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT bd4e5581acf656a95fbaac7aa45d9ba0 --> + +<!-- BUGLINE 462 --> + +<!-- BUGCOLUMN 17 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>tools/mate-session-check-accelerated-gl-helper.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 462, column 17</a><br />This statement is never executed</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mate-session-check-accelerated-gl-helper.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/tools -fcoverage-compilation-dir=/rootdir/tools -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -D PKGDATADIR="/usr/local/share/mate-session-manager" -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -D LOCALE_DIR="/usr/local/share/locale" -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-6 -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c mate-session-check-accelerated-gl-helper.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"462": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2010 Novell, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2006-2009 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This program is free software; you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* it under the terms of the GNU General Public License as published by</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* the Free Software Foundation; either version 2 of the License, or</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>* Author:</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>* Vincent Untz <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> <span class='comment'>* Most of the code comes from desktop-effects [1], released under GPLv2+.</span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> <span class='comment'>* desktop-effects was written by:</span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> <span class='comment'>* Soren Sandmann <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"> <span class='comment'>* [1] http://git.fedorahosted.org/git/?p=desktop-effects.git;a=blob_plain;f=desktop-effects.c;hb=HEAD</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> <span class='comment'>* Here's the rationale behind this helper, quoting Owen, in his mail to the</span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> <span class='comment'>* release team:</span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> <span class='comment'>* (http://mail.gnome.org/archives/release-team/2010-June/msg00079.html)</span></td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> <span class='comment'>* """</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> <span class='comment'>* There are some limits to what we can do here automatically without</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> <span class='comment'>* knowing anything about the driver situation on the system. The basic</span></td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"> <span class='comment'>* problem is that there are all sorts of suck:</span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"> <span class='comment'>* * No GL at all. This typically only happens if a system is</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> <span class='comment'>* misconfigured.</span></td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> <span class='comment'>* * Only software GL. This one is easy to detect. We have code in</span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> <span class='comment'>* the Fedora desktop-effects tool, etc.</span></td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"> <span class='comment'>* * GL that isn't featureful enough. (Tiny texture size limits, no</span></td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> <span class='comment'>* texture-from-pixmap, etc.) Possible to detect with more work, but</span></td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"> <span class='comment'>* largely a fringe case.</span></td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> <span class='comment'>* * Buggy GL. This isn't possible to detect. Except for the case where</span></td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> <span class='comment'>* all GL programs crash. For that reason, we probably don't want</span></td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> <span class='comment'>* gnome-session to directly try and do any GL detection; better to</span></td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> <span class='comment'>* use a helper binary.</span></td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> <span class='comment'>* * Horribly slow hardware GL. We could theoretically develop some sort</span></td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> <span class='comment'>* of benchmark, but it's a tricky area. And how slow is too slow?</span></td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> <span class='comment'>* """</span></td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> <span class='comment'>* Some other tools are doing similar checks:</span></td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> <span class='comment'>* - desktop-effects (Fedora Config Tool) [1]</span></td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> <span class='comment'>* - drak3d (Mandriva Config Tool) [2]</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> <span class='comment'>* - compiz-manager (Compiz wrapper) [3]</span></td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> <span class='comment'>* [1] http://git.fedorahosted.org/git/?p=desktop-effects.git;a=blob_plain;f=desktop-effects.c;hb=HEAD</span></td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> <span class='comment'>* [2] http://svn.mandriva.com/cgi-bin/viewvc.cgi/soft/drak3d/trunk/lib/Xconfig/glx.pm?view=markup</span></td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> <span class='comment'>* [3] http://git.compiz.org/fusion/misc/compiz-manager/tree/compiz-manager</span></td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"><span class='comment'>/* for strcasestr */</span></td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='directive'>#define _GNU_SOURCE</span></td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"><span class='directive'>#include <ctype.h></span></td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"><span class='directive'>#include <locale.h></span></td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"><span class='directive'>#include <glib.h></span></td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"><span class='directive'>#include <regex.h></span></td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='directive'>#ifdef __FreeBSD__</span></td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"><span class='directive'>#include <kenv.h></span></td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"><span class='directive'>#include <X11/Xlib.h></span></td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"><span class='directive'>#include <X11/Xatom.h></span></td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"><span class='directive'>#include <X11/extensions/Xcomposite.h></span></td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"><span class='directive'>#include <GL/gl.h></span></td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"><span class='directive'>#include <GL/glx.h></span></td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"><span class='directive'>#include "mate-session-check-accelerated-common.h"</span></td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"><span class='directive'>#define <span class='macro'>SIZE_UNSET<span class='macro_popup'>0</span></span> 0</span></td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"><span class='directive'>#define <span class='macro'>SIZE_ERROR<span class='macro_popup'>-1</span></span> -1</span></td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span> max_texture_size = <span class='macro'>SIZE_UNSET<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span> max_renderbuffer_size = <span class='macro'>SIZE_UNSET<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"><span class='keyword'>static</span> gboolean has_llvmpipe = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line">_print_error (<span class='keyword'>const</span> <span class='keyword'>char</span> *str)</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> fprintf (<span class='macro'>stderr<span class='macro_popup'>stderr</span></span>, <span class='string_literal'>"mate-session-is-accelerated: %s\n"</span>, str);</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"><span class='directive'>#define <span class='macro'>CMDLINE_UNSET<span class='macro_popup'>-1</span></span> -1</span></td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"><span class='directive'>#define <span class='macro'>CMDLINE_NON_FALLBACK_FORCED<span class='macro_popup'>0</span></span> 0</span></td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"><span class='directive'>#define <span class='macro'>CMDLINE_FALLBACK_FORCED<span class='macro_popup'>1</span></span> 1</span></td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"><span class='directive'>#if defined(<span class='macro'>__linux__<span class='macro_popup'>1</span></span>)</span></td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line">_parse_kcmdline (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> <span class='keyword'>int</span> ret = <span class='macro'>CMDLINE_UNSET<span class='macro_popup'>-1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> GRegex *regex;</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> GMatchInfo *match;</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> <span class='keyword'>char</span> *contents;</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> <span class='keyword'>char</span> *word;</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *arg;</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='keyword'>if</span> (!g_file_get_contents (<span class='string_literal'>"/proc/cmdline"</span>, &contents, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>))</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> regex = g_regex_new (<span class='string_literal'>"mate.fallback=(\\S+)"</span>, 0, G_REGEX_MATCH_NOTEMPTY, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>if</span> (!g_regex_match (regex, contents, G_REGEX_MATCH_NOTEMPTY, &match))</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> word = g_match_info_fetch (match, 0);</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> g_debug (<span class='string_literal'>"Found command-line match '%s'"</span>, word);</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> arg = word + strlen (<span class='string_literal'>"mate.fallback="</span>);</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> <span class='keyword'>if</span> (*arg != '0' && *arg != '1')</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> fprintf (<span class='macro'>stderr<span class='macro_popup'>stderr</span></span>, <span class='string_literal'>"mate-session-check-accelerated: Invalid value '%s' for mate.fallback passed in kernel command line.\n"</span>, arg);</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> ret = atoi (arg);</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> g_free (word);</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> g_match_info_free (match);</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> g_regex_unref (regex);</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> g_free (contents);</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> g_debug (<span class='string_literal'>"Command-line parsed to %d"</span>, ret);</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"><span class='directive'>#elif defined(__FreeBSD__)</span></td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line">_parse_kcmdline (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> <span class='keyword'>int</span> ret = <span class='macro'>CMDLINE_UNSET<span class='macro_popup'>-1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> <span class='keyword'>char</span> value[KENV_MVALLEN];</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> <span class='comment'>/* a compile time check to avoid unexpected stack overflow */</span></td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='keyword'>_Static_assert</span>(KENV_MVALLEN < 1024 * 1024, <span class='string_literal'>"KENV_MVALLEN is too large"</span>);</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> <span class='keyword'>if</span> (kenv (KENV_GET, <span class='string_literal'>"mate.fallback"</span>, value, KENV_MVALLEN) == -1)</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> <span class='keyword'>if</span> (*value != '0' && *value != '1')</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> fprintf (<span class='macro'>stderr<span class='macro_popup'>stderr</span></span>, <span class='string_literal'>"mate-session-is-accelerated: Invalid value '%s' for mate.fallback passed in kernel environment.\n"</span>, value);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> ret = atoi (value);</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> g_debug (<span class='string_literal'>"Kernel environment parsed to %d"</span>, ret);</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"><span class='directive'>#else</span></td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line">_parse_kcmdline (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>CMDLINE_UNSET<span class='macro_popup'>-1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line">_has_composite (Display *display)</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>int</span> dummy1, dummy2;</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='keyword'>return</span> XCompositeQueryExtension (display, &dummy1, &dummy2);</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line">_is_comment (<span class='keyword'>const</span> <span class='keyword'>char</span> *line)</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='keyword'>while</span> (*line && <span class='macro'>isspace(*line)<span class='macro_popup'>((*__ctype_b_loc ())[(int) ((*line))] & (unsigned short int<br>) _ISspace)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> line++;</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='keyword'>if</span> (*line == '#' || *line == '\0')</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line">_is_gl_renderer_blacklisted (<span class='keyword'>const</span> <span class='keyword'>char</span> *renderer)</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> FILE *blacklist;</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='keyword'>char</span> *line = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> size_t line_len = 0;</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> gboolean ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> blacklist = fopen(<span class='macro'>PKGDATADIR<span class='macro_popup'>"/usr/local/share/mate-session-manager"</span></span> <span class='string_literal'>"/hardware-compatibility"</span>, <span class='string_literal'>"r"</span>);</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> <span class='keyword'>if</span> (blacklist == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> <span class='keyword'>while</span> (getline (&line, &line_len, blacklist) != -1) {</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='keyword'>int</span> whitelist = 0;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *re_str;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> regex_t re;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> <span class='keyword'>int</span> status;</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> <span class='keyword'>if</span> (line == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='comment'>/* Drop trailing \n */</span></td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> line[strlen(line) - 1] = '\0';</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='keyword'>if</span> (_is_comment (line)) {</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> free (line);</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> line = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> <span class='keyword'>if</span> (line[0] == '+')</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> whitelist = 1;</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (line[0] == '-')</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> whitelist = 0;</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> _print_error (<span class='string_literal'>"Invalid syntax in this line for hardware compatibility:"</span>);</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> _print_error (line);</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> free (line);</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> line = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> re_str = line + 1;</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> <span class='keyword'>if</span> (regcomp (&re, re_str, <span class='macro'>REG_EXTENDED<span class='macro_popup'>1</span></span>|<span class='macro'>REG_ICASE<span class='macro_popup'>(1 << 1)</span></span>|<span class='macro'>REG_NOSUB<span class='macro_popup'>(1 << 3)</span></span>) != 0) {</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> _print_error (<span class='string_literal'>"Cannot use this regular expression for hardware compatibility:"</span>);</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> _print_error (re_str);</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> status = regexec (&re, renderer, 0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0);</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> regfree(&re);</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> <span class='keyword'>if</span> (status == 0) {</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> <span class='keyword'>if</span> (whitelist)</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> free (line);</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> line = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>if</span> (line != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> free (line);</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> <span class='keyword'>if</span> (blacklist != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> fclose (blacklist);</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>char</span> *</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line">_get_hardware_gl (Display *display)</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>int</span> screen;</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> Window root;</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> XVisualInfo *visual = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> GLXContext context = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> XSetWindowAttributes cwa = { 0 };</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> Window window = <span class='macro'>None<span class='macro_popup'>0L</span></span>;</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>char</span> *renderer = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> <span class='keyword'>int</span> attrlist[] = {</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> <span class='macro'>GLX_RGBA<span class='macro_popup'>4</span></span>,</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> <span class='macro'>GLX_RED_SIZE<span class='macro_popup'>8</span></span>, 1,</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> <span class='macro'>GLX_GREEN_SIZE<span class='macro_popup'>9</span></span>, 1,</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='macro'>GLX_BLUE_SIZE<span class='macro_popup'>10</span></span>, 1,</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> <span class='macro'>GLX_DOUBLEBUFFER<span class='macro_popup'>5</span></span>,</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> <span class='macro'>None<span class='macro_popup'>0L</span></span></td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> screen = <span class='macro'>DefaultScreen (display)<span class='macro_popup'>(((_XPrivDisplay)(display))->default_screen)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> root = <span class='macro'>RootWindow (display, screen)<span class='macro_popup'>((&((_XPrivDisplay)(display))->screens[screen])->root<br>)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> visual = glXChooseVisual (display, screen, attrlist);</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> <span class='keyword'>if</span> (!visual)</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> context = glXCreateContext (display, visual, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>True<span class='macro_popup'>1</span></span>);</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> <span class='keyword'>if</span> (!context)</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> cwa.colormap = XCreateColormap (display, root,</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> visual->visual, <span class='macro'>AllocNone<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> cwa.background_pixel = 0;</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> cwa.border_pixel = 0;</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> window = XCreateWindow (display, root,</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> 0, 0, 1, 1, 0,</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> visual->depth, <span class='macro'>InputOutput<span class='macro_popup'>1</span></span>, visual->visual,</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='macro'>CWColormap<span class='macro_popup'>(1L<<13)</span></span> | <span class='macro'>CWBackPixel<span class='macro_popup'>(1L<<1)</span></span> | <span class='macro'>CWBorderPixel<span class='macro_popup'>(1L<<3)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> &cwa);</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> <span class='keyword'>if</span> (!glXMakeCurrent (display, window, context))</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> renderer = <span class='macro'>g_strdup ((<span class='keyword'>const</span> <span class='keyword'>char</span> *) glGetString (GL_RENDERER))<span class='macro_popup'>g_strdup_inline ((const char *) glGetString (0x1F01))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> <span class='keyword'>if</span> (_is_gl_renderer_blacklisted (renderer)) {</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='macro'>g_clear_pointer (&renderer, g_free)<span class='macro_popup'>do { _Static_assert (sizeof *(&renderer) == sizeof (gpointer<br>), "Expression evaluates to false"); __typeof__ ((&renderer<br>)) _pp = (&renderer); __typeof__ (*(&renderer)) _ptr =<br> *_pp; *_pp = ((void*)0); if (_ptr) (g_free) (_ptr); } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> <span class='keyword'>if</span> (renderer && strcasestr (renderer, <span class='string_literal'>"llvmpipe"</span>))</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> has_llvmpipe = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> <span class='comment'>/* we need to get the max texture and renderbuffer sizes while we have</span></td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> <span class='comment'>* a context, but we'll check their values later */</span></td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> glGetIntegerv (<span class='macro'>GL_MAX_TEXTURE_SIZE<span class='macro_popup'>0x0D33</span></span>, &max_texture_size);</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> <span class='keyword'>if</span> (glGetError() != <span class='macro'>GL_NO_ERROR<span class='macro_popup'>0</span></span>)</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> max_texture_size = <span class='macro'>SIZE_ERROR<span class='macro_popup'>-1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> glGetIntegerv (<span class='macro'>GL_MAX_RENDERBUFFER_SIZE_EXT<span class='macro_popup'>0x84E8</span></span>, &max_renderbuffer_size);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (glGetError() != <span class='macro'>GL_NO_ERROR<span class='macro_popup'>0</span></span>)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> max_renderbuffer_size = <span class='macro'>SIZE_ERROR<span class='macro_popup'>-1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> glXMakeCurrent (display, <span class='macro'>None<span class='macro_popup'>0L</span></span>, <span class='macro'>None<span class='macro_popup'>0L</span></span>);</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> <span class='keyword'>if</span> (context)</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> glXDestroyContext (display, context);</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> <span class='keyword'>if</span> (window)</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> XDestroyWindow (display, window);</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='keyword'>if</span> (cwa.colormap)</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> XFreeColormap (display, cwa.colormap);</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='keyword'>return</span> renderer;</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line">_has_extension (<span class='keyword'>const</span> <span class='keyword'>char</span> *extension_list,</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *extension)</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> <span class='keyword'>char</span> **extensions;</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> guint i;</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='macro'>g_return_val_if_fail (extension != NULL, TRUE)<span class='macro_popup'>do { if ((extension != ((void*)0))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "extension != NULL"<br>); return ((!(0))); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='comment'>/* Extension_list is one big string, containing extensions</span></td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='comment'>* separated by spaces. */</span></td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>if</span> (extension_list == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> extensions = g_strsplit (extension_list, <span class='string_literal'>" "</span>, -1);</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>if</span> (extensions == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> <span class='keyword'>for</span> (i = 0; extensions[i] != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; i++) {</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>g_str_equal (extensions[i], extension)<span class='macro_popup'>(strcmp ((const char *) (extensions[i]), (const char *) (extension<br>)) == 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> g_strfreev (extensions);</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line">_has_texture_from_pixmap (Display *display)</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>int</span> screen;</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *server_extensions;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *client_extensions;</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> gboolean ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> screen = <span class='macro'>DefaultScreen (display)<span class='macro_popup'>(((_XPrivDisplay)(display))->default_screen)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> server_extensions = glXQueryServerString (display, screen,</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='macro'>GLX_EXTENSIONS<span class='macro_popup'>3</span></span>);</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> <span class='keyword'>if</span> (!_has_extension (server_extensions,</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='string_literal'>"GLX_EXT_texture_from_pixmap"</span>))</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> client_extensions = glXGetClientString (display, <span class='macro'>GLX_EXTENSIONS<span class='macro_popup'>3</span></span>);</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>if</span> (!_has_extension (client_extensions,</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> <span class='string_literal'>"GLX_EXT_texture_from_pixmap"</span>))</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line">_set_max_screen_size_property (Display *display, <span class='keyword'>int</span> screen, <span class='keyword'>int</span> size)</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> Atom max_screen_size_atom;</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> max_screen_size_atom = XInternAtom (display, <span class='string_literal'>"_GNOME_MAX_SCREEN_SIZE"</span>,</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> <span class='macro'>False<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='comment'>/* Will be read by gnome-settings-daemon and</span></td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> <span class='comment'>* gnome-control-center to avoid display configurations where 3D</span></td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> <span class='comment'>* is not available (and would break gnome-shell) */</span></td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> XChangeProperty (display, <span class='macro'>RootWindow(display, screen)<span class='macro_popup'>((&((_XPrivDisplay)(display))->screens[screen])->root<br>)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> max_screen_size_atom,</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='macro'>XA_CARDINAL<span class='macro_popup'>((Atom) 6)</span></span>, 32, <span class='macro'>PropModeReplace<span class='macro_popup'>0</span></span>,</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> (<span class='keyword'>unsigned</span> <span class='keyword'>char</span> *)&size, 1);</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> XSync(display, <span class='macro'>False<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line">_is_max_texture_size_big_enough (Display *display)</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> <span class='keyword'>int</span> screen, size;</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> screen = <span class='macro'>DefaultScreen (display)<span class='macro_popup'>(((_XPrivDisplay)(display))->default_screen)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> size = <span class='macro'>MIN(max_renderbuffer_size, max_texture_size)<span class='macro_popup'>(((max_renderbuffer_size) < (max_texture_size)) ? (max_renderbuffer_size<br>) : (max_texture_size))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> <span class='keyword'>if</span> (size < <span class='macro'>DisplayWidth (display, screen)<span class='macro_popup'>((&((_XPrivDisplay)(display))->screens[screen])->width<br>)</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> size < <span class='macro'>DisplayHeight (display, screen)<span class='macro_popup'>((&((_XPrivDisplay)(display))->screens[screen])->height<br>)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> _set_max_screen_size_property (display, screen, size);</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"><span class='keyword'>static</span> gboolean print_renderer = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>const</span> GOptionEntry entries[] = {</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> { <span class='string_literal'>"print-renderer"</span>, 'p', 0, G_OPTION_ARG_NONE, &print_renderer, <span class='string_literal'>"Print GL renderer name"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> },</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> { <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, 0, G_OPTION_ARG_NONE, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> },</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"><span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line">main (<span class='keyword'>int</span> argc, <span class='keyword'>char</span> **argv)</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> <span class='keyword'>int</span> kcmdline_parsed;</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> Display *display = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> <span class='keyword'>int</span> ret = <span class='macro'>HELPER_NO_ACCEL<span class='macro_popup'>1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> GOptionContext *context;</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> <span class='keyword'>char</span> *renderer = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> setlocale (<span class='macro'>LC_ALL<span class='macro_popup'>6</span></span>, <span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> context = g_option_context_new (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> g_option_context_add_main_entries (context, entries, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> <span class='keyword'>if</span> (!g_option_context_parse (context, &argc, &argv, &error)) {</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> g_error (<span class='string_literal'>"Can't parse command line: %s\n"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> <span class="mrange">g_error_free</span> (error);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:17ex">This statement is never executed</div></td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> kcmdline_parsed = _parse_kcmdline ();</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> <span class='keyword'>if</span> (kcmdline_parsed > <span class='macro'>CMDLINE_UNSET<span class='macro_popup'>-1</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='keyword'>if</span> (kcmdline_parsed == <span class='macro'>CMDLINE_NON_FALLBACK_FORCED<span class='macro_popup'>0</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> _print_error (<span class='string_literal'>"Non-fallback mode forced by kernel command line."</span>);</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> ret = <span class='macro'>HELPER_ACCEL<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (kcmdline_parsed == <span class='macro'>CMDLINE_FALLBACK_FORCED<span class='macro_popup'>1</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> _print_error (<span class='string_literal'>"Fallback mode forced by kernel command line."</span>);</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> display = XOpenDisplay (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> <span class='keyword'>if</span> (!display) {</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> _print_error (<span class='string_literal'>"No X display."</span>);</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> <span class='keyword'>if</span> (!_has_composite (display)) {</td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> _print_error (<span class='string_literal'>"No composite extension."</span>);</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> renderer = _get_hardware_gl (display);</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> <span class='keyword'>if</span> (!renderer) {</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> _print_error (<span class='string_literal'>"No hardware 3D support."</span>);</td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> <span class='keyword'>if</span> (!_has_texture_from_pixmap (display)) {</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> _print_error (<span class='string_literal'>"No GLX_EXT_texture_from_pixmap support."</span>);</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='keyword'>if</span> (!_is_max_texture_size_big_enough (display)) {</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> _print_error (<span class='string_literal'>"GL_MAX_{TEXTURE,RENDERBUFFER}_SIZE is too small."</span>);</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> ret = has_llvmpipe ? <span class='macro'>HELPER_SOFTWARE_RENDERING<span class='macro_popup'>2</span></span> : <span class='macro'>HELPER_ACCEL<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> <span class='keyword'>if</span> (print_renderer)</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> g_print (<span class='string_literal'>"%s"</span>, renderer);</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>if</span> (display)</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> XCloseDisplay (display);</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> g_option_context_free (context);</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> g_free (renderer);</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-cd0613.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-cd0613.html new file mode 100644 index 0000000..66961d3 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-cd0613.html @@ -0,0 +1,967 @@ +<!doctype html> +<html> +<head> +<title>mate-session-save.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC This statement is never executed --> + +<!-- BUGTYPE Unreachable code --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/tools/mate-session-save.c --> + +<!-- FILENAME mate-session-save.c --> + +<!-- FUNCTIONNAME main --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT cd0613347d1ef4235c6ae0d4c7004e01 --> + +<!-- BUGLINE 283 --> + +<!-- BUGCOLUMN 3 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>tools/mate-session-save.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 283, column 3</a><br />This statement is never executed</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mate-session-save.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/tools -fcoverage-compilation-dir=/rootdir/tools -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -D LOCALE_DIR="/usr/local/share/locale" -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c mate-session-save.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"283": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* save-session.c - Small program to talk to session manager.</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>Copyright (C) 1998 Tom Tromey</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>Copyright (C) 2008 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>This program is free software; you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>it under the terms of the GNU General Public License as published by</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>the Free Software Foundation; either version 2, or (at your option)</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>any later version.</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"><span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <config.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_SERVICE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_PATH_DBUS<span class='macro_popup'>"/org/gnome/SessionManager"</span></span> "/org/gnome/SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_INTERFACE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_SERVICE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span> "org.mate.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_PATH_DBUS_OLD<span class='macro_popup'>"/org/mate/SessionManager"</span></span> "/org/mate/SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_INTERFACE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span> "org.mate.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> GSM_LOGOUT_MODE_NORMAL = 0,</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> GSM_LOGOUT_MODE_NO_CONFIRMATION,</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> GSM_LOGOUT_MODE_FORCE</td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='comment'>/* True if killing. This is deprecated, but we keep it for compatibility</span></td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> <span class='comment'>* reasons. */</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> gboolean kill_session = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"><span class='comment'>/* The real options that should be used now. They are not ambiguous. */</span></td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='keyword'>static</span> gboolean logout = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"><span class='keyword'>static</span> gboolean force_logout = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"><span class='keyword'>static</span> gboolean logout_dialog = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"><span class='keyword'>static</span> gboolean shutdown_dialog = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"><span class='comment'>/* True if we should use dialog boxes */</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"><span class='keyword'>static</span> gboolean show_error_dialogs = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"><span class='comment'>/* True if we should do the requested action without confirmation */</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"><span class='keyword'>static</span> gboolean no_interaction = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>char</span>* session_name = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"><span class='keyword'>static</span> GOptionEntry options[] = {</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> {<span class='string_literal'>"logout"</span>, '\0', 0, G_OPTION_ARG_NONE, &logout, <span class='macro'>N_(<span class='string_literal'>"Log out"</span>)<span class='macro_popup'>("Log out")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> {<span class='string_literal'>"force-logout"</span>, '\0', 0, G_OPTION_ARG_NONE, &force_logout, <span class='macro'>N_(<span class='string_literal'>"Log out, ignoring any existing inhibitors"</span>)<span class='macro_popup'>("Log out, ignoring any existing inhibitors")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> {<span class='string_literal'>"logout-dialog"</span>, '\0', 0, G_OPTION_ARG_NONE, &logout_dialog, <span class='macro'>N_(<span class='string_literal'>"Show logout dialog"</span>)<span class='macro_popup'>("Show logout dialog")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> {<span class='string_literal'>"shutdown-dialog"</span>, '\0', 0, G_OPTION_ARG_NONE, &shutdown_dialog, <span class='macro'>N_(<span class='string_literal'>"Show shutdown dialog"</span>)<span class='macro_popup'>("Show shutdown dialog")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> {<span class='string_literal'>"gui"</span>, '\0', 0, G_OPTION_ARG_NONE, &show_error_dialogs, <span class='macro'>N_(<span class='string_literal'>"Use dialog boxes for errors"</span>)<span class='macro_popup'>("Use dialog boxes for errors")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> <span class='comment'>/* deprecated options */</span></td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> {<span class='string_literal'>"session-name"</span>, 's', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &session_name, <span class='macro'>N_(<span class='string_literal'>"Set the current session name"</span>)<span class='macro_popup'>("Set the current session name")</span></span>, <span class='macro'>N_(<span class='string_literal'>"NAME"</span>)<span class='macro_popup'>("NAME")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> {<span class='string_literal'>"kill"</span>, '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &kill_session, <span class='macro'>N_(<span class='string_literal'>"Kill session"</span>)<span class='macro_popup'>("Kill session")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> {<span class='string_literal'>"silent"</span>, '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &no_interaction, <span class='macro'>N_(<span class='string_literal'>"Do not require confirmation"</span>)<span class='macro_popup'>("Do not require confirmation")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> {<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, 0, G_OPTION_ARG_NONE, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>}</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> display_error(<span class='keyword'>const</span> <span class='keyword'>char</span>* message)</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> <span class='keyword'>if</span> (show_error_dialogs && !no_interaction)</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> GtkWidget* dialog = gtk_message_dialog_new(<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, <span class='string_literal'>"%s"</span>, message);</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> gtk_window_set_default_icon_name (<span class='string_literal'>"dialog-error"</span>);</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> gtk_dialog_run(<span class='macro'>GTK_DIALOG(dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> gtk_widget_destroy(dialog);</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> g_printerr(<span class='string_literal'>"%s\n"</span>, message);</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"><span class='keyword'>static</span> GDBusProxy* get_sm_proxy(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> GDBusProxy *sm_proxy = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> sm_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> G_DBUS_PROXY_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> <span class='macro'>GSM_SERVICE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> <span class='macro'>GSM_PATH_DBUS<span class='macro_popup'>"/org/gnome/SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='macro'>GSM_INTERFACE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> g_warning (<span class='string_literal'>"Couldn't create DBus proxy: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> <span class='comment'>/* Try the old name - for the case when we've just upgraded from 1.10</span></td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> <span class='comment'>* so the old m-s-m is currently running */</span></td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> sm_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> G_DBUS_PROXY_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> <span class='macro'>GSM_SERVICE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='macro'>GSM_PATH_DBUS_OLD<span class='macro_popup'>"/org/mate/SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> <span class='macro'>GSM_INTERFACE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> <span class='comment'>/* Okay, it wasn't the upgrade case, so now we can give up. */</span></td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> display_error (<span class='macro'>_(<span class='string_literal'>"Could not connect to the session manager"</span>)<span class='macro_popup'>gettext ("Could not connect to the session manager")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> do_logout(<span class='keyword'>unsigned</span> <span class='keyword'>int</span> mode)</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> GDBusProxy* sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> GVariant *ret;</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> sm_proxy = get_sm_proxy ();</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> ret = g_dbus_proxy_call_sync (sm_proxy, <span class='string_literal'>"Logout"</span>,</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> g_variant_new (<span class='string_literal'>"(u)"</span>, mode),</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> G_DBUS_CALL_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> <span class='keyword'>if</span> (ret == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> g_warning (<span class='string_literal'>"Failed to call logout: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> g_variant_unref (ret);</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> <span class='keyword'>if</span> (sm_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> g_object_unref (sm_proxy);</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> do_shutdown_dialog(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> GDBusProxy* sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> GVariant *ret;</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> sm_proxy = get_sm_proxy ();</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> ret = g_dbus_proxy_call_sync (sm_proxy, <span class='string_literal'>"Shutdown"</span>,</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> g_variant_new (<span class='string_literal'>"()"</span>),</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> G_DBUS_CALL_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='keyword'>if</span> (ret == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> g_warning (<span class='string_literal'>"Failed to call shutdown: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> g_variant_unref (ret);</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='keyword'>if</span> (sm_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> g_object_unref (sm_proxy);</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"><span class='keyword'>int</span> main(<span class='keyword'>int</span> argc, <span class='keyword'>char</span>* argv[])</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='keyword'>int</span> conflicting_options;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> <span class='comment'>/* Initialize the i18n stuff */</span></td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"><span class='directive'>#ifdef <span class='macro'>ENABLE_NLS<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> bindtextdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='macro'>LOCALE_DIR<span class='macro_popup'>"/usr/local/share/locale"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> bind_textdomain_codeset(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='string_literal'>"UTF-8"</span>);</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> textdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"><span class='directive'>#endif /* ENABLE_NLS */</span></td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='keyword'>if</span> (!gtk_init_with_args(&argc, &argv, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, options, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &error))</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> g_warning(<span class='string_literal'>"Unable to start: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> g_error_free(error);</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> exit(1);</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> conflicting_options = 0;</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (kill_session)</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> <span class='keyword'>if</span> (logout)</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='keyword'>if</span> (force_logout)</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> <span class='keyword'>if</span> (logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>if</span> (shutdown_dialog)</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> <span class='keyword'>if</span> (conflicting_options > 1)</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> display_error(<span class='macro'>_(<span class='string_literal'>"Program called with conflicting options"</span>)<span class='macro_popup'>gettext ("Program called with conflicting options")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> <span class='keyword'>if</span> (kill_session)</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>if</span> (no_interaction)</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> force_logout = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> logout_dialog = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> <span class='keyword'>if</span> (logout)</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> do_logout(GSM_LOGOUT_MODE_NO_CONFIRMATION);</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (force_logout)</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> do_logout(GSM_LOGOUT_MODE_FORCE);</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> do_logout(GSM_LOGOUT_MODE_NORMAL);</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (shutdown_dialog)</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class="mrange">do_shutdown_dialog</span>();</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:17ex">This statement is never executed</div></td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> <span class='keyword'>return</span> 0;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-cf3974.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-cf3974.html new file mode 100644 index 0000000..8301495 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-cf3974.html @@ -0,0 +1,2089 @@ +<!doctype html> +<html> +<head> +<title>eggsmclient-xsmp.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption --> + +<!-- BUGTYPE Cast from non-struct type to struct type --> + +<!-- BUGCATEGORY Logic error --> + +<!-- BUGFILE /rootdir/mate-submodules/libegg/eggsmclient-xsmp.c --> + +<!-- FILENAME eggsmclient-xsmp.c --> + +<!-- FUNCTIONNAME ptrarray_prop --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT cf3974848df4dca833dffd0d8abcacb0 --> + +<!-- BUGLINE 1232 --> + +<!-- BUGCOLUMN 18 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>mate-submodules/libegg/eggsmclient-xsmp.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 1232, column 18</a><br />Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name eggsmclient-xsmp.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/mate-submodules/libegg -fcoverage-compilation-dir=/rootdir/mate-submodules/libegg -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I ../.. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/freetype2 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/harfbuzz -I /usr/include/uuid -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -D EGG_SM_CLIENT_BACKEND_XSMP -D G_LOG_DOMAIN="EggSMClient" -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/freetype2 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/harfbuzz -I /usr/include/uuid -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -D PIC -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c eggsmclient-xsmp.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"1232": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2007 Novell, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Inspired by various other pieces of code including GsmClient (C)</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* 2001 Havoc Pennington, MateClient (C) 1998 Carsten Schaar, and twm</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* session code (C) 1998 The Open Group.</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* This library is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>* License as published by the Free Software Foundation; either</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* version 2 of the License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* This library is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* Library General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>* License along with this library; if not, write to the</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>* Boston, MA 02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include "config.h"</span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include "eggsmclient.h"</span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include "eggsmclient-private.h"</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include "eggdesktopfile.h"</span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include <<span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span>.h></span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include <fcntl.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#include <X11/SM/SMlib.h></span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#include <gdk/gdk.h></span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"><span class='directive'>#ifdef GDK_WINDOWING_X11</span></td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"><span class='directive'>#define <span class='macro'>EGG_TYPE_SM_CLIENT_XSMP<span class='macro_popup'>(egg_sm_client_xsmp_get_type ())</span></span> (egg_sm_client_xsmp_get_type ())</span></td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"><span class='directive'>#define <span class='macro'>EGG_SM_CLIENT_XSMP(obj)<span class='macro_popup'>((((EggSMClientXSMP*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((obj)), ((egg_sm_client_xsmp_get_type ()))))))</span></span> (<span class='macro'>G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMP)<span class='macro_popup'>(((EggSMClientXSMP*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((obj)), ((egg_sm_client_xsmp_get_type ())))))</span></span>)</span></td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"><span class='directive'>#define <span class='macro'>EGG_SM_CLIENT_XSMP_CLASS(klass)<span class='macro_popup'>((((EggSMClientXSMPClass*) (void *) g_type_check_class_cast (<br>(GTypeClass*) ((klass)), ((egg_sm_client_xsmp_get_type ()))))<br>))</span></span> (<span class='macro'>G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMPClass)<span class='macro_popup'>(((EggSMClientXSMPClass*) (void *) g_type_check_class_cast ((<br>GTypeClass*) ((klass)), ((egg_sm_client_xsmp_get_type ())))))</span></span>)</span></td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='directive'>#define <span class='macro'>EGG_IS_SM_CLIENT_XSMP(obj)<span class='macro_popup'>(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (<br>(obj)); GType __t = ((egg_sm_client_xsmp_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))</span></span> (<span class='macro'>G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT_XSMP)<span class='macro_popup'>((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (<br>(obj)); GType __t = ((egg_sm_client_xsmp_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; })))</span></span>)</span></td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"><span class='directive'>#define <span class='macro'>EGG_IS_SM_CLIENT_XSMP_CLASS(klass)<span class='macro_popup'>(((__extension__ ({ GTypeClass *__class = (GTypeClass*) ((klass<br>)); GType __t = ((egg_sm_client_xsmp_get_type ())); gboolean __r<br>; if (!__class) __r = (0); else if (__class->g_type == __t<br>) __r = (!(0)); else __r = g_type_check_class_is_a (__class, __t<br>); __r; }))))</span></span> (<span class='macro'>G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT_XSMP)<span class='macro_popup'>((__extension__ ({ GTypeClass *__class = (GTypeClass*) ((klass<br>)); GType __t = ((egg_sm_client_xsmp_get_type ())); gboolean __r<br>; if (!__class) __r = (0); else if (__class->g_type == __t<br>) __r = (!(0)); else __r = g_type_check_class_is_a (__class, __t<br>); __r; })))</span></span>)</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='directive'>#define <span class='macro'>EGG_SM_CLIENT_XSMP_GET_CLASS(obj)<span class='macro_popup'>((((EggSMClientXSMPClass*) (((GTypeInstance*) ((obj)))->g_class<br>))))</span></span> (<span class='macro'>G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMPClass)<span class='macro_popup'>(((EggSMClientXSMPClass*) (((GTypeInstance*) ((obj)))->g_class<br>)))</span></span>)</span></td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span> _EggSMClientXSMP EggSMClientXSMP;</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span> _EggSMClientXSMPClass EggSMClientXSMPClass;</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"><span class='comment'>/* These mostly correspond to the similarly-named states in section</span></td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> <span class='comment'>* 9.1 of the XSMP spec. Some of the states there aren't represented</span></td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> <span class='comment'>* here, because we don't need them. SHUTDOWN_CANCELLED is slightly</span></td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> <span class='comment'>* different from the spec; we use it when the client is IDLE after a</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> <span class='comment'>* ShutdownCancelled message, but the application is still interacting</span></td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> <span class='comment'>* and doesn't know the shutdown has been cancelled yet.</span></td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>enum</span></td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> XSMP_STATE_IDLE,</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> XSMP_STATE_SAVE_YOURSELF,</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> XSMP_STATE_INTERACT_REQUEST,</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> XSMP_STATE_INTERACT,</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> XSMP_STATE_SAVE_YOURSELF_DONE,</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> XSMP_STATE_SHUTDOWN_CANCELLED,</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> XSMP_STATE_CONNECTION_CLOSED</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">} EggSMClientXSMPState;</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>const</span> <span class='keyword'>char</span> *state_names[] =</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> <span class='string_literal'>"idle"</span>,</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> <span class='string_literal'>"save-yourself"</span>,</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> <span class='string_literal'>"interact-request"</span>,</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> <span class='string_literal'>"interact"</span>,</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"> <span class='string_literal'>"save-yourself-done"</span>,</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> <span class='string_literal'>"shutdown-cancelled"</span>,</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> <span class='string_literal'>"connection-closed"</span></td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"><span class='directive'>#define <span class='macro'>EGG_SM_CLIENT_XSMP_STATE(xsmp)<span class='macro_popup'>(state_names[(xsmp)->state])</span></span> (state_names[(xsmp)->state])</span></td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"><span class='keyword'>struct</span> _EggSMClientXSMP</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> EggSMClient parent;</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> SmcConn connection;</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> <span class='keyword'>char</span> *client_id;</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> EggSMClientXSMPState state;</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> <span class='keyword'>char</span> **restart_command;</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> gboolean set_restart_command;</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> <span class='keyword'>int</span> restart_style;</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> <span class='keyword'>char</span> **discard_command;</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> gboolean set_discard_command;</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> guint idle;</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> <span class='comment'>/* Current SaveYourself state */</span></td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> guint expecting_initial_save_yourself : 1;</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> guint need_save_state : 1;</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> guint need_quit_requested : 1;</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> guint interact_errors : 1;</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> guint shutting_down : 1;</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='comment'>/* Todo list */</span></td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> guint waiting_to_set_initial_properties : 1;</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> guint waiting_to_emit_quit : 1;</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> guint waiting_to_emit_quit_cancelled : 1;</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> guint waiting_to_save_myself : 1;</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"><span class='keyword'>struct</span> _EggSMClientXSMPClass</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> EggSMClientClass parent_class;</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> sm_client_xsmp_startup (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *client_id);</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> sm_client_xsmp_set_restart_command (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> <span class='keyword'>int</span> argc,</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> **argv);</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> sm_client_xsmp_set_discard_command (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> <span class='keyword'>int</span> argc,</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> **argv);</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> sm_client_xsmp_will_quit (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> gboolean will_quit);</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"><span class='keyword'>static</span> gboolean sm_client_xsmp_end_session (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> EggSMClientEndStyle style,</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> gboolean request_confirmation);</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> xsmp_save_yourself (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> SmPointer client_data,</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> <span class='keyword'>int</span> save_style,</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> shutdown,</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> <span class='keyword'>int</span> interact_style,</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> fast);</td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> xsmp_die (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> SmPointer client_data);</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> xsmp_save_complete (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> SmPointer client_data);</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> xsmp_shutdown_cancelled (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> SmPointer client_data);</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> xsmp_interact (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> SmPointer client_data);</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"><span class='keyword'>static</span> SmProp *array_prop (<span class='keyword'>const</span> <span class='keyword'>char</span> *name,</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> ...);</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"><span class='keyword'>static</span> SmProp *ptrarray_prop (<span class='keyword'>const</span> <span class='keyword'>char</span> *name,</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> GPtrArray *values);</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"><span class='keyword'>static</span> SmProp *string_prop (<span class='keyword'>const</span> <span class='keyword'>char</span> *name,</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *value);</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"><span class='keyword'>static</span> SmProp *card8_prop (<span class='keyword'>const</span> <span class='keyword'>char</span> *name,</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>char</span> value);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> set_properties (EggSMClientXSMP *xsmp, ...);</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> delete_properties (EggSMClientXSMP *xsmp, ...);</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"><span class='keyword'>static</span> GPtrArray *generate_command (<span class='keyword'>char</span> **restart_command,</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *client_id,</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *state_file);</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> save_state (EggSMClientXSMP *xsmp);</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> do_save_yourself (EggSMClientXSMP *xsmp);</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> update_pending_events (EggSMClientXSMP *xsmp);</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> ice_init (<span class='keyword'>void</span>);</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"><span class='keyword'>static</span> gboolean process_ice_messages (IceConn ice_conn);</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> smc_error_handler (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> swap,</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> <span class='keyword'>int</span> offending_minor_opcode,</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>long</span> offending_sequence,</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>int</span> error_class,</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='keyword'>int</span> severity,</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> SmPointer values);</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"><span class='macro'>G_DEFINE_TYPE (EggSMClientXSMP, egg_sm_client_xsmp, EGG_TYPE_SM_CLIENT)<span class='macro_popup'>static void egg_sm_client_xsmp_init (EggSMClientXSMP *self); static<br> void egg_sm_client_xsmp_class_init (EggSMClientXSMPClass *klass<br>); static GType egg_sm_client_xsmp_get_type_once (void); static<br> gpointer egg_sm_client_xsmp_parent_class = ((void*)0); static<br> gint EggSMClientXSMP_private_offset; static void egg_sm_client_xsmp_class_intern_init<br> (gpointer klass) { egg_sm_client_xsmp_parent_class = g_type_class_peek_parent<br> (klass); if (EggSMClientXSMP_private_offset != 0) g_type_class_adjust_private_offset<br> (klass, &EggSMClientXSMP_private_offset); egg_sm_client_xsmp_class_init<br> ((EggSMClientXSMPClass*) klass); } __attribute__ ((__unused__<br>)) static inline gpointer egg_sm_client_xsmp_get_instance_private<br> (EggSMClientXSMP *self) { return (((gpointer) ((guint8*) (self<br>) + (glong) (EggSMClientXSMP_private_offset)))); } GType egg_sm_client_xsmp_get_type<br> (void) { static GType static_g_define_type_id = 0; if ((__extension__<br> ({ _Static_assert (sizeof *(&static_g_define_type_id) ==<br> sizeof (gpointer), "Expression evaluates to false"); (void) (<br>0 ? (gpointer) * (&static_g_define_type_id) : ((void*)0))<br>; (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); __typeof__<br> (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__<br> ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id<br>); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)<br>; gapg_temp_newval; })) && g_once_init_enter_pointer (<br>&static_g_define_type_id)); })) ) { GType g_define_type_id<br> = egg_sm_client_xsmp_get_type_once (); (__extension__ ({ _Static_assert<br> (sizeof *(&static_g_define_type_id) == sizeof (gpointer)<br>, "Expression evaluates to false"); 0 ? (void) (*(&static_g_define_type_id<br>) = (g_define_type_id)) : (void) 0; g_once_init_leave_pointer<br> ((&static_g_define_type_id), (gpointer) (guintptr) (g_define_type_id<br>)); })) ; } return static_g_define_type_id; } __attribute__ (<br>(__noinline__)) static GType egg_sm_client_xsmp_get_type_once<br> (void) { GType g_define_type_id = g_type_register_static_simple<br> ((egg_sm_client_get_type ()), g_intern_static_string ("EggSMClientXSMP"<br>), sizeof (EggSMClientXSMPClass), (GClassInitFunc)(void (*)(void<br>)) egg_sm_client_xsmp_class_intern_init, sizeof (EggSMClientXSMP<br>), (GInstanceInitFunc)(void (*)(void)) egg_sm_client_xsmp_init<br>, (GTypeFlags) 0); { {{};} } return g_define_type_id; }</span></span></td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line">egg_sm_client_xsmp_init (EggSMClientXSMP *xsmp)</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> xsmp->state = XSMP_STATE_CONNECTION_CLOSED;</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> xsmp->connection = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> xsmp->restart_style = <span class='macro'>SmRestartIfRunning<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line">egg_sm_client_xsmp_class_init (EggSMClientXSMPClass *klass)</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> EggSMClientClass *sm_client_class = EGG_SM_CLIENT_CLASS (klass);</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> sm_client_class->startup = sm_client_xsmp_startup;</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> sm_client_class->set_restart_command = sm_client_xsmp_set_restart_command;</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> sm_client_class->set_discard_command = sm_client_xsmp_set_discard_command;</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> sm_client_class->will_quit = sm_client_xsmp_will_quit;</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> sm_client_class->end_session = sm_client_xsmp_end_session;</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">EggSMClient *</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line">egg_sm_client_xsmp_new (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='keyword'>if</span> (!g_getenv (<span class='string_literal'>"SESSION_MANAGER"</span>))</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> <span class='keyword'>return</span> g_object_new (<span class='macro'>EGG_TYPE_SM_CLIENT_XSMP<span class='macro_popup'>(egg_sm_client_xsmp_get_type ())</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line">sm_client_xsmp_set_initial_properties (gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> EggSMClientXSMP *xsmp = user_data;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> EggDesktopFile *desktop_file;</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> GPtrArray *clone, *restart;</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> <span class='keyword'>char</span> pid_str[64];</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='keyword'>if</span> (xsmp->idle)</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> g_source_remove (xsmp->idle);</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> xsmp->idle = 0;</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> xsmp->waiting_to_set_initial_properties = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> <span class='keyword'>if</span> (egg_sm_client_get_mode () == EGG_SM_CLIENT_MODE_NO_RESTART)</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> xsmp->restart_style = <span class='macro'>SmRestartNever<span class='macro_popup'>3</span></span>;</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> <span class='comment'>/* Parse info out of desktop file */</span></td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> desktop_file = egg_get_desktop_file ();</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> <span class='keyword'>if</span> (desktop_file)</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> GError *err = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> <span class='keyword'>char</span> **argv;</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='keyword'>int</span> argc;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> <span class='keyword'>if</span> (xsmp->restart_style == <span class='macro'>SmRestartIfRunning<span class='macro_popup'>0</span></span>)</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>if</span> (egg_desktop_file_get_boolean (desktop_file,</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> <span class='string_literal'>"X-MATE-AutoRestart"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>))</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> xsmp->restart_style = <span class='macro'>SmRestartImmediately<span class='macro_popup'>2</span></span>;</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> <span class='keyword'>if</span> (!xsmp->set_restart_command)</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> <span class='keyword'>char</span> *cmdline;</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> cmdline = egg_desktop_file_parse_exec (desktop_file, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &err);</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> <span class='keyword'>if</span> (cmdline && g_shell_parse_argv (cmdline, &argc, &argv, &err))</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> egg_sm_client_set_restart_command (EGG_SM_CLIENT (xsmp),</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> argc, (<span class='keyword'>const</span> <span class='keyword'>char</span> **)argv);</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> g_strfreev (argv);</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> g_warning (<span class='string_literal'>"Could not parse Exec line in desktop file: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> err->message);</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> g_error_free (err);</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> g_free (cmdline);</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> <span class='keyword'>if</span> (!xsmp->set_restart_command)</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> xsmp->restart_command = g_strsplit (g_get_prgname (), <span class='string_literal'>" "</span>, -1);</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> clone = generate_command (xsmp->restart_command, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> restart = generate_command (xsmp->restart_command, xsmp->client_id, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> g_debug (<span class='string_literal'>"Setting initial properties"</span>);</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> <span class='comment'>/* Program, CloneCommand, RestartCommand, and UserID are required.</span></td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> <span class='comment'>* ProcessID isn't required, but the SM may be able to do something</span></td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='comment'>* useful with it.</span></td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> g_snprintf (pid_str, <span class='keyword'>sizeof</span> (pid_str), <span class='string_literal'>"%lu"</span>, (gulong) getpid ());</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> set_properties (xsmp,</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> string_prop (<span class='macro'>SmProgram<span class='macro_popup'>"Program"</span></span>, g_get_prgname ()),</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> ptrarray_prop (<span class='macro'>SmCloneCommand<span class='macro_popup'>"CloneCommand"</span></span>, clone),</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> ptrarray_prop (<span class='macro'>SmRestartCommand<span class='macro_popup'>"RestartCommand"</span></span>, restart),</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> string_prop (<span class='macro'>SmUserID<span class='macro_popup'>"UserID"</span></span>, g_get_user_name ()),</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> string_prop (<span class='macro'>SmProcessID<span class='macro_popup'>"ProcessID"</span></span>, pid_str),</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> card8_prop (<span class='macro'>SmRestartStyleHint<span class='macro_popup'>"RestartStyleHint"</span></span>, xsmp->restart_style),</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> g_ptr_array_free (clone, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> g_ptr_array_free (restart, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> <span class='keyword'>if</span> (desktop_file)</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> set_properties (xsmp,</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> string_prop (<span class='string_literal'>"_GSM_DesktopFile"</span>, egg_desktop_file_get_source (desktop_file)),</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> update_pending_events (xsmp);</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"><span class='comment'>/* This gets called from two different places: xsmp_die() (when the</span></td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> <span class='comment'>* server asks us to disconnect) and process_ice_messages() (when the</span></td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> <span class='comment'>* server disconnects unexpectedly).</span></td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line">sm_client_xsmp_disconnect (EggSMClientXSMP *xsmp)</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> SmcConn connection;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> <span class='keyword'>if</span> (!xsmp->connection)</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> g_debug (<span class='string_literal'>"Disconnecting"</span>);</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> connection = xsmp->connection;</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> xsmp->connection = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> SmcCloseConnection (connection, 0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> xsmp->state = XSMP_STATE_CONNECTION_CLOSED;</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> xsmp->waiting_to_save_myself = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> update_pending_events (xsmp);</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line">sm_client_xsmp_startup (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *client_id)</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> SmcCallbacks callbacks;</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>char</span> *ret_client_id;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> <span class='keyword'>char</span> error_string_ret[256];</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> xsmp->client_id = <span class='macro'>g_strdup (client_id)<span class='macro_popup'>g_strdup_inline (client_id)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> ice_init ();</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> SmcSetErrorHandler (smc_error_handler);</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> callbacks.save_yourself.callback = xsmp_save_yourself;</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> callbacks.die.callback = xsmp_die;</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> callbacks.save_complete.callback = xsmp_save_complete;</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> callbacks.shutdown_cancelled.callback = xsmp_shutdown_cancelled;</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> callbacks.save_yourself.client_data = xsmp;</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> callbacks.die.client_data = xsmp;</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> callbacks.save_complete.client_data = xsmp;</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> callbacks.shutdown_cancelled.client_data = xsmp;</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> client_id = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> error_string_ret[0] = '\0';</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> xsmp->connection =</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> SmcOpenConnection (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, xsmp, <span class='macro'>SmProtoMajor<span class='macro_popup'>1</span></span>, <span class='macro'>SmProtoMinor<span class='macro_popup'>0</span></span>,</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='macro'>SmcSaveYourselfProcMask<span class='macro_popup'>(1L << 0)</span></span> | <span class='macro'>SmcDieProcMask<span class='macro_popup'>(1L << 1)</span></span> |</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='macro'>SmcSaveCompleteProcMask<span class='macro_popup'>(1L << 2)</span></span> |</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='macro'>SmcShutdownCancelledProcMask<span class='macro_popup'>(1L << 3)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> &callbacks,</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> xsmp->client_id, &ret_client_id,</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='keyword'>sizeof</span> (error_string_ret), error_string_ret);</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='keyword'>if</span> (!xsmp->connection)</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> g_warning (<span class='string_literal'>"Failed to connect to the session manager: %s\n"</span>,</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> error_string_ret[0] ?</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> error_string_ret : <span class='string_literal'>"no error message given"</span>);</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> xsmp->state = XSMP_STATE_CONNECTION_CLOSED;</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='comment'>/* We expect a pointless initial SaveYourself if either (a) we</span></td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> <span class='comment'>* didn't have an initial client ID, or (b) we DID have an initial</span></td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> <span class='comment'>* client ID, but the server rejected it and gave us a new one.</span></td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>if</span> (!xsmp->client_id ||</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> (ret_client_id && strcmp (xsmp->client_id, ret_client_id) != 0))</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> xsmp->expecting_initial_save_yourself = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>if</span> (ret_client_id)</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> g_free (xsmp->client_id);</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> xsmp->client_id = <span class='macro'>g_strdup (ret_client_id)<span class='macro_popup'>g_strdup_inline (ret_client_id)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> free (ret_client_id);</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"><span class='directive'>#ifdef GDK_WINDOWING_X11</span></td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>GDK_IS_X11_DISPLAY (gdk_display_get_default ())<span class='macro_popup'>(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (<br>(gdk_display_get_default ())); GType __t = ((gdk_x11_display_get_type<br>())); gboolean __r; if (!__inst) __r = (0); else if (__inst-><br>g_class && __inst->g_class->g_type == __t) __r =<br> (!(0)); else __r = g_type_check_instance_is_a (__inst, __t);<br> __r; }))))</span></span>)</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> gdk_x11_set_sm_client_id (xsmp->client_id);</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> g_debug (<span class='string_literal'>"Got client ID \"%s\""</span>, xsmp->client_id);</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> xsmp->state = XSMP_STATE_IDLE;</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='comment'>/* Do not set the initial properties until we reach the main loop,</span></td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> <span class='comment'>* so that the application has a chance to call</span></td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> <span class='comment'>* egg_set_desktop_file(). (This may also help the session manager</span></td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> <span class='comment'>* have a better idea of when the application is fully up and</span></td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> <span class='comment'>* running.)</span></td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> xsmp->waiting_to_set_initial_properties = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> xsmp->idle = g_idle_add (sm_client_xsmp_set_initial_properties, client);</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line">sm_client_xsmp_set_restart_command (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> <span class='keyword'>int</span> argc,</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> **argv)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client;</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> g_strfreev (xsmp->restart_command);</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> xsmp->restart_command = <span class='macro'>g_new (<span class='keyword'>char</span> *, argc + 1)<span class='macro_popup'>((char * *) g_malloc_n ((argc + 1), sizeof (char *)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < argc; i++)</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> xsmp->restart_command[i] = <span class='macro'>g_strdup (argv[i])<span class='macro_popup'>g_strdup_inline (argv[i])</span></span>;</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> xsmp->restart_command[i] = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> xsmp->set_restart_command = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line">sm_client_xsmp_set_discard_command (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> <span class='keyword'>int</span> argc,</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> **argv)</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client;</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> g_strfreev (xsmp->discard_command);</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> xsmp->discard_command = <span class='macro'>g_new (<span class='keyword'>char</span> *, argc + 1)<span class='macro_popup'>((char * *) g_malloc_n ((argc + 1), sizeof (char *)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < argc; i++)</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> xsmp->discard_command[i] = <span class='macro'>g_strdup (argv[i])<span class='macro_popup'>g_strdup_inline (argv[i])</span></span>;</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> xsmp->discard_command[i] = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> xsmp->set_discard_command = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line">sm_client_xsmp_will_quit (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> gboolean will_quit)</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client;</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> <span class='keyword'>if</span> (xsmp->state == XSMP_STATE_CONNECTION_CLOSED)</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> <span class='comment'>/* The session manager has already exited! Schedule a quit</span></td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> <span class='comment'>* signal.</span></td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> xsmp->waiting_to_emit_quit = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> update_pending_events (xsmp);</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED)</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> <span class='comment'>/* We received a ShutdownCancelled message while the application</span></td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> <span class='comment'>* was interacting; Schedule a quit_cancelled signal.</span></td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> xsmp->waiting_to_emit_quit_cancelled = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> update_pending_events (xsmp);</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> <span class='macro'>g_return_if_fail (xsmp->state == XSMP_STATE_INTERACT)<span class='macro_popup'>do { if ((xsmp->state == XSMP_STATE_INTERACT)) { } else { g_return_if_fail_warning<br> ("EggSMClient", ((const char*) (__func__)), "xsmp->state == XSMP_STATE_INTERACT"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> g_debug (<span class='string_literal'>"Sending InteractDone(%s)"</span>, will_quit ? <span class='string_literal'>"False"</span> : <span class='string_literal'>"True"</span>);</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> SmcInteractDone (xsmp->connection, !will_quit);</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>if</span> (will_quit && xsmp->need_save_state)</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> save_state (xsmp);</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> g_debug (<span class='string_literal'>"Sending SaveYourselfDone(%s)"</span>, will_quit ? <span class='string_literal'>"True"</span> : <span class='string_literal'>"False"</span>);</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> SmcSaveYourselfDone (xsmp->connection, will_quit);</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE;</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line">sm_client_xsmp_end_session (EggSMClient *client,</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> EggSMClientEndStyle style,</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> gboolean request_confirmation)</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client;</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> <span class='keyword'>int</span> save_type;</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> <span class='comment'>/* To end the session via XSMP, we have to send a</span></td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> <span class='comment'>* SaveYourselfRequest. We aren't allowed to do that if anything</span></td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> <span class='comment'>* else is going on, but we don't want to expose this fact to the</span></td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> <span class='comment'>* application. So we do our best to patch things up here...</span></td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> <span class='comment'>* In the worst case, this method might block for some length of</span></td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> <span class='comment'>* time in process_ice_messages, but the only time that code path is</span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> <span class='comment'>* honestly likely to get hit is if the application tries to end the</span></td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> <span class='comment'>* session as the very first thing it does, in which case it</span></td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> <span class='comment'>* probably won't actually block anyway. It's not worth gunking up</span></td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> <span class='comment'>* the API to try to deal nicely with the other 0.01% of cases where</span></td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> <span class='comment'>* this happens.</span></td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> <span class='keyword'>while</span> (xsmp->state != XSMP_STATE_IDLE ||</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> xsmp->expecting_initial_save_yourself)</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> <span class='comment'>/* If we're already shutting down, we don't need to do anything. */</span></td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> <span class='keyword'>if</span> (xsmp->shutting_down)</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> <span class='keyword'>switch</span> (xsmp->state)</td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> <span class='keyword'>case</span> XSMP_STATE_CONNECTION_CLOSED:</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>case</span> XSMP_STATE_SAVE_YOURSELF:</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> <span class='comment'>/* Trying to log out from the save_state callback? Whatever.</span></td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> <span class='comment'>* Abort the save_state.</span></td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> SmcSaveYourselfDone (xsmp->connection, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE;</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> <span class='keyword'>case</span> XSMP_STATE_INTERACT_REQUEST:</td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>case</span> XSMP_STATE_INTERACT:</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> <span class='keyword'>case</span> XSMP_STATE_SHUTDOWN_CANCELLED:</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> <span class='comment'>/* Already in a shutdown-related state, just ignore</span></td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> <span class='comment'>* the new shutdown request...</span></td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='keyword'>case</span> XSMP_STATE_IDLE:</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='keyword'>if</span> (xsmp->waiting_to_set_initial_properties)</td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> sm_client_xsmp_set_initial_properties (xsmp);</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> <span class='keyword'>if</span> (!xsmp->expecting_initial_save_yourself)</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> <span class='comment'>/* else fall through */</span></td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> <span class='keyword'>case</span> XSMP_STATE_SAVE_YOURSELF_DONE:</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> <span class='comment'>/* We need to wait for some response from the server.*/</span></td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> process_ice_messages (SmcGetIceConnection (xsmp->connection));</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> <span class='comment'>/* Hm... shouldn't happen */</span></td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> <span class='comment'>/* xfce4-session will do the wrong thing if we pass SmSaveGlobal and</span></td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='comment'>* the user chooses to save the session. But mate-session will do</span></td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> <span class='comment'>* the wrong thing if we pass SmSaveBoth and the user chooses NOT to</span></td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> <span class='comment'>* save the session... Sigh.</span></td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> <span class='keyword'>if</span> (!strcmp (SmcVendor (xsmp->connection), <span class='string_literal'>"xfce4-session"</span>))</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> save_type = <span class='macro'>SmSaveBoth<span class='macro_popup'>2</span></span>;</td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> save_type = <span class='macro'>SmSaveGlobal<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> g_debug (<span class='string_literal'>"Sending SaveYourselfRequest(SmSaveGlobal, Shutdown, SmInteractStyleAny, %sFast)"</span>, request_confirmation ? <span class='string_literal'>"!"</span> : <span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> SmcRequestSaveYourself (xsmp->connection,</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> save_type,</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> <span class='macro'>True<span class='macro_popup'>1</span></span>, <span class='comment'>/* shutdown */</span></td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> <span class='macro'>SmInteractStyleAny<span class='macro_popup'>2</span></span>,</td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> !request_confirmation, <span class='comment'>/* fast */</span></td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='macro'>True<span class='macro_popup'>1</span></span> <span class='comment'>/* global */</span>);</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line">idle_do_pending_events (gpointer data)</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> EggSMClientXSMP *xsmp = data;</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> EggSMClient *client = data;</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> xsmp->idle = 0;</td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> <span class='keyword'>if</span> (xsmp->waiting_to_emit_quit)</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> xsmp->waiting_to_emit_quit = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> egg_sm_client_quit (client);</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>if</span> (xsmp->waiting_to_emit_quit_cancelled)</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> xsmp->waiting_to_emit_quit_cancelled = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> egg_sm_client_quit_cancelled (client);</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> xsmp->state = XSMP_STATE_IDLE;</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>if</span> (xsmp->waiting_to_save_myself)</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> xsmp->waiting_to_save_myself = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> do_save_yourself (xsmp);</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line">update_pending_events (EggSMClientXSMP *xsmp)</td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> gboolean want_idle =</td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> xsmp->waiting_to_emit_quit ||</td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> xsmp->waiting_to_emit_quit_cancelled ||</td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> xsmp->waiting_to_save_myself;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> <span class='keyword'>if</span> (want_idle)</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> <span class='keyword'>if</span> (xsmp->idle == 0)</td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> xsmp->idle = g_idle_add (idle_do_pending_events, xsmp);</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> <span class='keyword'>if</span> (xsmp->idle != 0)</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> g_source_remove (xsmp->idle);</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> xsmp->idle = 0;</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line">fix_broken_state (EggSMClientXSMP *xsmp, <span class='keyword'>const</span> <span class='keyword'>char</span> *message,</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> gboolean send_interact_done,</td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> gboolean send_save_yourself_done)</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> g_warning (<span class='string_literal'>"Received XSMP %s message in state %s: client or server error"</span>,</td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"> message, <span class='macro'>EGG_SM_CLIENT_XSMP_STATE (xsmp)<span class='macro_popup'>(state_names[(xsmp)->state])</span></span>);</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line"> <span class='comment'>/* Forget any pending SaveYourself plans we had */</span></td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> xsmp->waiting_to_save_myself = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> update_pending_events (xsmp);</td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> <span class='keyword'>if</span> (send_interact_done)</td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> SmcInteractDone (xsmp->connection, <span class='macro'>False<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> <span class='keyword'>if</span> (send_save_yourself_done)</td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> SmcSaveYourselfDone (xsmp->connection, <span class='macro'>True<span class='macro_popup'>1</span></span>);</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> xsmp->state = send_save_yourself_done ? XSMP_STATE_SAVE_YOURSELF_DONE : XSMP_STATE_IDLE;</td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"><span class='comment'>/* SM callbacks */</span></td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line">xsmp_save_yourself (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> SmPointer client_data,</td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> <span class='keyword'>int</span> save_type,</td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> shutdown,</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> <span class='keyword'>int</span> interact_style,</td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> fast)</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> EggSMClientXSMP *xsmp = client_data;</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> gboolean wants_quit_requested;</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"> g_debug (<span class='string_literal'>"Received SaveYourself(%s, %s, %s, %s) in state %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> save_type == <span class='macro'>SmSaveLocal<span class='macro_popup'>1</span></span> ? <span class='string_literal'>"SmSaveLocal"</span> :</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> save_type == <span class='macro'>SmSaveGlobal<span class='macro_popup'>0</span></span> ? <span class='string_literal'>"SmSaveGlobal"</span> : <span class='string_literal'>"SmSaveBoth"</span>,</td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> shutdown ? <span class='string_literal'>"Shutdown"</span> : <span class='string_literal'>"!Shutdown"</span>,</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line"> interact_style == <span class='macro'>SmInteractStyleAny<span class='macro_popup'>2</span></span> ? <span class='string_literal'>"SmInteractStyleAny"</span> :</td></tr> +<tr class="codeline" data-linenumber="657"><td class="num" id="LN657">657</td><td class="line"> interact_style == <span class='macro'>SmInteractStyleErrors<span class='macro_popup'>1</span></span> ? <span class='string_literal'>"SmInteractStyleErrors"</span> :</td></tr> +<tr class="codeline" data-linenumber="658"><td class="num" id="LN658">658</td><td class="line"> <span class='string_literal'>"SmInteractStyleNone"</span>, fast ? <span class='string_literal'>"Fast"</span> : <span class='string_literal'>"!Fast"</span>,</td></tr> +<tr class="codeline" data-linenumber="659"><td class="num" id="LN659">659</td><td class="line"> <span class='macro'>EGG_SM_CLIENT_XSMP_STATE (xsmp)<span class='macro_popup'>(state_names[(xsmp)->state])</span></span>);</td></tr> +<tr class="codeline" data-linenumber="660"><td class="num" id="LN660">660</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="661"><td class="num" id="LN661">661</td><td class="line"> <span class='keyword'>if</span> (xsmp->state != XSMP_STATE_IDLE &&</td></tr> +<tr class="codeline" data-linenumber="662"><td class="num" id="LN662">662</td><td class="line"> xsmp->state != XSMP_STATE_SHUTDOWN_CANCELLED)</td></tr> +<tr class="codeline" data-linenumber="663"><td class="num" id="LN663">663</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="664"><td class="num" id="LN664">664</td><td class="line"> fix_broken_state (xsmp, <span class='string_literal'>"SaveYourself"</span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="665"><td class="num" id="LN665">665</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="666"><td class="num" id="LN666">666</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="667"><td class="num" id="LN667">667</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="668"><td class="num" id="LN668">668</td><td class="line"> <span class='keyword'>if</span> (xsmp->waiting_to_set_initial_properties)</td></tr> +<tr class="codeline" data-linenumber="669"><td class="num" id="LN669">669</td><td class="line"> sm_client_xsmp_set_initial_properties (xsmp);</td></tr> +<tr class="codeline" data-linenumber="670"><td class="num" id="LN670">670</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="671"><td class="num" id="LN671">671</td><td class="line"> <span class='comment'>/* If this is the initial SaveYourself, ignore it; we've already set</span></td></tr> +<tr class="codeline" data-linenumber="672"><td class="num" id="LN672">672</td><td class="line"> <span class='comment'>* properties and there's no reason to actually save state too.</span></td></tr> +<tr class="codeline" data-linenumber="673"><td class="num" id="LN673">673</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="674"><td class="num" id="LN674">674</td><td class="line"> <span class='keyword'>if</span> (xsmp->expecting_initial_save_yourself)</td></tr> +<tr class="codeline" data-linenumber="675"><td class="num" id="LN675">675</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="676"><td class="num" id="LN676">676</td><td class="line"> xsmp->expecting_initial_save_yourself = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="677"><td class="num" id="LN677">677</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="678"><td class="num" id="LN678">678</td><td class="line"> <span class='keyword'>if</span> (save_type == <span class='macro'>SmSaveLocal<span class='macro_popup'>1</span></span> &&</td></tr> +<tr class="codeline" data-linenumber="679"><td class="num" id="LN679">679</td><td class="line"> interact_style == <span class='macro'>SmInteractStyleNone<span class='macro_popup'>0</span></span> &&</td></tr> +<tr class="codeline" data-linenumber="680"><td class="num" id="LN680">680</td><td class="line"> !shutdown && !fast)</td></tr> +<tr class="codeline" data-linenumber="681"><td class="num" id="LN681">681</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="682"><td class="num" id="LN682">682</td><td class="line"> g_debug (<span class='string_literal'>"Sending SaveYourselfDone(True) for initial SaveYourself"</span>);</td></tr> +<tr class="codeline" data-linenumber="683"><td class="num" id="LN683">683</td><td class="line"> SmcSaveYourselfDone (xsmp->connection, <span class='macro'>True<span class='macro_popup'>1</span></span>);</td></tr> +<tr class="codeline" data-linenumber="684"><td class="num" id="LN684">684</td><td class="line"> <span class='comment'>/* As explained in the comment at the end of</span></td></tr> +<tr class="codeline" data-linenumber="685"><td class="num" id="LN685">685</td><td class="line"> <span class='comment'>* do_save_yourself(), SAVE_YOURSELF_DONE is the correct</span></td></tr> +<tr class="codeline" data-linenumber="686"><td class="num" id="LN686">686</td><td class="line"> <span class='comment'>* state here, not IDLE.</span></td></tr> +<tr class="codeline" data-linenumber="687"><td class="num" id="LN687">687</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="688"><td class="num" id="LN688">688</td><td class="line"> xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE;</td></tr> +<tr class="codeline" data-linenumber="689"><td class="num" id="LN689">689</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="690"><td class="num" id="LN690">690</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="691"><td class="num" id="LN691">691</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="692"><td class="num" id="LN692">692</td><td class="line"> g_warning (<span class='string_literal'>"First SaveYourself was not the expected one!"</span>);</td></tr> +<tr class="codeline" data-linenumber="693"><td class="num" id="LN693">693</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="694"><td class="num" id="LN694">694</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="695"><td class="num" id="LN695">695</td><td class="line"> <span class='comment'>/* Even ignoring the "fast" flag completely, there are still 18</span></td></tr> +<tr class="codeline" data-linenumber="696"><td class="num" id="LN696">696</td><td class="line"> <span class='comment'>* different combinations of save_type, shutdown and interact_style.</span></td></tr> +<tr class="codeline" data-linenumber="697"><td class="num" id="LN697">697</td><td class="line"> <span class='comment'>* We interpret them as follows:</span></td></tr> +<tr class="codeline" data-linenumber="698"><td class="num" id="LN698">698</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="699"><td class="num" id="LN699">699</td><td class="line"> <span class='comment'>* Type Shutdown Interact Interpretation</span></td></tr> +<tr class="codeline" data-linenumber="700"><td class="num" id="LN700">700</td><td class="line"> <span class='comment'>* G F A/E/N do nothing (1)</span></td></tr> +<tr class="codeline" data-linenumber="701"><td class="num" id="LN701">701</td><td class="line"> <span class='comment'>* G T N do nothing (1)*</span></td></tr> +<tr class="codeline" data-linenumber="702"><td class="num" id="LN702">702</td><td class="line"> <span class='comment'>* G T A/E quit_requested (2)</span></td></tr> +<tr class="codeline" data-linenumber="703"><td class="num" id="LN703">703</td><td class="line"> <span class='comment'>* L/B F A/E/N save_state (3)</span></td></tr> +<tr class="codeline" data-linenumber="704"><td class="num" id="LN704">704</td><td class="line"> <span class='comment'>* L/B T N save_state (3)*</span></td></tr> +<tr class="codeline" data-linenumber="705"><td class="num" id="LN705">705</td><td class="line"> <span class='comment'>* L/B T A/E quit_requested, then save_state (4)</span></td></tr> +<tr class="codeline" data-linenumber="706"><td class="num" id="LN706">706</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="707"><td class="num" id="LN707">707</td><td class="line"> <span class='comment'>* 1. Do nothing, because the SM asked us to do something</span></td></tr> +<tr class="codeline" data-linenumber="708"><td class="num" id="LN708">708</td><td class="line"> <span class='comment'>* uninteresting (save open files, but then don't quit</span></td></tr> +<tr class="codeline" data-linenumber="709"><td class="num" id="LN709">709</td><td class="line"> <span class='comment'>* afterward) or rude (save open files without asking the user</span></td></tr> +<tr class="codeline" data-linenumber="710"><td class="num" id="LN710">710</td><td class="line"> <span class='comment'>* for confirmation).</span></td></tr> +<tr class="codeline" data-linenumber="711"><td class="num" id="LN711">711</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="712"><td class="num" id="LN712">712</td><td class="line"> <span class='comment'>* 2. Request interaction and then emit ::quit_requested. This</span></td></tr> +<tr class="codeline" data-linenumber="713"><td class="num" id="LN713">713</td><td class="line"> <span class='comment'>* perhaps isn't quite correct for the SmInteractStyleErrors</span></td></tr> +<tr class="codeline" data-linenumber="714"><td class="num" id="LN714">714</td><td class="line"> <span class='comment'>* case, but we don't care.</span></td></tr> +<tr class="codeline" data-linenumber="715"><td class="num" id="LN715">715</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="716"><td class="num" id="LN716">716</td><td class="line"> <span class='comment'>* 3. Emit ::save_state. The SmSaveBoth SaveYourselfs in these</span></td></tr> +<tr class="codeline" data-linenumber="717"><td class="num" id="LN717">717</td><td class="line"> <span class='comment'>* rows essentially get demoted to SmSaveLocal, because their</span></td></tr> +<tr class="codeline" data-linenumber="718"><td class="num" id="LN718">718</td><td class="line"> <span class='comment'>* Global halves correspond to "do nothing".</span></td></tr> +<tr class="codeline" data-linenumber="719"><td class="num" id="LN719">719</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="720"><td class="num" id="LN720">720</td><td class="line"> <span class='comment'>* 4. Request interaction, emit ::quit_requested, and then emit</span></td></tr> +<tr class="codeline" data-linenumber="721"><td class="num" id="LN721">721</td><td class="line"> <span class='comment'>* ::save_state after interacting. This is the SmSaveBoth</span></td></tr> +<tr class="codeline" data-linenumber="722"><td class="num" id="LN722">722</td><td class="line"> <span class='comment'>* equivalent of #2, but we also promote SmSaveLocal shutdown</span></td></tr> +<tr class="codeline" data-linenumber="723"><td class="num" id="LN723">723</td><td class="line"> <span class='comment'>* SaveYourselfs to SmSaveBoth here, because we want to give</span></td></tr> +<tr class="codeline" data-linenumber="724"><td class="num" id="LN724">724</td><td class="line"> <span class='comment'>* the user a chance to save open files before quitting.</span></td></tr> +<tr class="codeline" data-linenumber="725"><td class="num" id="LN725">725</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="726"><td class="num" id="LN726">726</td><td class="line"> <span class='comment'>* (* It would be nice if we could do something useful when the</span></td></tr> +<tr class="codeline" data-linenumber="727"><td class="num" id="LN727">727</td><td class="line"> <span class='comment'>* session manager sends a SaveYourself with shutdown True and</span></td></tr> +<tr class="codeline" data-linenumber="728"><td class="num" id="LN728">728</td><td class="line"> <span class='comment'>* SmInteractStyleNone. But we can't, so we just pretend it didn't</span></td></tr> +<tr class="codeline" data-linenumber="729"><td class="num" id="LN729">729</td><td class="line"> <span class='comment'>* even tell us it was shutting down. The docs for ::quit mention</span></td></tr> +<tr class="codeline" data-linenumber="730"><td class="num" id="LN730">730</td><td class="line"> <span class='comment'>* that it might not always be preceded by ::quit_requested.)</span></td></tr> +<tr class="codeline" data-linenumber="731"><td class="num" id="LN731">731</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="732"><td class="num" id="LN732">732</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="733"><td class="num" id="LN733">733</td><td class="line"> <span class='comment'>/* As an optimization, we don't actually request interaction and</span></td></tr> +<tr class="codeline" data-linenumber="734"><td class="num" id="LN734">734</td><td class="line"> <span class='comment'>* emit ::quit_requested if the application isn't listening to the</span></td></tr> +<tr class="codeline" data-linenumber="735"><td class="num" id="LN735">735</td><td class="line"> <span class='comment'>* signal.</span></td></tr> +<tr class="codeline" data-linenumber="736"><td class="num" id="LN736">736</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="737"><td class="num" id="LN737">737</td><td class="line"> wants_quit_requested = g_signal_has_handler_pending (xsmp, g_signal_lookup (<span class='string_literal'>"quit_requested"</span>, <span class='macro'>EGG_TYPE_SM_CLIENT<span class='macro_popup'>(egg_sm_client_get_type ())</span></span>), 0, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="738"><td class="num" id="LN738">738</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="739"><td class="num" id="LN739">739</td><td class="line"> xsmp->need_save_state = (save_type != <span class='macro'>SmSaveGlobal<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="740"><td class="num" id="LN740">740</td><td class="line"> xsmp->need_quit_requested = (shutdown && wants_quit_requested &&</td></tr> +<tr class="codeline" data-linenumber="741"><td class="num" id="LN741">741</td><td class="line"> interact_style != <span class='macro'>SmInteractStyleNone<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="742"><td class="num" id="LN742">742</td><td class="line"> xsmp->interact_errors = (interact_style == <span class='macro'>SmInteractStyleErrors<span class='macro_popup'>1</span></span>);</td></tr> +<tr class="codeline" data-linenumber="743"><td class="num" id="LN743">743</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="744"><td class="num" id="LN744">744</td><td class="line"> xsmp->shutting_down = shutdown;</td></tr> +<tr class="codeline" data-linenumber="745"><td class="num" id="LN745">745</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="746"><td class="num" id="LN746">746</td><td class="line"> do_save_yourself (xsmp);</td></tr> +<tr class="codeline" data-linenumber="747"><td class="num" id="LN747">747</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="748"><td class="num" id="LN748">748</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="749"><td class="num" id="LN749">749</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="750"><td class="num" id="LN750">750</td><td class="line">do_save_yourself (EggSMClientXSMP *xsmp)</td></tr> +<tr class="codeline" data-linenumber="751"><td class="num" id="LN751">751</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="752"><td class="num" id="LN752">752</td><td class="line"> <span class='keyword'>if</span> (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED)</td></tr> +<tr class="codeline" data-linenumber="753"><td class="num" id="LN753">753</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="754"><td class="num" id="LN754">754</td><td class="line"> <span class='comment'>/* The SM cancelled a previous SaveYourself, but we haven't yet</span></td></tr> +<tr class="codeline" data-linenumber="755"><td class="num" id="LN755">755</td><td class="line"> <span class='comment'>* had a chance to tell the application, so we can't start</span></td></tr> +<tr class="codeline" data-linenumber="756"><td class="num" id="LN756">756</td><td class="line"> <span class='comment'>* processing this SaveYourself yet.</span></td></tr> +<tr class="codeline" data-linenumber="757"><td class="num" id="LN757">757</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="758"><td class="num" id="LN758">758</td><td class="line"> xsmp->waiting_to_save_myself = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="759"><td class="num" id="LN759">759</td><td class="line"> update_pending_events (xsmp);</td></tr> +<tr class="codeline" data-linenumber="760"><td class="num" id="LN760">760</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="761"><td class="num" id="LN761">761</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="762"><td class="num" id="LN762">762</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="763"><td class="num" id="LN763">763</td><td class="line"> <span class='keyword'>if</span> (xsmp->need_quit_requested)</td></tr> +<tr class="codeline" data-linenumber="764"><td class="num" id="LN764">764</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="765"><td class="num" id="LN765">765</td><td class="line"> xsmp->state = XSMP_STATE_INTERACT_REQUEST;</td></tr> +<tr class="codeline" data-linenumber="766"><td class="num" id="LN766">766</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="767"><td class="num" id="LN767">767</td><td class="line"> g_debug (<span class='string_literal'>"Sending InteractRequest(%s)"</span>,</td></tr> +<tr class="codeline" data-linenumber="768"><td class="num" id="LN768">768</td><td class="line"> xsmp->interact_errors ? <span class='string_literal'>"Error"</span> : <span class='string_literal'>"Normal"</span>);</td></tr> +<tr class="codeline" data-linenumber="769"><td class="num" id="LN769">769</td><td class="line"> SmcInteractRequest (xsmp->connection,</td></tr> +<tr class="codeline" data-linenumber="770"><td class="num" id="LN770">770</td><td class="line"> xsmp->interact_errors ? <span class='macro'>SmDialogError<span class='macro_popup'>0</span></span> : <span class='macro'>SmDialogNormal<span class='macro_popup'>1</span></span>,</td></tr> +<tr class="codeline" data-linenumber="771"><td class="num" id="LN771">771</td><td class="line"> xsmp_interact,</td></tr> +<tr class="codeline" data-linenumber="772"><td class="num" id="LN772">772</td><td class="line"> xsmp);</td></tr> +<tr class="codeline" data-linenumber="773"><td class="num" id="LN773">773</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="774"><td class="num" id="LN774">774</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="775"><td class="num" id="LN775">775</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="776"><td class="num" id="LN776">776</td><td class="line"> <span class='keyword'>if</span> (xsmp->need_save_state)</td></tr> +<tr class="codeline" data-linenumber="777"><td class="num" id="LN777">777</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="778"><td class="num" id="LN778">778</td><td class="line"> save_state (xsmp);</td></tr> +<tr class="codeline" data-linenumber="779"><td class="num" id="LN779">779</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="780"><td class="num" id="LN780">780</td><td class="line"> <span class='comment'>/* Though unlikely, the client could have been disconnected</span></td></tr> +<tr class="codeline" data-linenumber="781"><td class="num" id="LN781">781</td><td class="line"> <span class='comment'>* while the application was saving its state.</span></td></tr> +<tr class="codeline" data-linenumber="782"><td class="num" id="LN782">782</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="783"><td class="num" id="LN783">783</td><td class="line"> <span class='keyword'>if</span> (!xsmp->connection)</td></tr> +<tr class="codeline" data-linenumber="784"><td class="num" id="LN784">784</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="785"><td class="num" id="LN785">785</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="786"><td class="num" id="LN786">786</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="787"><td class="num" id="LN787">787</td><td class="line"> g_debug (<span class='string_literal'>"Sending SaveYourselfDone(True)"</span>);</td></tr> +<tr class="codeline" data-linenumber="788"><td class="num" id="LN788">788</td><td class="line"> SmcSaveYourselfDone (xsmp->connection, <span class='macro'>True<span class='macro_popup'>1</span></span>);</td></tr> +<tr class="codeline" data-linenumber="789"><td class="num" id="LN789">789</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="790"><td class="num" id="LN790">790</td><td class="line"> <span class='comment'>/* The client state diagram in the XSMP spec says that after a</span></td></tr> +<tr class="codeline" data-linenumber="791"><td class="num" id="LN791">791</td><td class="line"> <span class='comment'>* non-shutdown SaveYourself, we go directly back to "idle". But</span></td></tr> +<tr class="codeline" data-linenumber="792"><td class="num" id="LN792">792</td><td class="line"> <span class='comment'>* everything else in both the XSMP spec and the libSM docs</span></td></tr> +<tr class="codeline" data-linenumber="793"><td class="num" id="LN793">793</td><td class="line"> <span class='comment'>* disagrees.</span></td></tr> +<tr class="codeline" data-linenumber="794"><td class="num" id="LN794">794</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="795"><td class="num" id="LN795">795</td><td class="line"> xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE;</td></tr> +<tr class="codeline" data-linenumber="796"><td class="num" id="LN796">796</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="797"><td class="num" id="LN797">797</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="798"><td class="num" id="LN798">798</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="799"><td class="num" id="LN799">799</td><td class="line">save_state (EggSMClientXSMP *xsmp)</td></tr> +<tr class="codeline" data-linenumber="800"><td class="num" id="LN800">800</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="801"><td class="num" id="LN801">801</td><td class="line"> GKeyFile *state_file;</td></tr> +<tr class="codeline" data-linenumber="802"><td class="num" id="LN802">802</td><td class="line"> <span class='keyword'>char</span> *state_file_path, *data;</td></tr> +<tr class="codeline" data-linenumber="803"><td class="num" id="LN803">803</td><td class="line"> EggDesktopFile *desktop_file;</td></tr> +<tr class="codeline" data-linenumber="804"><td class="num" id="LN804">804</td><td class="line"> GPtrArray *restart, *discard;</td></tr> +<tr class="codeline" data-linenumber="805"><td class="num" id="LN805">805</td><td class="line"> <span class='keyword'>int</span> offset, fd;</td></tr> +<tr class="codeline" data-linenumber="806"><td class="num" id="LN806">806</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="807"><td class="num" id="LN807">807</td><td class="line"> <span class='comment'>/* We set xsmp->state before emitting save_state, but our caller is</span></td></tr> +<tr class="codeline" data-linenumber="808"><td class="num" id="LN808">808</td><td class="line"> <span class='comment'>* responsible for setting it back afterward.</span></td></tr> +<tr class="codeline" data-linenumber="809"><td class="num" id="LN809">809</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="810"><td class="num" id="LN810">810</td><td class="line"> xsmp->state = XSMP_STATE_SAVE_YOURSELF;</td></tr> +<tr class="codeline" data-linenumber="811"><td class="num" id="LN811">811</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="812"><td class="num" id="LN812">812</td><td class="line"> state_file = egg_sm_client_save_state ((EggSMClient *)xsmp);</td></tr> +<tr class="codeline" data-linenumber="813"><td class="num" id="LN813">813</td><td class="line"> <span class='keyword'>if</span> (!state_file)</td></tr> +<tr class="codeline" data-linenumber="814"><td class="num" id="LN814">814</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="815"><td class="num" id="LN815">815</td><td class="line"> restart = generate_command (xsmp->restart_command, xsmp->client_id, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="816"><td class="num" id="LN816">816</td><td class="line"> set_properties (xsmp,</td></tr> +<tr class="codeline" data-linenumber="817"><td class="num" id="LN817">817</td><td class="line"> ptrarray_prop (<span class='macro'>SmRestartCommand<span class='macro_popup'>"RestartCommand"</span></span>, restart),</td></tr> +<tr class="codeline" data-linenumber="818"><td class="num" id="LN818">818</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="819"><td class="num" id="LN819">819</td><td class="line"> g_ptr_array_free (restart, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="820"><td class="num" id="LN820">820</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="821"><td class="num" id="LN821">821</td><td class="line"> <span class='keyword'>if</span> (xsmp->set_discard_command)</td></tr> +<tr class="codeline" data-linenumber="822"><td class="num" id="LN822">822</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="823"><td class="num" id="LN823">823</td><td class="line"> discard = generate_command (xsmp->discard_command, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="824"><td class="num" id="LN824">824</td><td class="line"> set_properties (xsmp,</td></tr> +<tr class="codeline" data-linenumber="825"><td class="num" id="LN825">825</td><td class="line"> ptrarray_prop (<span class='macro'>SmDiscardCommand<span class='macro_popup'>"DiscardCommand"</span></span>, discard),</td></tr> +<tr class="codeline" data-linenumber="826"><td class="num" id="LN826">826</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="827"><td class="num" id="LN827">827</td><td class="line"> g_ptr_array_free (discard, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="828"><td class="num" id="LN828">828</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="829"><td class="num" id="LN829">829</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="830"><td class="num" id="LN830">830</td><td class="line"> delete_properties (xsmp, <span class='macro'>SmDiscardCommand<span class='macro_popup'>"DiscardCommand"</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="831"><td class="num" id="LN831">831</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="832"><td class="num" id="LN832">832</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="833"><td class="num" id="LN833">833</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="834"><td class="num" id="LN834">834</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="835"><td class="num" id="LN835">835</td><td class="line"> desktop_file = egg_get_desktop_file ();</td></tr> +<tr class="codeline" data-linenumber="836"><td class="num" id="LN836">836</td><td class="line"> <span class='keyword'>if</span> (desktop_file)</td></tr> +<tr class="codeline" data-linenumber="837"><td class="num" id="LN837">837</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="838"><td class="num" id="LN838">838</td><td class="line"> GKeyFile *merged_file;</td></tr> +<tr class="codeline" data-linenumber="839"><td class="num" id="LN839">839</td><td class="line"> <span class='keyword'>char</span> *desktop_file_path;</td></tr> +<tr class="codeline" data-linenumber="840"><td class="num" id="LN840">840</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="841"><td class="num" id="LN841">841</td><td class="line"> merged_file = g_key_file_new ();</td></tr> +<tr class="codeline" data-linenumber="842"><td class="num" id="LN842">842</td><td class="line"> desktop_file_path =</td></tr> +<tr class="codeline" data-linenumber="843"><td class="num" id="LN843">843</td><td class="line"> g_filename_from_uri (egg_desktop_file_get_source (desktop_file),</td></tr> +<tr class="codeline" data-linenumber="844"><td class="num" id="LN844">844</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="845"><td class="num" id="LN845">845</td><td class="line"> <span class='keyword'>if</span> (desktop_file_path &&</td></tr> +<tr class="codeline" data-linenumber="846"><td class="num" id="LN846">846</td><td class="line"> g_key_file_load_from_file (merged_file, desktop_file_path,</td></tr> +<tr class="codeline" data-linenumber="847"><td class="num" id="LN847">847</td><td class="line"> G_KEY_FILE_KEEP_COMMENTS |</td></tr> +<tr class="codeline" data-linenumber="848"><td class="num" id="LN848">848</td><td class="line"> G_KEY_FILE_KEEP_TRANSLATIONS, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>))</td></tr> +<tr class="codeline" data-linenumber="849"><td class="num" id="LN849">849</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="850"><td class="num" id="LN850">850</td><td class="line"> guint g, k, i;</td></tr> +<tr class="codeline" data-linenumber="851"><td class="num" id="LN851">851</td><td class="line"> <span class='keyword'>char</span> **groups, **keys, *value, *exec;</td></tr> +<tr class="codeline" data-linenumber="852"><td class="num" id="LN852">852</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="853"><td class="num" id="LN853">853</td><td class="line"> groups = g_key_file_get_groups (state_file, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="854"><td class="num" id="LN854">854</td><td class="line"> <span class='keyword'>for</span> (g = 0; groups[g]; g++)</td></tr> +<tr class="codeline" data-linenumber="855"><td class="num" id="LN855">855</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="856"><td class="num" id="LN856">856</td><td class="line"> keys = g_key_file_get_keys (state_file, groups[g], <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="857"><td class="num" id="LN857">857</td><td class="line"> <span class='keyword'>for</span> (k = 0; keys[k]; k++)</td></tr> +<tr class="codeline" data-linenumber="858"><td class="num" id="LN858">858</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="859"><td class="num" id="LN859">859</td><td class="line"> value = g_key_file_get_value (state_file, groups[g],</td></tr> +<tr class="codeline" data-linenumber="860"><td class="num" id="LN860">860</td><td class="line"> keys[k], <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="861"><td class="num" id="LN861">861</td><td class="line"> <span class='keyword'>if</span> (value)</td></tr> +<tr class="codeline" data-linenumber="862"><td class="num" id="LN862">862</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="863"><td class="num" id="LN863">863</td><td class="line"> g_key_file_set_value (merged_file, groups[g],</td></tr> +<tr class="codeline" data-linenumber="864"><td class="num" id="LN864">864</td><td class="line"> keys[k], value);</td></tr> +<tr class="codeline" data-linenumber="865"><td class="num" id="LN865">865</td><td class="line"> g_free (value);</td></tr> +<tr class="codeline" data-linenumber="866"><td class="num" id="LN866">866</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="867"><td class="num" id="LN867">867</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="868"><td class="num" id="LN868">868</td><td class="line"> g_strfreev (keys);</td></tr> +<tr class="codeline" data-linenumber="869"><td class="num" id="LN869">869</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="870"><td class="num" id="LN870">870</td><td class="line"> g_strfreev (groups);</td></tr> +<tr class="codeline" data-linenumber="871"><td class="num" id="LN871">871</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="872"><td class="num" id="LN872">872</td><td class="line"> g_key_file_free (state_file);</td></tr> +<tr class="codeline" data-linenumber="873"><td class="num" id="LN873">873</td><td class="line"> state_file = merged_file;</td></tr> +<tr class="codeline" data-linenumber="874"><td class="num" id="LN874">874</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="875"><td class="num" id="LN875">875</td><td class="line"> <span class='comment'>/* Update Exec key using "--sm-client-state-file %k" */</span></td></tr> +<tr class="codeline" data-linenumber="876"><td class="num" id="LN876">876</td><td class="line"> restart = generate_command (xsmp->restart_command,</td></tr> +<tr class="codeline" data-linenumber="877"><td class="num" id="LN877">877</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='string_literal'>"%k"</span>);</td></tr> +<tr class="codeline" data-linenumber="878"><td class="num" id="LN878">878</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < restart->len; i++)</td></tr> +<tr class="codeline" data-linenumber="879"><td class="num" id="LN879">879</td><td class="line"> restart->pdata[i] = g_shell_quote (restart->pdata[i]);</td></tr> +<tr class="codeline" data-linenumber="880"><td class="num" id="LN880">880</td><td class="line"> g_ptr_array_add (restart, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="881"><td class="num" id="LN881">881</td><td class="line"> exec = g_strjoinv (<span class='string_literal'>" "</span>, (<span class='keyword'>char</span> **)restart->pdata);</td></tr> +<tr class="codeline" data-linenumber="882"><td class="num" id="LN882">882</td><td class="line"> g_strfreev ((<span class='keyword'>char</span> **)restart->pdata);</td></tr> +<tr class="codeline" data-linenumber="883"><td class="num" id="LN883">883</td><td class="line"> g_ptr_array_free (restart, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="884"><td class="num" id="LN884">884</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="885"><td class="num" id="LN885">885</td><td class="line"> g_key_file_set_string (state_file, <span class='macro'>EGG_DESKTOP_FILE_GROUP<span class='macro_popup'>"Desktop Entry"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="886"><td class="num" id="LN886">886</td><td class="line"> <span class='macro'>EGG_DESKTOP_FILE_KEY_EXEC<span class='macro_popup'>"Exec"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="887"><td class="num" id="LN887">887</td><td class="line"> exec);</td></tr> +<tr class="codeline" data-linenumber="888"><td class="num" id="LN888">888</td><td class="line"> g_free (exec);</td></tr> +<tr class="codeline" data-linenumber="889"><td class="num" id="LN889">889</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="890"><td class="num" id="LN890">890</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="891"><td class="num" id="LN891">891</td><td class="line"> desktop_file = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="892"><td class="num" id="LN892">892</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="893"><td class="num" id="LN893">893</td><td class="line"> g_free (desktop_file_path);</td></tr> +<tr class="codeline" data-linenumber="894"><td class="num" id="LN894">894</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="895"><td class="num" id="LN895">895</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="896"><td class="num" id="LN896">896</td><td class="line"> <span class='comment'>/* Now write state_file to disk. (We can't use mktemp(), because</span></td></tr> +<tr class="codeline" data-linenumber="897"><td class="num" id="LN897">897</td><td class="line"> <span class='comment'>* that requires the filename to end with "XXXXXX", and we want</span></td></tr> +<tr class="codeline" data-linenumber="898"><td class="num" id="LN898">898</td><td class="line"> <span class='comment'>* it to end with ".desktop".)</span></td></tr> +<tr class="codeline" data-linenumber="899"><td class="num" id="LN899">899</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="900"><td class="num" id="LN900">900</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="901"><td class="num" id="LN901">901</td><td class="line"> data = g_key_file_to_data (state_file, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="902"><td class="num" id="LN902">902</td><td class="line"> g_key_file_free (state_file);</td></tr> +<tr class="codeline" data-linenumber="903"><td class="num" id="LN903">903</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="904"><td class="num" id="LN904">904</td><td class="line"> offset = 0;</td></tr> +<tr class="codeline" data-linenumber="905"><td class="num" id="LN905">905</td><td class="line"> <span class='keyword'>while</span> (1)</td></tr> +<tr class="codeline" data-linenumber="906"><td class="num" id="LN906">906</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="907"><td class="num" id="LN907">907</td><td class="line"> state_file_path = g_strdup_printf (<span class='string_literal'>"%s%csession-state%c%s-%ld.%s"</span>,</td></tr> +<tr class="codeline" data-linenumber="908"><td class="num" id="LN908">908</td><td class="line"> g_get_user_config_dir (),</td></tr> +<tr class="codeline" data-linenumber="909"><td class="num" id="LN909">909</td><td class="line"> <span class='macro'>G_DIR_SEPARATOR<span class='macro_popup'>'/'</span></span>, <span class='macro'>G_DIR_SEPARATOR<span class='macro_popup'>'/'</span></span>,</td></tr> +<tr class="codeline" data-linenumber="910"><td class="num" id="LN910">910</td><td class="line"> g_get_prgname (),</td></tr> +<tr class="codeline" data-linenumber="911"><td class="num" id="LN911">911</td><td class="line"> (<span class='keyword'>long</span>)time (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) + offset,</td></tr> +<tr class="codeline" data-linenumber="912"><td class="num" id="LN912">912</td><td class="line"> desktop_file ? <span class='string_literal'>"desktop"</span> : <span class='string_literal'>"state"</span>);</td></tr> +<tr class="codeline" data-linenumber="913"><td class="num" id="LN913">913</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="914"><td class="num" id="LN914">914</td><td class="line"> fd = open (state_file_path, <span class='macro'>O_WRONLY<span class='macro_popup'>01</span></span> | <span class='macro'>O_CREAT<span class='macro_popup'>0100</span></span> | <span class='macro'>O_EXCL<span class='macro_popup'>0200</span></span>, 0644);</td></tr> +<tr class="codeline" data-linenumber="915"><td class="num" id="LN915">915</td><td class="line"> <span class='keyword'>if</span> (fd == -1)</td></tr> +<tr class="codeline" data-linenumber="916"><td class="num" id="LN916">916</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="917"><td class="num" id="LN917">917</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span> == <span class='macro'>EEXIST<span class='macro_popup'>17</span></span>)</td></tr> +<tr class="codeline" data-linenumber="918"><td class="num" id="LN918">918</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="919"><td class="num" id="LN919">919</td><td class="line"> offset++;</td></tr> +<tr class="codeline" data-linenumber="920"><td class="num" id="LN920">920</td><td class="line"> g_free (state_file_path);</td></tr> +<tr class="codeline" data-linenumber="921"><td class="num" id="LN921">921</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="922"><td class="num" id="LN922">922</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="923"><td class="num" id="LN923">923</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (<span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span> == <span class='macro'>ENOTDIR<span class='macro_popup'>20</span></span> || <span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span> == <span class='macro'>ENOENT<span class='macro_popup'>2</span></span>)</td></tr> +<tr class="codeline" data-linenumber="924"><td class="num" id="LN924">924</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="925"><td class="num" id="LN925">925</td><td class="line"> <span class='keyword'>char</span> *sep = strrchr (state_file_path, <span class='macro'>G_DIR_SEPARATOR<span class='macro_popup'>'/'</span></span>);</td></tr> +<tr class="codeline" data-linenumber="926"><td class="num" id="LN926">926</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="927"><td class="num" id="LN927">927</td><td class="line"> *sep = '\0';</td></tr> +<tr class="codeline" data-linenumber="928"><td class="num" id="LN928">928</td><td class="line"> <span class='keyword'>if</span> (g_mkdir_with_parents (state_file_path, 0755) != 0)</td></tr> +<tr class="codeline" data-linenumber="929"><td class="num" id="LN929">929</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="930"><td class="num" id="LN930">930</td><td class="line"> g_warning (<span class='string_literal'>"Could not create directory '%s'"</span>,</td></tr> +<tr class="codeline" data-linenumber="931"><td class="num" id="LN931">931</td><td class="line"> state_file_path);</td></tr> +<tr class="codeline" data-linenumber="932"><td class="num" id="LN932">932</td><td class="line"> g_free (state_file_path);</td></tr> +<tr class="codeline" data-linenumber="933"><td class="num" id="LN933">933</td><td class="line"> state_file_path = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="934"><td class="num" id="LN934">934</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="935"><td class="num" id="LN935">935</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="936"><td class="num" id="LN936">936</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="937"><td class="num" id="LN937">937</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="938"><td class="num" id="LN938">938</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="939"><td class="num" id="LN939">939</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="940"><td class="num" id="LN940">940</td><td class="line"> g_warning (<span class='string_literal'>"Could not create file '%s': %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="941"><td class="num" id="LN941">941</td><td class="line"> state_file_path, g_strerror (<span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span>));</td></tr> +<tr class="codeline" data-linenumber="942"><td class="num" id="LN942">942</td><td class="line"> g_free (state_file_path);</td></tr> +<tr class="codeline" data-linenumber="943"><td class="num" id="LN943">943</td><td class="line"> state_file_path = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="944"><td class="num" id="LN944">944</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="945"><td class="num" id="LN945">945</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="946"><td class="num" id="LN946">946</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="947"><td class="num" id="LN947">947</td><td class="line"> close (fd);</td></tr> +<tr class="codeline" data-linenumber="948"><td class="num" id="LN948">948</td><td class="line"> g_file_set_contents (state_file_path, data, -1, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="949"><td class="num" id="LN949">949</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="950"><td class="num" id="LN950">950</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="951"><td class="num" id="LN951">951</td><td class="line"> g_free (data);</td></tr> +<tr class="codeline" data-linenumber="952"><td class="num" id="LN952">952</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="953"><td class="num" id="LN953">953</td><td class="line"> restart = generate_command (xsmp->restart_command, xsmp->client_id,</td></tr> +<tr class="codeline" data-linenumber="954"><td class="num" id="LN954">954</td><td class="line"> state_file_path);</td></tr> +<tr class="codeline" data-linenumber="955"><td class="num" id="LN955">955</td><td class="line"> set_properties (xsmp,</td></tr> +<tr class="codeline" data-linenumber="956"><td class="num" id="LN956">956</td><td class="line"> ptrarray_prop (<span class='macro'>SmRestartCommand<span class='macro_popup'>"RestartCommand"</span></span>, restart),</td></tr> +<tr class="codeline" data-linenumber="957"><td class="num" id="LN957">957</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="958"><td class="num" id="LN958">958</td><td class="line"> g_ptr_array_free (restart, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="959"><td class="num" id="LN959">959</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="960"><td class="num" id="LN960">960</td><td class="line"> <span class='keyword'>if</span> (state_file_path)</td></tr> +<tr class="codeline" data-linenumber="961"><td class="num" id="LN961">961</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="962"><td class="num" id="LN962">962</td><td class="line"> set_properties (xsmp,</td></tr> +<tr class="codeline" data-linenumber="963"><td class="num" id="LN963">963</td><td class="line"> array_prop (<span class='macro'>SmDiscardCommand<span class='macro_popup'>"DiscardCommand"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="964"><td class="num" id="LN964">964</td><td class="line"> <span class='string_literal'>"/bin/rm"</span>, <span class='string_literal'>"-rf"</span>, state_file_path,</td></tr> +<tr class="codeline" data-linenumber="965"><td class="num" id="LN965">965</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>),</td></tr> +<tr class="codeline" data-linenumber="966"><td class="num" id="LN966">966</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="967"><td class="num" id="LN967">967</td><td class="line"> g_free (state_file_path);</td></tr> +<tr class="codeline" data-linenumber="968"><td class="num" id="LN968">968</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="969"><td class="num" id="LN969">969</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="970"><td class="num" id="LN970">970</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="971"><td class="num" id="LN971">971</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="972"><td class="num" id="LN972">972</td><td class="line">xsmp_interact (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="973"><td class="num" id="LN973">973</td><td class="line"> SmPointer client_data)</td></tr> +<tr class="codeline" data-linenumber="974"><td class="num" id="LN974">974</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="975"><td class="num" id="LN975">975</td><td class="line"> EggSMClientXSMP *xsmp = client_data;</td></tr> +<tr class="codeline" data-linenumber="976"><td class="num" id="LN976">976</td><td class="line"> EggSMClient *client = client_data;</td></tr> +<tr class="codeline" data-linenumber="977"><td class="num" id="LN977">977</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="978"><td class="num" id="LN978">978</td><td class="line"> g_debug (<span class='string_literal'>"Received Interact message in state %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="979"><td class="num" id="LN979">979</td><td class="line"> <span class='macro'>EGG_SM_CLIENT_XSMP_STATE (xsmp)<span class='macro_popup'>(state_names[(xsmp)->state])</span></span>);</td></tr> +<tr class="codeline" data-linenumber="980"><td class="num" id="LN980">980</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="981"><td class="num" id="LN981">981</td><td class="line"> <span class='keyword'>if</span> (xsmp->state != XSMP_STATE_INTERACT_REQUEST)</td></tr> +<tr class="codeline" data-linenumber="982"><td class="num" id="LN982">982</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="983"><td class="num" id="LN983">983</td><td class="line"> fix_broken_state (xsmp, <span class='string_literal'>"Interact"</span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="984"><td class="num" id="LN984">984</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="985"><td class="num" id="LN985">985</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="986"><td class="num" id="LN986">986</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="987"><td class="num" id="LN987">987</td><td class="line"> xsmp->state = XSMP_STATE_INTERACT;</td></tr> +<tr class="codeline" data-linenumber="988"><td class="num" id="LN988">988</td><td class="line"> egg_sm_client_quit_requested (client);</td></tr> +<tr class="codeline" data-linenumber="989"><td class="num" id="LN989">989</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="990"><td class="num" id="LN990">990</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="991"><td class="num" id="LN991">991</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="992"><td class="num" id="LN992">992</td><td class="line">xsmp_die (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="993"><td class="num" id="LN993">993</td><td class="line"> SmPointer client_data)</td></tr> +<tr class="codeline" data-linenumber="994"><td class="num" id="LN994">994</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="995"><td class="num" id="LN995">995</td><td class="line"> EggSMClientXSMP *xsmp = client_data;</td></tr> +<tr class="codeline" data-linenumber="996"><td class="num" id="LN996">996</td><td class="line"> EggSMClient *client = client_data;</td></tr> +<tr class="codeline" data-linenumber="997"><td class="num" id="LN997">997</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="998"><td class="num" id="LN998">998</td><td class="line"> g_debug (<span class='string_literal'>"Received Die message in state %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="999"><td class="num" id="LN999">999</td><td class="line"> <span class='macro'>EGG_SM_CLIENT_XSMP_STATE (xsmp)<span class='macro_popup'>(state_names[(xsmp)->state])</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1000"><td class="num" id="LN1000">1000</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1001"><td class="num" id="LN1001">1001</td><td class="line"> sm_client_xsmp_disconnect (xsmp);</td></tr> +<tr class="codeline" data-linenumber="1002"><td class="num" id="LN1002">1002</td><td class="line"> egg_sm_client_quit (client);</td></tr> +<tr class="codeline" data-linenumber="1003"><td class="num" id="LN1003">1003</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1004"><td class="num" id="LN1004">1004</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1005"><td class="num" id="LN1005">1005</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1006"><td class="num" id="LN1006">1006</td><td class="line">xsmp_save_complete (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="1007"><td class="num" id="LN1007">1007</td><td class="line"> SmPointer client_data)</td></tr> +<tr class="codeline" data-linenumber="1008"><td class="num" id="LN1008">1008</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1009"><td class="num" id="LN1009">1009</td><td class="line"> EggSMClientXSMP *xsmp = client_data;</td></tr> +<tr class="codeline" data-linenumber="1010"><td class="num" id="LN1010">1010</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1011"><td class="num" id="LN1011">1011</td><td class="line"> g_debug (<span class='string_literal'>"Received SaveComplete message in state %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="1012"><td class="num" id="LN1012">1012</td><td class="line"> <span class='macro'>EGG_SM_CLIENT_XSMP_STATE (xsmp)<span class='macro_popup'>(state_names[(xsmp)->state])</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1013"><td class="num" id="LN1013">1013</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1014"><td class="num" id="LN1014">1014</td><td class="line"> <span class='keyword'>if</span> (xsmp->state == XSMP_STATE_SAVE_YOURSELF_DONE)</td></tr> +<tr class="codeline" data-linenumber="1015"><td class="num" id="LN1015">1015</td><td class="line"> xsmp->state = XSMP_STATE_IDLE;</td></tr> +<tr class="codeline" data-linenumber="1016"><td class="num" id="LN1016">1016</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="1017"><td class="num" id="LN1017">1017</td><td class="line"> fix_broken_state (xsmp, <span class='string_literal'>"SaveComplete"</span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1018"><td class="num" id="LN1018">1018</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1019"><td class="num" id="LN1019">1019</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1020"><td class="num" id="LN1020">1020</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1021"><td class="num" id="LN1021">1021</td><td class="line">xsmp_shutdown_cancelled (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="1022"><td class="num" id="LN1022">1022</td><td class="line"> SmPointer client_data)</td></tr> +<tr class="codeline" data-linenumber="1023"><td class="num" id="LN1023">1023</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1024"><td class="num" id="LN1024">1024</td><td class="line"> EggSMClientXSMP *xsmp = client_data;</td></tr> +<tr class="codeline" data-linenumber="1025"><td class="num" id="LN1025">1025</td><td class="line"> EggSMClient *client = client_data;</td></tr> +<tr class="codeline" data-linenumber="1026"><td class="num" id="LN1026">1026</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1027"><td class="num" id="LN1027">1027</td><td class="line"> g_debug (<span class='string_literal'>"Received ShutdownCancelled message in state %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="1028"><td class="num" id="LN1028">1028</td><td class="line"> <span class='macro'>EGG_SM_CLIENT_XSMP_STATE (xsmp)<span class='macro_popup'>(state_names[(xsmp)->state])</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1029"><td class="num" id="LN1029">1029</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1030"><td class="num" id="LN1030">1030</td><td class="line"> xsmp->shutting_down = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1031"><td class="num" id="LN1031">1031</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1032"><td class="num" id="LN1032">1032</td><td class="line"> <span class='keyword'>if</span> (xsmp->state == XSMP_STATE_SAVE_YOURSELF_DONE)</td></tr> +<tr class="codeline" data-linenumber="1033"><td class="num" id="LN1033">1033</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1034"><td class="num" id="LN1034">1034</td><td class="line"> <span class='comment'>/* We've finished interacting and now the SM has agreed to</span></td></tr> +<tr class="codeline" data-linenumber="1035"><td class="num" id="LN1035">1035</td><td class="line"> <span class='comment'>* cancel the shutdown.</span></td></tr> +<tr class="codeline" data-linenumber="1036"><td class="num" id="LN1036">1036</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1037"><td class="num" id="LN1037">1037</td><td class="line"> xsmp->state = XSMP_STATE_IDLE;</td></tr> +<tr class="codeline" data-linenumber="1038"><td class="num" id="LN1038">1038</td><td class="line"> egg_sm_client_quit_cancelled (client);</td></tr> +<tr class="codeline" data-linenumber="1039"><td class="num" id="LN1039">1039</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1040"><td class="num" id="LN1040">1040</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED)</td></tr> +<tr class="codeline" data-linenumber="1041"><td class="num" id="LN1041">1041</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1042"><td class="num" id="LN1042">1042</td><td class="line"> <span class='comment'>/* Hm... ok, so we got a shutdown SaveYourself, which got</span></td></tr> +<tr class="codeline" data-linenumber="1043"><td class="num" id="LN1043">1043</td><td class="line"> <span class='comment'>* cancelled, but the application was still interacting, so we</span></td></tr> +<tr class="codeline" data-linenumber="1044"><td class="num" id="LN1044">1044</td><td class="line"> <span class='comment'>* didn't tell it yet, and then *another* SaveYourself arrived,</span></td></tr> +<tr class="codeline" data-linenumber="1045"><td class="num" id="LN1045">1045</td><td class="line"> <span class='comment'>* which we must still be waiting to tell the app about, except</span></td></tr> +<tr class="codeline" data-linenumber="1046"><td class="num" id="LN1046">1046</td><td class="line"> <span class='comment'>* that now that SaveYourself has been cancelled too! Dizzy yet?</span></td></tr> +<tr class="codeline" data-linenumber="1047"><td class="num" id="LN1047">1047</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1048"><td class="num" id="LN1048">1048</td><td class="line"> xsmp->waiting_to_save_myself = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1049"><td class="num" id="LN1049">1049</td><td class="line"> update_pending_events (xsmp);</td></tr> +<tr class="codeline" data-linenumber="1050"><td class="num" id="LN1050">1050</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1051"><td class="num" id="LN1051">1051</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="1052"><td class="num" id="LN1052">1052</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1053"><td class="num" id="LN1053">1053</td><td class="line"> g_debug (<span class='string_literal'>"Sending SaveYourselfDone(False)"</span>);</td></tr> +<tr class="codeline" data-linenumber="1054"><td class="num" id="LN1054">1054</td><td class="line"> SmcSaveYourselfDone (xsmp->connection, <span class='macro'>False<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1055"><td class="num" id="LN1055">1055</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1056"><td class="num" id="LN1056">1056</td><td class="line"> <span class='keyword'>if</span> (xsmp->state == XSMP_STATE_INTERACT)</td></tr> +<tr class="codeline" data-linenumber="1057"><td class="num" id="LN1057">1057</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1058"><td class="num" id="LN1058">1058</td><td class="line"> <span class='comment'>/* The application is currently interacting, so we can't</span></td></tr> +<tr class="codeline" data-linenumber="1059"><td class="num" id="LN1059">1059</td><td class="line"> <span class='comment'>* tell it about the cancellation yet; we will wait until</span></td></tr> +<tr class="codeline" data-linenumber="1060"><td class="num" id="LN1060">1060</td><td class="line"> <span class='comment'>* after it calls egg_sm_client_will_quit().</span></td></tr> +<tr class="codeline" data-linenumber="1061"><td class="num" id="LN1061">1061</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1062"><td class="num" id="LN1062">1062</td><td class="line"> xsmp->state = XSMP_STATE_SHUTDOWN_CANCELLED;</td></tr> +<tr class="codeline" data-linenumber="1063"><td class="num" id="LN1063">1063</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1064"><td class="num" id="LN1064">1064</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="1065"><td class="num" id="LN1065">1065</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1066"><td class="num" id="LN1066">1066</td><td class="line"> <span class='comment'>/* The shutdown was cancelled before the application got a</span></td></tr> +<tr class="codeline" data-linenumber="1067"><td class="num" id="LN1067">1067</td><td class="line"> <span class='comment'>* chance to interact.</span></td></tr> +<tr class="codeline" data-linenumber="1068"><td class="num" id="LN1068">1068</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1069"><td class="num" id="LN1069">1069</td><td class="line"> xsmp->state = XSMP_STATE_IDLE;</td></tr> +<tr class="codeline" data-linenumber="1070"><td class="num" id="LN1070">1070</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1071"><td class="num" id="LN1071">1071</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1072"><td class="num" id="LN1072">1072</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1073"><td class="num" id="LN1073">1073</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1074"><td class="num" id="LN1074">1074</td><td class="line"><span class='comment'>/* Utilities */</span></td></tr> +<tr class="codeline" data-linenumber="1075"><td class="num" id="LN1075">1075</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1076"><td class="num" id="LN1076">1076</td><td class="line"><span class='comment'>/* Create a restart/clone/Exec command based on @restart_command.</span></td></tr> +<tr class="codeline" data-linenumber="1077"><td class="num" id="LN1077">1077</td><td class="line"> <span class='comment'>* If @client_id is non-%NULL, add "--sm-client-id @client_id".</span></td></tr> +<tr class="codeline" data-linenumber="1078"><td class="num" id="LN1078">1078</td><td class="line"> <span class='comment'>* If @state_file is non-%NULL, add "--sm-client-state-file @state_file".</span></td></tr> +<tr class="codeline" data-linenumber="1079"><td class="num" id="LN1079">1079</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="1080"><td class="num" id="LN1080">1080</td><td class="line"> <span class='comment'>* None of the input strings are g_strdup()ed; the caller must keep</span></td></tr> +<tr class="codeline" data-linenumber="1081"><td class="num" id="LN1081">1081</td><td class="line"> <span class='comment'>* them around until it is done with the returned GPtrArray, and must</span></td></tr> +<tr class="codeline" data-linenumber="1082"><td class="num" id="LN1082">1082</td><td class="line"> <span class='comment'>* then free the array, but not its contents.</span></td></tr> +<tr class="codeline" data-linenumber="1083"><td class="num" id="LN1083">1083</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1084"><td class="num" id="LN1084">1084</td><td class="line"><span class='keyword'>static</span> GPtrArray *</td></tr> +<tr class="codeline" data-linenumber="1085"><td class="num" id="LN1085">1085</td><td class="line">generate_command (<span class='keyword'>char</span> **restart_command, <span class='keyword'>const</span> <span class='keyword'>char</span> *client_id,</td></tr> +<tr class="codeline" data-linenumber="1086"><td class="num" id="LN1086">1086</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *state_file)</td></tr> +<tr class="codeline" data-linenumber="1087"><td class="num" id="LN1087">1087</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1088"><td class="num" id="LN1088">1088</td><td class="line"> GPtrArray *cmd;</td></tr> +<tr class="codeline" data-linenumber="1089"><td class="num" id="LN1089">1089</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="1090"><td class="num" id="LN1090">1090</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1091"><td class="num" id="LN1091">1091</td><td class="line"> cmd = g_ptr_array_new ();</td></tr> +<tr class="codeline" data-linenumber="1092"><td class="num" id="LN1092">1092</td><td class="line"> g_ptr_array_add (cmd, restart_command[0]);</td></tr> +<tr class="codeline" data-linenumber="1093"><td class="num" id="LN1093">1093</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1094"><td class="num" id="LN1094">1094</td><td class="line"> <span class='keyword'>if</span> (client_id)</td></tr> +<tr class="codeline" data-linenumber="1095"><td class="num" id="LN1095">1095</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1096"><td class="num" id="LN1096">1096</td><td class="line"> g_ptr_array_add (cmd, (<span class='keyword'>char</span> *)<span class='string_literal'>"--sm-client-id"</span>);</td></tr> +<tr class="codeline" data-linenumber="1097"><td class="num" id="LN1097">1097</td><td class="line"> g_ptr_array_add (cmd, (<span class='keyword'>char</span> *)client_id);</td></tr> +<tr class="codeline" data-linenumber="1098"><td class="num" id="LN1098">1098</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1099"><td class="num" id="LN1099">1099</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1100"><td class="num" id="LN1100">1100</td><td class="line"> <span class='keyword'>if</span> (state_file)</td></tr> +<tr class="codeline" data-linenumber="1101"><td class="num" id="LN1101">1101</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1102"><td class="num" id="LN1102">1102</td><td class="line"> g_ptr_array_add (cmd, (<span class='keyword'>char</span> *)<span class='string_literal'>"--sm-client-state-file"</span>);</td></tr> +<tr class="codeline" data-linenumber="1103"><td class="num" id="LN1103">1103</td><td class="line"> g_ptr_array_add (cmd, (<span class='keyword'>char</span> *)state_file);</td></tr> +<tr class="codeline" data-linenumber="1104"><td class="num" id="LN1104">1104</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1105"><td class="num" id="LN1105">1105</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1106"><td class="num" id="LN1106">1106</td><td class="line"> <span class='keyword'>for</span> (i = 1; restart_command[i]; i++)</td></tr> +<tr class="codeline" data-linenumber="1107"><td class="num" id="LN1107">1107</td><td class="line"> g_ptr_array_add (cmd, restart_command[i]);</td></tr> +<tr class="codeline" data-linenumber="1108"><td class="num" id="LN1108">1108</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1109"><td class="num" id="LN1109">1109</td><td class="line"> <span class='keyword'>return</span> cmd;</td></tr> +<tr class="codeline" data-linenumber="1110"><td class="num" id="LN1110">1110</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1111"><td class="num" id="LN1111">1111</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1112"><td class="num" id="LN1112">1112</td><td class="line"><span class='comment'>/* Takes a NULL-terminated list of SmProp * values, created by</span></td></tr> +<tr class="codeline" data-linenumber="1113"><td class="num" id="LN1113">1113</td><td class="line"> <span class='comment'>* array_prop, ptrarray_prop, string_prop, card8_prop, sets them, and</span></td></tr> +<tr class="codeline" data-linenumber="1114"><td class="num" id="LN1114">1114</td><td class="line"> <span class='comment'>* frees them.</span></td></tr> +<tr class="codeline" data-linenumber="1115"><td class="num" id="LN1115">1115</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1116"><td class="num" id="LN1116">1116</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1117"><td class="num" id="LN1117">1117</td><td class="line">set_properties (EggSMClientXSMP *xsmp, ...)</td></tr> +<tr class="codeline" data-linenumber="1118"><td class="num" id="LN1118">1118</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1119"><td class="num" id="LN1119">1119</td><td class="line"> GPtrArray *props;</td></tr> +<tr class="codeline" data-linenumber="1120"><td class="num" id="LN1120">1120</td><td class="line"> SmProp *prop;</td></tr> +<tr class="codeline" data-linenumber="1121"><td class="num" id="LN1121">1121</td><td class="line"> va_list ap;</td></tr> +<tr class="codeline" data-linenumber="1122"><td class="num" id="LN1122">1122</td><td class="line"> guint i;</td></tr> +<tr class="codeline" data-linenumber="1123"><td class="num" id="LN1123">1123</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1124"><td class="num" id="LN1124">1124</td><td class="line"> props = g_ptr_array_new ();</td></tr> +<tr class="codeline" data-linenumber="1125"><td class="num" id="LN1125">1125</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1126"><td class="num" id="LN1126">1126</td><td class="line"> <span class='macro'>va_start (ap, xsmp)<span class='macro_popup'>__builtin_va_start(ap, xsmp)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1127"><td class="num" id="LN1127">1127</td><td class="line"> <span class='keyword'>while</span> ((prop = <span class='macro'>va_arg (ap, SmProp *)<span class='macro_popup'>__builtin_va_arg(ap, SmProp *)</span></span>))</td></tr> +<tr class="codeline" data-linenumber="1128"><td class="num" id="LN1128">1128</td><td class="line"> g_ptr_array_add (props, prop);</td></tr> +<tr class="codeline" data-linenumber="1129"><td class="num" id="LN1129">1129</td><td class="line"> <span class='macro'>va_end (ap)<span class='macro_popup'>__builtin_va_end(ap)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1130"><td class="num" id="LN1130">1130</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1131"><td class="num" id="LN1131">1131</td><td class="line"> <span class='keyword'>if</span> (xsmp->connection)</td></tr> +<tr class="codeline" data-linenumber="1132"><td class="num" id="LN1132">1132</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1133"><td class="num" id="LN1133">1133</td><td class="line"> SmcSetProperties (xsmp->connection, props->len,</td></tr> +<tr class="codeline" data-linenumber="1134"><td class="num" id="LN1134">1134</td><td class="line"> (SmProp **)props->pdata);</td></tr> +<tr class="codeline" data-linenumber="1135"><td class="num" id="LN1135">1135</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1136"><td class="num" id="LN1136">1136</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1137"><td class="num" id="LN1137">1137</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < props->len; i++)</td></tr> +<tr class="codeline" data-linenumber="1138"><td class="num" id="LN1138">1138</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1139"><td class="num" id="LN1139">1139</td><td class="line"> prop = props->pdata[i];</td></tr> +<tr class="codeline" data-linenumber="1140"><td class="num" id="LN1140">1140</td><td class="line"> g_free (prop->vals);</td></tr> +<tr class="codeline" data-linenumber="1141"><td class="num" id="LN1141">1141</td><td class="line"> g_free (prop);</td></tr> +<tr class="codeline" data-linenumber="1142"><td class="num" id="LN1142">1142</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1143"><td class="num" id="LN1143">1143</td><td class="line"> g_ptr_array_free (props, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1144"><td class="num" id="LN1144">1144</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1145"><td class="num" id="LN1145">1145</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1146"><td class="num" id="LN1146">1146</td><td class="line"><span class='comment'>/* Takes a NULL-terminated list of property names and deletes them. */</span></td></tr> +<tr class="codeline" data-linenumber="1147"><td class="num" id="LN1147">1147</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1148"><td class="num" id="LN1148">1148</td><td class="line">delete_properties (EggSMClientXSMP *xsmp, ...)</td></tr> +<tr class="codeline" data-linenumber="1149"><td class="num" id="LN1149">1149</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1150"><td class="num" id="LN1150">1150</td><td class="line"> GPtrArray *props;</td></tr> +<tr class="codeline" data-linenumber="1151"><td class="num" id="LN1151">1151</td><td class="line"> <span class='keyword'>char</span> *prop;</td></tr> +<tr class="codeline" data-linenumber="1152"><td class="num" id="LN1152">1152</td><td class="line"> va_list ap;</td></tr> +<tr class="codeline" data-linenumber="1153"><td class="num" id="LN1153">1153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1154"><td class="num" id="LN1154">1154</td><td class="line"> <span class='keyword'>if</span> (!xsmp->connection)</td></tr> +<tr class="codeline" data-linenumber="1155"><td class="num" id="LN1155">1155</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1156"><td class="num" id="LN1156">1156</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1157"><td class="num" id="LN1157">1157</td><td class="line"> props = g_ptr_array_new ();</td></tr> +<tr class="codeline" data-linenumber="1158"><td class="num" id="LN1158">1158</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1159"><td class="num" id="LN1159">1159</td><td class="line"> <span class='macro'>va_start (ap, xsmp)<span class='macro_popup'>__builtin_va_start(ap, xsmp)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1160"><td class="num" id="LN1160">1160</td><td class="line"> <span class='keyword'>while</span> ((prop = <span class='macro'>va_arg (ap, <span class='keyword'>char</span> *)<span class='macro_popup'>__builtin_va_arg(ap, char *)</span></span>))</td></tr> +<tr class="codeline" data-linenumber="1161"><td class="num" id="LN1161">1161</td><td class="line"> g_ptr_array_add (props, prop);</td></tr> +<tr class="codeline" data-linenumber="1162"><td class="num" id="LN1162">1162</td><td class="line"> <span class='macro'>va_end (ap)<span class='macro_popup'>__builtin_va_end(ap)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1163"><td class="num" id="LN1163">1163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1164"><td class="num" id="LN1164">1164</td><td class="line"> SmcDeleteProperties (xsmp->connection, props->len,</td></tr> +<tr class="codeline" data-linenumber="1165"><td class="num" id="LN1165">1165</td><td class="line"> (<span class='keyword'>char</span> **)props->pdata);</td></tr> +<tr class="codeline" data-linenumber="1166"><td class="num" id="LN1166">1166</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1167"><td class="num" id="LN1167">1167</td><td class="line"> g_ptr_array_free (props, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1168"><td class="num" id="LN1168">1168</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1169"><td class="num" id="LN1169">1169</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1170"><td class="num" id="LN1170">1170</td><td class="line"><span class='comment'>/* Takes an array of strings and creates a LISTofARRAY8 property. The</span></td></tr> +<tr class="codeline" data-linenumber="1171"><td class="num" id="LN1171">1171</td><td class="line"> <span class='comment'>* strings are neither dupped nor freed; they need to remain valid</span></td></tr> +<tr class="codeline" data-linenumber="1172"><td class="num" id="LN1172">1172</td><td class="line"> <span class='comment'>* until you're done with the SmProp.</span></td></tr> +<tr class="codeline" data-linenumber="1173"><td class="num" id="LN1173">1173</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1174"><td class="num" id="LN1174">1174</td><td class="line"><span class='keyword'>static</span> SmProp *</td></tr> +<tr class="codeline" data-linenumber="1175"><td class="num" id="LN1175">1175</td><td class="line">array_prop (<span class='keyword'>const</span> <span class='keyword'>char</span> *name, ...)</td></tr> +<tr class="codeline" data-linenumber="1176"><td class="num" id="LN1176">1176</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1177"><td class="num" id="LN1177">1177</td><td class="line"> SmProp *prop;</td></tr> +<tr class="codeline" data-linenumber="1178"><td class="num" id="LN1178">1178</td><td class="line"> SmPropValue pv;</td></tr> +<tr class="codeline" data-linenumber="1179"><td class="num" id="LN1179">1179</td><td class="line"> GArray *vals;</td></tr> +<tr class="codeline" data-linenumber="1180"><td class="num" id="LN1180">1180</td><td class="line"> <span class='keyword'>char</span> *value;</td></tr> +<tr class="codeline" data-linenumber="1181"><td class="num" id="LN1181">1181</td><td class="line"> va_list ap;</td></tr> +<tr class="codeline" data-linenumber="1182"><td class="num" id="LN1182">1182</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1183"><td class="num" id="LN1183">1183</td><td class="line"> prop = <span class='macro'>g_new (SmProp, 1)<span class='macro_popup'>((SmProp *) g_malloc_n ((1), sizeof (SmProp)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1184"><td class="num" id="LN1184">1184</td><td class="line"> prop->name = (<span class='keyword'>char</span> *)name;</td></tr> +<tr class="codeline" data-linenumber="1185"><td class="num" id="LN1185">1185</td><td class="line"> prop->type = (<span class='keyword'>char</span> *)<span class='macro'>SmLISTofARRAY8<span class='macro_popup'>"LISTofARRAY8"</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1186"><td class="num" id="LN1186">1186</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1187"><td class="num" id="LN1187">1187</td><td class="line"> vals = g_array_new (<span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>, <span class='keyword'>sizeof</span> (SmPropValue));</td></tr> +<tr class="codeline" data-linenumber="1188"><td class="num" id="LN1188">1188</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1189"><td class="num" id="LN1189">1189</td><td class="line"> <span class='macro'>va_start (ap, name)<span class='macro_popup'>__builtin_va_start(ap, name)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1190"><td class="num" id="LN1190">1190</td><td class="line"> <span class='keyword'>while</span> ((value = <span class='macro'>va_arg (ap, <span class='keyword'>char</span> *)<span class='macro_popup'>__builtin_va_arg(ap, char *)</span></span>))</td></tr> +<tr class="codeline" data-linenumber="1191"><td class="num" id="LN1191">1191</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1192"><td class="num" id="LN1192">1192</td><td class="line"> pv.length = strlen (value);</td></tr> +<tr class="codeline" data-linenumber="1193"><td class="num" id="LN1193">1193</td><td class="line"> pv.value = value;</td></tr> +<tr class="codeline" data-linenumber="1194"><td class="num" id="LN1194">1194</td><td class="line"> <span class='macro'>g_array_append_val (vals, pv)<span class='macro_popup'>g_array_append_vals (vals, &(pv), 1)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1195"><td class="num" id="LN1195">1195</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1196"><td class="num" id="LN1196">1196</td><td class="line"> <span class='macro'>va_end (ap)<span class='macro_popup'>__builtin_va_end(ap)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1197"><td class="num" id="LN1197">1197</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1198"><td class="num" id="LN1198">1198</td><td class="line"> prop->num_vals = vals->len;</td></tr> +<tr class="codeline" data-linenumber="1199"><td class="num" id="LN1199">1199</td><td class="line"> prop->vals = (SmPropValue *)vals->data;</td></tr> +<tr class="codeline" data-linenumber="1200"><td class="num" id="LN1200">1200</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1201"><td class="num" id="LN1201">1201</td><td class="line"> g_array_free (vals, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1202"><td class="num" id="LN1202">1202</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1203"><td class="num" id="LN1203">1203</td><td class="line"> <span class='keyword'>return</span> prop;</td></tr> +<tr class="codeline" data-linenumber="1204"><td class="num" id="LN1204">1204</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1205"><td class="num" id="LN1205">1205</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1206"><td class="num" id="LN1206">1206</td><td class="line"><span class='comment'>/* Takes a GPtrArray of strings and creates a LISTofARRAY8 property.</span></td></tr> +<tr class="codeline" data-linenumber="1207"><td class="num" id="LN1207">1207</td><td class="line"> <span class='comment'>* The array contents are neither dupped nor freed; they need to</span></td></tr> +<tr class="codeline" data-linenumber="1208"><td class="num" id="LN1208">1208</td><td class="line"> <span class='comment'>* remain valid until you're done with the SmProp.</span></td></tr> +<tr class="codeline" data-linenumber="1209"><td class="num" id="LN1209">1209</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1210"><td class="num" id="LN1210">1210</td><td class="line"><span class='keyword'>static</span> SmProp *</td></tr> +<tr class="codeline" data-linenumber="1211"><td class="num" id="LN1211">1211</td><td class="line">ptrarray_prop (<span class='keyword'>const</span> <span class='keyword'>char</span> *name, GPtrArray *values)</td></tr> +<tr class="codeline" data-linenumber="1212"><td class="num" id="LN1212">1212</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1213"><td class="num" id="LN1213">1213</td><td class="line"> SmProp *prop;</td></tr> +<tr class="codeline" data-linenumber="1214"><td class="num" id="LN1214">1214</td><td class="line"> SmPropValue pv;</td></tr> +<tr class="codeline" data-linenumber="1215"><td class="num" id="LN1215">1215</td><td class="line"> GArray *vals;</td></tr> +<tr class="codeline" data-linenumber="1216"><td class="num" id="LN1216">1216</td><td class="line"> guint i;</td></tr> +<tr class="codeline" data-linenumber="1217"><td class="num" id="LN1217">1217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1218"><td class="num" id="LN1218">1218</td><td class="line"> prop = <span class='macro'>g_new (SmProp, 1)<span class='macro_popup'>((SmProp *) g_malloc_n ((1), sizeof (SmProp)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1219"><td class="num" id="LN1219">1219</td><td class="line"> prop->name = (<span class='keyword'>char</span> *)name;</td></tr> +<tr class="codeline" data-linenumber="1220"><td class="num" id="LN1220">1220</td><td class="line"> prop->type = (<span class='keyword'>char</span> *)<span class='macro'>SmLISTofARRAY8<span class='macro_popup'>"LISTofARRAY8"</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1221"><td class="num" id="LN1221">1221</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1222"><td class="num" id="LN1222">1222</td><td class="line"> vals = g_array_new (<span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>, <span class='keyword'>sizeof</span> (SmPropValue));</td></tr> +<tr class="codeline" data-linenumber="1223"><td class="num" id="LN1223">1223</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1224"><td class="num" id="LN1224">1224</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < values->len; i++)</td></tr> +<tr class="codeline" data-linenumber="1225"><td class="num" id="LN1225">1225</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1226"><td class="num" id="LN1226">1226</td><td class="line"> pv.length = strlen (values->pdata[i]);</td></tr> +<tr class="codeline" data-linenumber="1227"><td class="num" id="LN1227">1227</td><td class="line"> pv.value = values->pdata[i];</td></tr> +<tr class="codeline" data-linenumber="1228"><td class="num" id="LN1228">1228</td><td class="line"> <span class='macro'>g_array_append_val (vals, pv)<span class='macro_popup'>g_array_append_vals (vals, &(pv), 1)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1229"><td class="num" id="LN1229">1229</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1230"><td class="num" id="LN1230">1230</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1231"><td class="num" id="LN1231">1231</td><td class="line"> prop->num_vals = vals->len;</td></tr> +<tr class="codeline" data-linenumber="1232"><td class="num" id="LN1232">1232</td><td class="line"> prop->vals = <span class="mrange"><span class="mrange">(SmPropValue *)vals->data</span></span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:18ex; max-width:31em">Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption</div></td></tr> +<tr class="codeline" data-linenumber="1233"><td class="num" id="LN1233">1233</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1234"><td class="num" id="LN1234">1234</td><td class="line"> g_array_free (vals, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1235"><td class="num" id="LN1235">1235</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1236"><td class="num" id="LN1236">1236</td><td class="line"> <span class='keyword'>return</span> prop;</td></tr> +<tr class="codeline" data-linenumber="1237"><td class="num" id="LN1237">1237</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1238"><td class="num" id="LN1238">1238</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1239"><td class="num" id="LN1239">1239</td><td class="line"><span class='comment'>/* Takes a string and creates an ARRAY8 property. The string is</span></td></tr> +<tr class="codeline" data-linenumber="1240"><td class="num" id="LN1240">1240</td><td class="line"> <span class='comment'>* neither dupped nor freed; it needs to remain valid until you're</span></td></tr> +<tr class="codeline" data-linenumber="1241"><td class="num" id="LN1241">1241</td><td class="line"> <span class='comment'>* done with the SmProp.</span></td></tr> +<tr class="codeline" data-linenumber="1242"><td class="num" id="LN1242">1242</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1243"><td class="num" id="LN1243">1243</td><td class="line"><span class='keyword'>static</span> SmProp *</td></tr> +<tr class="codeline" data-linenumber="1244"><td class="num" id="LN1244">1244</td><td class="line">string_prop (<span class='keyword'>const</span> <span class='keyword'>char</span> *name, <span class='keyword'>const</span> <span class='keyword'>char</span> *value)</td></tr> +<tr class="codeline" data-linenumber="1245"><td class="num" id="LN1245">1245</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1246"><td class="num" id="LN1246">1246</td><td class="line"> SmProp *prop;</td></tr> +<tr class="codeline" data-linenumber="1247"><td class="num" id="LN1247">1247</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1248"><td class="num" id="LN1248">1248</td><td class="line"> prop = <span class='macro'>g_new (SmProp, 1)<span class='macro_popup'>((SmProp *) g_malloc_n ((1), sizeof (SmProp)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1249"><td class="num" id="LN1249">1249</td><td class="line"> prop->name = (<span class='keyword'>char</span> *)name;</td></tr> +<tr class="codeline" data-linenumber="1250"><td class="num" id="LN1250">1250</td><td class="line"> prop->type = (<span class='keyword'>char</span> *)<span class='macro'>SmARRAY8<span class='macro_popup'>"ARRAY8"</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1251"><td class="num" id="LN1251">1251</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1252"><td class="num" id="LN1252">1252</td><td class="line"> prop->num_vals = 1;</td></tr> +<tr class="codeline" data-linenumber="1253"><td class="num" id="LN1253">1253</td><td class="line"> prop->vals = <span class='macro'>g_new (SmPropValue, 1)<span class='macro_popup'>((SmPropValue *) g_malloc_n ((1), sizeof (SmPropValue)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1254"><td class="num" id="LN1254">1254</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1255"><td class="num" id="LN1255">1255</td><td class="line"> prop->vals[0].length = strlen (value);</td></tr> +<tr class="codeline" data-linenumber="1256"><td class="num" id="LN1256">1256</td><td class="line"> prop->vals[0].value = (<span class='keyword'>char</span> *)value;</td></tr> +<tr class="codeline" data-linenumber="1257"><td class="num" id="LN1257">1257</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1258"><td class="num" id="LN1258">1258</td><td class="line"> <span class='keyword'>return</span> prop;</td></tr> +<tr class="codeline" data-linenumber="1259"><td class="num" id="LN1259">1259</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1260"><td class="num" id="LN1260">1260</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1261"><td class="num" id="LN1261">1261</td><td class="line"><span class='comment'>/* Takes a char and creates a CARD8 property. */</span></td></tr> +<tr class="codeline" data-linenumber="1262"><td class="num" id="LN1262">1262</td><td class="line"><span class='keyword'>static</span> SmProp *</td></tr> +<tr class="codeline" data-linenumber="1263"><td class="num" id="LN1263">1263</td><td class="line">card8_prop (<span class='keyword'>const</span> <span class='keyword'>char</span> *name, <span class='keyword'>unsigned</span> <span class='keyword'>char</span> value)</td></tr> +<tr class="codeline" data-linenumber="1264"><td class="num" id="LN1264">1264</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1265"><td class="num" id="LN1265">1265</td><td class="line"> SmProp *prop;</td></tr> +<tr class="codeline" data-linenumber="1266"><td class="num" id="LN1266">1266</td><td class="line"> <span class='keyword'>char</span> *card8val;</td></tr> +<tr class="codeline" data-linenumber="1267"><td class="num" id="LN1267">1267</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1268"><td class="num" id="LN1268">1268</td><td class="line"> <span class='comment'>/* To avoid having to allocate and free prop->vals[0], we cheat and</span></td></tr> +<tr class="codeline" data-linenumber="1269"><td class="num" id="LN1269">1269</td><td class="line"> <span class='comment'>* make vals a 2-element-long array and then use the second element</span></td></tr> +<tr class="codeline" data-linenumber="1270"><td class="num" id="LN1270">1270</td><td class="line"> <span class='comment'>* to store value.</span></td></tr> +<tr class="codeline" data-linenumber="1271"><td class="num" id="LN1271">1271</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1272"><td class="num" id="LN1272">1272</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1273"><td class="num" id="LN1273">1273</td><td class="line"> prop = <span class='macro'>g_new (SmProp, 1)<span class='macro_popup'>((SmProp *) g_malloc_n ((1), sizeof (SmProp)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1274"><td class="num" id="LN1274">1274</td><td class="line"> prop->name = (<span class='keyword'>char</span> *)name;</td></tr> +<tr class="codeline" data-linenumber="1275"><td class="num" id="LN1275">1275</td><td class="line"> prop->type = (<span class='keyword'>char</span> *)<span class='macro'>SmCARD8<span class='macro_popup'>"CARD8"</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1276"><td class="num" id="LN1276">1276</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1277"><td class="num" id="LN1277">1277</td><td class="line"> prop->num_vals = 1;</td></tr> +<tr class="codeline" data-linenumber="1278"><td class="num" id="LN1278">1278</td><td class="line"> prop->vals = <span class='macro'>g_new (SmPropValue, 2)<span class='macro_popup'>((SmPropValue *) g_malloc_n ((2), sizeof (SmPropValue)))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1279"><td class="num" id="LN1279">1279</td><td class="line"> card8val = (<span class='keyword'>char</span> *)(&prop->vals[1]);</td></tr> +<tr class="codeline" data-linenumber="1280"><td class="num" id="LN1280">1280</td><td class="line"> card8val[0] = value;</td></tr> +<tr class="codeline" data-linenumber="1281"><td class="num" id="LN1281">1281</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1282"><td class="num" id="LN1282">1282</td><td class="line"> prop->vals[0].length = 1;</td></tr> +<tr class="codeline" data-linenumber="1283"><td class="num" id="LN1283">1283</td><td class="line"> prop->vals[0].value = card8val;</td></tr> +<tr class="codeline" data-linenumber="1284"><td class="num" id="LN1284">1284</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1285"><td class="num" id="LN1285">1285</td><td class="line"> <span class='keyword'>return</span> prop;</td></tr> +<tr class="codeline" data-linenumber="1286"><td class="num" id="LN1286">1286</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1287"><td class="num" id="LN1287">1287</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1288"><td class="num" id="LN1288">1288</td><td class="line"><span class='comment'>/* ICE code. This makes no effort to play nice with anyone else trying</span></td></tr> +<tr class="codeline" data-linenumber="1289"><td class="num" id="LN1289">1289</td><td class="line"> <span class='comment'>* to use libICE. Fortunately, no one uses libICE for anything other</span></td></tr> +<tr class="codeline" data-linenumber="1290"><td class="num" id="LN1290">1290</td><td class="line"> <span class='comment'>* than SM. (DCOP uses ICE, but it has its own private copy of</span></td></tr> +<tr class="codeline" data-linenumber="1291"><td class="num" id="LN1291">1291</td><td class="line"> <span class='comment'>* libICE.)</span></td></tr> +<tr class="codeline" data-linenumber="1292"><td class="num" id="LN1292">1292</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="1293"><td class="num" id="LN1293">1293</td><td class="line"> <span class='comment'>* When this moves to gtk, it will need to be cleverer, to avoid</span></td></tr> +<tr class="codeline" data-linenumber="1294"><td class="num" id="LN1294">1294</td><td class="line"> <span class='comment'>* tripping over old apps that use MateClient or that use libSM</span></td></tr> +<tr class="codeline" data-linenumber="1295"><td class="num" id="LN1295">1295</td><td class="line"> <span class='comment'>* directly.</span></td></tr> +<tr class="codeline" data-linenumber="1296"><td class="num" id="LN1296">1296</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1297"><td class="num" id="LN1297">1297</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1298"><td class="num" id="LN1298">1298</td><td class="line"><span class='directive'>#include <X11/ICE/ICElib.h></span></td></tr> +<tr class="codeline" data-linenumber="1299"><td class="num" id="LN1299">1299</td><td class="line"><span class='directive'>#include <fcntl.h></span></td></tr> +<tr class="codeline" data-linenumber="1300"><td class="num" id="LN1300">1300</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1301"><td class="num" id="LN1301">1301</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> ice_error_handler (IceConn ice_conn,</td></tr> +<tr class="codeline" data-linenumber="1302"><td class="num" id="LN1302">1302</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> swap,</td></tr> +<tr class="codeline" data-linenumber="1303"><td class="num" id="LN1303">1303</td><td class="line"> <span class='keyword'>int</span> offending_minor_opcode,</td></tr> +<tr class="codeline" data-linenumber="1304"><td class="num" id="LN1304">1304</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>long</span> offending_sequence,</td></tr> +<tr class="codeline" data-linenumber="1305"><td class="num" id="LN1305">1305</td><td class="line"> <span class='keyword'>int</span> error_class,</td></tr> +<tr class="codeline" data-linenumber="1306"><td class="num" id="LN1306">1306</td><td class="line"> <span class='keyword'>int</span> severity,</td></tr> +<tr class="codeline" data-linenumber="1307"><td class="num" id="LN1307">1307</td><td class="line"> IcePointer values);</td></tr> +<tr class="codeline" data-linenumber="1308"><td class="num" id="LN1308">1308</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> ice_io_error_handler (IceConn ice_conn);</td></tr> +<tr class="codeline" data-linenumber="1309"><td class="num" id="LN1309">1309</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> ice_connection_watch (IceConn ice_conn,</td></tr> +<tr class="codeline" data-linenumber="1310"><td class="num" id="LN1310">1310</td><td class="line"> IcePointer client_data,</td></tr> +<tr class="codeline" data-linenumber="1311"><td class="num" id="LN1311">1311</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> opening,</td></tr> +<tr class="codeline" data-linenumber="1312"><td class="num" id="LN1312">1312</td><td class="line"> IcePointer *watch_data);</td></tr> +<tr class="codeline" data-linenumber="1313"><td class="num" id="LN1313">1313</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1314"><td class="num" id="LN1314">1314</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1315"><td class="num" id="LN1315">1315</td><td class="line">ice_init (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="1316"><td class="num" id="LN1316">1316</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1317"><td class="num" id="LN1317">1317</td><td class="line"> IceSetIOErrorHandler (ice_io_error_handler);</td></tr> +<tr class="codeline" data-linenumber="1318"><td class="num" id="LN1318">1318</td><td class="line"> IceSetErrorHandler (ice_error_handler);</td></tr> +<tr class="codeline" data-linenumber="1319"><td class="num" id="LN1319">1319</td><td class="line"> IceAddConnectionWatch (ice_connection_watch, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1320"><td class="num" id="LN1320">1320</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1321"><td class="num" id="LN1321">1321</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1322"><td class="num" id="LN1322">1322</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1323"><td class="num" id="LN1323">1323</td><td class="line">process_ice_messages (IceConn ice_conn)</td></tr> +<tr class="codeline" data-linenumber="1324"><td class="num" id="LN1324">1324</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1325"><td class="num" id="LN1325">1325</td><td class="line"> IceProcessMessagesStatus status;</td></tr> +<tr class="codeline" data-linenumber="1326"><td class="num" id="LN1326">1326</td><td class="line"> status = IceProcessMessages (ice_conn, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1327"><td class="num" id="LN1327">1327</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1328"><td class="num" id="LN1328">1328</td><td class="line"> <span class='keyword'>switch</span> (status)</td></tr> +<tr class="codeline" data-linenumber="1329"><td class="num" id="LN1329">1329</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1330"><td class="num" id="LN1330">1330</td><td class="line"> <span class='keyword'>case</span> IceProcessMessagesSuccess:</td></tr> +<tr class="codeline" data-linenumber="1331"><td class="num" id="LN1331">1331</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1332"><td class="num" id="LN1332">1332</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1333"><td class="num" id="LN1333">1333</td><td class="line"> <span class='keyword'>case</span> IceProcessMessagesIOError:</td></tr> +<tr class="codeline" data-linenumber="1334"><td class="num" id="LN1334">1334</td><td class="line"> sm_client_xsmp_disconnect (IceGetConnectionContext (ice_conn));</td></tr> +<tr class="codeline" data-linenumber="1335"><td class="num" id="LN1335">1335</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1336"><td class="num" id="LN1336">1336</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1337"><td class="num" id="LN1337">1337</td><td class="line"> <span class='keyword'>case</span> IceProcessMessagesConnectionClosed:</td></tr> +<tr class="codeline" data-linenumber="1338"><td class="num" id="LN1338">1338</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1339"><td class="num" id="LN1339">1339</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1340"><td class="num" id="LN1340">1340</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="1341"><td class="num" id="LN1341">1341</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr ("EggSMClient", "eggsmclient-xsmp.c"<br>, 1341, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1342"><td class="num" id="LN1342">1342</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1343"><td class="num" id="LN1343">1343</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1344"><td class="num" id="LN1344">1344</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1345"><td class="num" id="LN1345">1345</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1346"><td class="num" id="LN1346">1346</td><td class="line">ice_iochannel_watch (GIOChannel *channel,</td></tr> +<tr class="codeline" data-linenumber="1347"><td class="num" id="LN1347">1347</td><td class="line"> GIOCondition condition,</td></tr> +<tr class="codeline" data-linenumber="1348"><td class="num" id="LN1348">1348</td><td class="line"> gpointer client_data)</td></tr> +<tr class="codeline" data-linenumber="1349"><td class="num" id="LN1349">1349</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1350"><td class="num" id="LN1350">1350</td><td class="line"> <span class='keyword'>return</span> process_ice_messages (client_data);</td></tr> +<tr class="codeline" data-linenumber="1351"><td class="num" id="LN1351">1351</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1352"><td class="num" id="LN1352">1352</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1353"><td class="num" id="LN1353">1353</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1354"><td class="num" id="LN1354">1354</td><td class="line">ice_connection_watch (IceConn ice_conn,</td></tr> +<tr class="codeline" data-linenumber="1355"><td class="num" id="LN1355">1355</td><td class="line"> IcePointer client_data,</td></tr> +<tr class="codeline" data-linenumber="1356"><td class="num" id="LN1356">1356</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> opening,</td></tr> +<tr class="codeline" data-linenumber="1357"><td class="num" id="LN1357">1357</td><td class="line"> IcePointer *watch_data)</td></tr> +<tr class="codeline" data-linenumber="1358"><td class="num" id="LN1358">1358</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1359"><td class="num" id="LN1359">1359</td><td class="line"> guint watch_id;</td></tr> +<tr class="codeline" data-linenumber="1360"><td class="num" id="LN1360">1360</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1361"><td class="num" id="LN1361">1361</td><td class="line"> <span class='keyword'>if</span> (opening)</td></tr> +<tr class="codeline" data-linenumber="1362"><td class="num" id="LN1362">1362</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1363"><td class="num" id="LN1363">1363</td><td class="line"> GIOChannel *channel;</td></tr> +<tr class="codeline" data-linenumber="1364"><td class="num" id="LN1364">1364</td><td class="line"> <span class='keyword'>int</span> fd = IceConnectionNumber (ice_conn);</td></tr> +<tr class="codeline" data-linenumber="1365"><td class="num" id="LN1365">1365</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1366"><td class="num" id="LN1366">1366</td><td class="line"> fcntl (fd, <span class='macro'>F_SETFD<span class='macro_popup'>2</span></span>, fcntl (fd, <span class='macro'>F_GETFD<span class='macro_popup'>1</span></span>, 0) | <span class='macro'>FD_CLOEXEC<span class='macro_popup'>1</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1367"><td class="num" id="LN1367">1367</td><td class="line"> channel = g_io_channel_unix_new (fd);</td></tr> +<tr class="codeline" data-linenumber="1368"><td class="num" id="LN1368">1368</td><td class="line"> watch_id = g_io_add_watch (channel, G_IO_IN | G_IO_ERR,</td></tr> +<tr class="codeline" data-linenumber="1369"><td class="num" id="LN1369">1369</td><td class="line"> ice_iochannel_watch, ice_conn);</td></tr> +<tr class="codeline" data-linenumber="1370"><td class="num" id="LN1370">1370</td><td class="line"> g_io_channel_unref (channel);</td></tr> +<tr class="codeline" data-linenumber="1371"><td class="num" id="LN1371">1371</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1372"><td class="num" id="LN1372">1372</td><td class="line"> *watch_data = <span class='macro'>GUINT_TO_POINTER (watch_id)<span class='macro_popup'>((gpointer) (gulong) (watch_id))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1373"><td class="num" id="LN1373">1373</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1374"><td class="num" id="LN1374">1374</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="1375"><td class="num" id="LN1375">1375</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="1376"><td class="num" id="LN1376">1376</td><td class="line"> watch_id = <span class='macro'>GPOINTER_TO_UINT (*watch_data)<span class='macro_popup'>((guint) (gulong) (*watch_data))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1377"><td class="num" id="LN1377">1377</td><td class="line"> g_source_remove (watch_id);</td></tr> +<tr class="codeline" data-linenumber="1378"><td class="num" id="LN1378">1378</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1379"><td class="num" id="LN1379">1379</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1380"><td class="num" id="LN1380">1380</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1381"><td class="num" id="LN1381">1381</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1382"><td class="num" id="LN1382">1382</td><td class="line">ice_error_handler (IceConn ice_conn,</td></tr> +<tr class="codeline" data-linenumber="1383"><td class="num" id="LN1383">1383</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> swap,</td></tr> +<tr class="codeline" data-linenumber="1384"><td class="num" id="LN1384">1384</td><td class="line"> <span class='keyword'>int</span> offending_minor_opcode,</td></tr> +<tr class="codeline" data-linenumber="1385"><td class="num" id="LN1385">1385</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>long</span> offending_sequence,</td></tr> +<tr class="codeline" data-linenumber="1386"><td class="num" id="LN1386">1386</td><td class="line"> <span class='keyword'>int</span> error_class,</td></tr> +<tr class="codeline" data-linenumber="1387"><td class="num" id="LN1387">1387</td><td class="line"> <span class='keyword'>int</span> severity,</td></tr> +<tr class="codeline" data-linenumber="1388"><td class="num" id="LN1388">1388</td><td class="line"> IcePointer values)</td></tr> +<tr class="codeline" data-linenumber="1389"><td class="num" id="LN1389">1389</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1390"><td class="num" id="LN1390">1390</td><td class="line"> <span class='comment'>/* Do nothing */</span></td></tr> +<tr class="codeline" data-linenumber="1391"><td class="num" id="LN1391">1391</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1392"><td class="num" id="LN1392">1392</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1393"><td class="num" id="LN1393">1393</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1394"><td class="num" id="LN1394">1394</td><td class="line">ice_io_error_handler (IceConn ice_conn)</td></tr> +<tr class="codeline" data-linenumber="1395"><td class="num" id="LN1395">1395</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1396"><td class="num" id="LN1396">1396</td><td class="line"> <span class='comment'>/* Do nothing */</span></td></tr> +<tr class="codeline" data-linenumber="1397"><td class="num" id="LN1397">1397</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1398"><td class="num" id="LN1398">1398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1399"><td class="num" id="LN1399">1399</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1400"><td class="num" id="LN1400">1400</td><td class="line">smc_error_handler (SmcConn smc_conn,</td></tr> +<tr class="codeline" data-linenumber="1401"><td class="num" id="LN1401">1401</td><td class="line"> <span class='macro'>Bool<span class='macro_popup'>int</span></span> swap,</td></tr> +<tr class="codeline" data-linenumber="1402"><td class="num" id="LN1402">1402</td><td class="line"> <span class='keyword'>int</span> offending_minor_opcode,</td></tr> +<tr class="codeline" data-linenumber="1403"><td class="num" id="LN1403">1403</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>long</span> offending_sequence,</td></tr> +<tr class="codeline" data-linenumber="1404"><td class="num" id="LN1404">1404</td><td class="line"> <span class='keyword'>int</span> error_class,</td></tr> +<tr class="codeline" data-linenumber="1405"><td class="num" id="LN1405">1405</td><td class="line"> <span class='keyword'>int</span> severity,</td></tr> +<tr class="codeline" data-linenumber="1406"><td class="num" id="LN1406">1406</td><td class="line"> SmPointer values)</td></tr> +<tr class="codeline" data-linenumber="1407"><td class="num" id="LN1407">1407</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1408"><td class="num" id="LN1408">1408</td><td class="line"> <span class='comment'>/* Do nothing */</span></td></tr> +<tr class="codeline" data-linenumber="1409"><td class="num" id="LN1409">1409</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-d9bc25.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-d9bc25.html new file mode 100644 index 0000000..3acdb96 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-d9bc25.html @@ -0,0 +1,967 @@ +<!doctype html> +<html> +<head> +<title>mate-session-save.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC This statement is never executed --> + +<!-- BUGTYPE Unreachable code --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/tools/mate-session-save.c --> + +<!-- FILENAME mate-session-save.c --> + +<!-- FUNCTIONNAME main --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT d9bc251a230c8ce7dc44ecc309d4674e --> + +<!-- BUGLINE 271 --> + +<!-- BUGCOLUMN 3 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>tools/mate-session-save.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 271, column 3</a><br />This statement is never executed</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mate-session-save.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/tools -fcoverage-compilation-dir=/rootdir/tools -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -D LOCALE_DIR="/usr/local/share/locale" -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c mate-session-save.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"271": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* save-session.c - Small program to talk to session manager.</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>Copyright (C) 1998 Tom Tromey</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>Copyright (C) 2008 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>This program is free software; you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>it under the terms of the GNU General Public License as published by</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>the Free Software Foundation; either version 2, or (at your option)</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>any later version.</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"><span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <config.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_SERVICE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_PATH_DBUS<span class='macro_popup'>"/org/gnome/SessionManager"</span></span> "/org/gnome/SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_INTERFACE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_SERVICE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span> "org.mate.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_PATH_DBUS_OLD<span class='macro_popup'>"/org/mate/SessionManager"</span></span> "/org/mate/SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_INTERFACE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span> "org.mate.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> GSM_LOGOUT_MODE_NORMAL = 0,</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> GSM_LOGOUT_MODE_NO_CONFIRMATION,</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> GSM_LOGOUT_MODE_FORCE</td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='comment'>/* True if killing. This is deprecated, but we keep it for compatibility</span></td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> <span class='comment'>* reasons. */</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> gboolean kill_session = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"><span class='comment'>/* The real options that should be used now. They are not ambiguous. */</span></td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='keyword'>static</span> gboolean logout = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"><span class='keyword'>static</span> gboolean force_logout = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"><span class='keyword'>static</span> gboolean logout_dialog = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"><span class='keyword'>static</span> gboolean shutdown_dialog = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"><span class='comment'>/* True if we should use dialog boxes */</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"><span class='keyword'>static</span> gboolean show_error_dialogs = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"><span class='comment'>/* True if we should do the requested action without confirmation */</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"><span class='keyword'>static</span> gboolean no_interaction = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>char</span>* session_name = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"><span class='keyword'>static</span> GOptionEntry options[] = {</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> {<span class='string_literal'>"logout"</span>, '\0', 0, G_OPTION_ARG_NONE, &logout, <span class='macro'>N_(<span class='string_literal'>"Log out"</span>)<span class='macro_popup'>("Log out")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> {<span class='string_literal'>"force-logout"</span>, '\0', 0, G_OPTION_ARG_NONE, &force_logout, <span class='macro'>N_(<span class='string_literal'>"Log out, ignoring any existing inhibitors"</span>)<span class='macro_popup'>("Log out, ignoring any existing inhibitors")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> {<span class='string_literal'>"logout-dialog"</span>, '\0', 0, G_OPTION_ARG_NONE, &logout_dialog, <span class='macro'>N_(<span class='string_literal'>"Show logout dialog"</span>)<span class='macro_popup'>("Show logout dialog")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> {<span class='string_literal'>"shutdown-dialog"</span>, '\0', 0, G_OPTION_ARG_NONE, &shutdown_dialog, <span class='macro'>N_(<span class='string_literal'>"Show shutdown dialog"</span>)<span class='macro_popup'>("Show shutdown dialog")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> {<span class='string_literal'>"gui"</span>, '\0', 0, G_OPTION_ARG_NONE, &show_error_dialogs, <span class='macro'>N_(<span class='string_literal'>"Use dialog boxes for errors"</span>)<span class='macro_popup'>("Use dialog boxes for errors")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> <span class='comment'>/* deprecated options */</span></td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> {<span class='string_literal'>"session-name"</span>, 's', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &session_name, <span class='macro'>N_(<span class='string_literal'>"Set the current session name"</span>)<span class='macro_popup'>("Set the current session name")</span></span>, <span class='macro'>N_(<span class='string_literal'>"NAME"</span>)<span class='macro_popup'>("NAME")</span></span>},</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> {<span class='string_literal'>"kill"</span>, '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &kill_session, <span class='macro'>N_(<span class='string_literal'>"Kill session"</span>)<span class='macro_popup'>("Kill session")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> {<span class='string_literal'>"silent"</span>, '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &no_interaction, <span class='macro'>N_(<span class='string_literal'>"Do not require confirmation"</span>)<span class='macro_popup'>("Do not require confirmation")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> {<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, 0, G_OPTION_ARG_NONE, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>}</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> display_error(<span class='keyword'>const</span> <span class='keyword'>char</span>* message)</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> <span class='keyword'>if</span> (show_error_dialogs && !no_interaction)</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> GtkWidget* dialog = gtk_message_dialog_new(<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, <span class='string_literal'>"%s"</span>, message);</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> gtk_window_set_default_icon_name (<span class='string_literal'>"dialog-error"</span>);</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> gtk_dialog_run(<span class='macro'>GTK_DIALOG(dialog)<span class='macro_popup'>((((GtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_dialog_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> gtk_widget_destroy(dialog);</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> g_printerr(<span class='string_literal'>"%s\n"</span>, message);</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"><span class='keyword'>static</span> GDBusProxy* get_sm_proxy(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> GDBusProxy *sm_proxy = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> sm_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> G_DBUS_PROXY_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> <span class='macro'>GSM_SERVICE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> <span class='macro'>GSM_PATH_DBUS<span class='macro_popup'>"/org/gnome/SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='macro'>GSM_INTERFACE_DBUS<span class='macro_popup'>"org.gnome.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> g_warning (<span class='string_literal'>"Couldn't create DBus proxy: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> <span class='comment'>/* Try the old name - for the case when we've just upgraded from 1.10</span></td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> <span class='comment'>* so the old m-s-m is currently running */</span></td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> sm_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> G_DBUS_PROXY_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> <span class='macro'>GSM_SERVICE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='macro'>GSM_PATH_DBUS_OLD<span class='macro_popup'>"/org/mate/SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> <span class='macro'>GSM_INTERFACE_DBUS_OLD<span class='macro_popup'>"org.mate.SessionManager"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> <span class='comment'>/* Okay, it wasn't the upgrade case, so now we can give up. */</span></td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> display_error (<span class='macro'>_(<span class='string_literal'>"Could not connect to the session manager"</span>)<span class='macro_popup'>gettext ("Could not connect to the session manager")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> do_logout(<span class='keyword'>unsigned</span> <span class='keyword'>int</span> mode)</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> GDBusProxy* sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> GVariant *ret;</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> sm_proxy = get_sm_proxy ();</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> ret = g_dbus_proxy_call_sync (sm_proxy, <span class='string_literal'>"Logout"</span>,</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> g_variant_new (<span class='string_literal'>"(u)"</span>, mode),</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> G_DBUS_CALL_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> <span class='keyword'>if</span> (ret == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> g_warning (<span class='string_literal'>"Failed to call logout: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> g_variant_unref (ret);</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> <span class='keyword'>if</span> (sm_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> g_object_unref (sm_proxy);</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> do_shutdown_dialog(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> GDBusProxy* sm_proxy;</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> GVariant *ret;</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> sm_proxy = get_sm_proxy ();</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>if</span> (sm_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> ret = g_dbus_proxy_call_sync (sm_proxy, <span class='string_literal'>"Shutdown"</span>,</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> g_variant_new (<span class='string_literal'>"()"</span>),</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> G_DBUS_CALL_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='keyword'>if</span> (ret == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> g_warning (<span class='string_literal'>"Failed to call shutdown: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> g_variant_unref (ret);</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='keyword'>if</span> (sm_proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> g_object_unref (sm_proxy);</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"><span class='keyword'>int</span> main(<span class='keyword'>int</span> argc, <span class='keyword'>char</span>* argv[])</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='keyword'>int</span> conflicting_options;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> <span class='comment'>/* Initialize the i18n stuff */</span></td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"><span class='directive'>#ifdef <span class='macro'>ENABLE_NLS<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> bindtextdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='macro'>LOCALE_DIR<span class='macro_popup'>"/usr/local/share/locale"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> bind_textdomain_codeset(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='string_literal'>"UTF-8"</span>);</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> textdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"><span class='directive'>#endif /* ENABLE_NLS */</span></td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='keyword'>if</span> (!gtk_init_with_args(&argc, &argv, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, options, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &error))</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> g_warning(<span class='string_literal'>"Unable to start: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> g_error_free(error);</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> exit(1);</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> conflicting_options = 0;</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (kill_session)</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> <span class='keyword'>if</span> (logout)</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='keyword'>if</span> (force_logout)</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> <span class='keyword'>if</span> (logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>if</span> (shutdown_dialog)</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> conflicting_options++;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> <span class='keyword'>if</span> (conflicting_options > 1)</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> display_error(<span class='macro'>_(<span class='string_literal'>"Program called with conflicting options"</span>)<span class='macro_popup'>gettext ("Program called with conflicting options")</span></span>);</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> <span class='keyword'>if</span> (kill_session)</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>if</span> (no_interaction)</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> force_logout = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> logout_dialog = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> <span class='keyword'>if</span> (logout)</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class="mrange">do_logout</span>(GSM_LOGOUT_MODE_NO_CONFIRMATION);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:17ex">This statement is never executed</div></td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (force_logout)</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> do_logout(GSM_LOGOUT_MODE_FORCE);</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (logout_dialog)</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> do_logout(GSM_LOGOUT_MODE_NORMAL);</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (shutdown_dialog)</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> do_shutdown_dialog();</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> <span class='keyword'>return</span> 0;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-e4efad.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-e4efad.html new file mode 100644 index 0000000..308023b --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-e4efad.html @@ -0,0 +1,1197 @@ +<!doctype html> +<html> +<head> +<title>mate-session-check-accelerated-gl-helper.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC This statement is never executed --> + +<!-- BUGTYPE Unreachable code --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/tools/mate-session-check-accelerated-gl-helper.c --> + +<!-- FILENAME mate-session-check-accelerated-gl-helper.c --> + +<!-- FUNCTIONNAME main --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT e4efade24d36455f12acd18fd3e4f3db --> + +<!-- BUGLINE 508 --> + +<!-- BUGCOLUMN 17 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>tools/mate-session-check-accelerated-gl-helper.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 508, column 17</a><br />This statement is never executed</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mate-session-check-accelerated-gl-helper.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/tools -fcoverage-compilation-dir=/rootdir/tools -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -D PKGDATADIR="/usr/local/share/mate-session-manager" -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -D LOCALE_DIR="/usr/local/share/locale" -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-6 -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c mate-session-check-accelerated-gl-helper.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"508": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2010 Novell, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2006-2009 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This program is free software; you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* it under the terms of the GNU General Public License as published by</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* the Free Software Foundation; either version 2 of the License, or</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>* Author:</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>* Vincent Untz <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> <span class='comment'>* Most of the code comes from desktop-effects [1], released under GPLv2+.</span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> <span class='comment'>* desktop-effects was written by:</span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> <span class='comment'>* Soren Sandmann <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"> <span class='comment'>* [1] http://git.fedorahosted.org/git/?p=desktop-effects.git;a=blob_plain;f=desktop-effects.c;hb=HEAD</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> <span class='comment'>* Here's the rationale behind this helper, quoting Owen, in his mail to the</span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> <span class='comment'>* release team:</span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> <span class='comment'>* (http://mail.gnome.org/archives/release-team/2010-June/msg00079.html)</span></td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> <span class='comment'>* """</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> <span class='comment'>* There are some limits to what we can do here automatically without</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> <span class='comment'>* knowing anything about the driver situation on the system. The basic</span></td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"> <span class='comment'>* problem is that there are all sorts of suck:</span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"> <span class='comment'>* * No GL at all. This typically only happens if a system is</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> <span class='comment'>* misconfigured.</span></td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> <span class='comment'>* * Only software GL. This one is easy to detect. We have code in</span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> <span class='comment'>* the Fedora desktop-effects tool, etc.</span></td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"> <span class='comment'>* * GL that isn't featureful enough. (Tiny texture size limits, no</span></td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> <span class='comment'>* texture-from-pixmap, etc.) Possible to detect with more work, but</span></td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"> <span class='comment'>* largely a fringe case.</span></td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> <span class='comment'>* * Buggy GL. This isn't possible to detect. Except for the case where</span></td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> <span class='comment'>* all GL programs crash. For that reason, we probably don't want</span></td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> <span class='comment'>* gnome-session to directly try and do any GL detection; better to</span></td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> <span class='comment'>* use a helper binary.</span></td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> <span class='comment'>* * Horribly slow hardware GL. We could theoretically develop some sort</span></td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> <span class='comment'>* of benchmark, but it's a tricky area. And how slow is too slow?</span></td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> <span class='comment'>* """</span></td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> <span class='comment'>* Some other tools are doing similar checks:</span></td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> <span class='comment'>* - desktop-effects (Fedora Config Tool) [1]</span></td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> <span class='comment'>* - drak3d (Mandriva Config Tool) [2]</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> <span class='comment'>* - compiz-manager (Compiz wrapper) [3]</span></td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> <span class='comment'>* [1] http://git.fedorahosted.org/git/?p=desktop-effects.git;a=blob_plain;f=desktop-effects.c;hb=HEAD</span></td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> <span class='comment'>* [2] http://svn.mandriva.com/cgi-bin/viewvc.cgi/soft/drak3d/trunk/lib/Xconfig/glx.pm?view=markup</span></td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> <span class='comment'>* [3] http://git.compiz.org/fusion/misc/compiz-manager/tree/compiz-manager</span></td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"><span class='comment'>/* for strcasestr */</span></td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='directive'>#define _GNU_SOURCE</span></td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"><span class='directive'>#include <ctype.h></span></td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"><span class='directive'>#include <locale.h></span></td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"><span class='directive'>#include <glib.h></span></td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"><span class='directive'>#include <regex.h></span></td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='directive'>#ifdef __FreeBSD__</span></td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"><span class='directive'>#include <kenv.h></span></td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"><span class='directive'>#include <X11/Xlib.h></span></td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"><span class='directive'>#include <X11/Xatom.h></span></td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"><span class='directive'>#include <X11/extensions/Xcomposite.h></span></td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"><span class='directive'>#include <GL/gl.h></span></td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"><span class='directive'>#include <GL/glx.h></span></td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"><span class='directive'>#include "mate-session-check-accelerated-common.h"</span></td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"><span class='directive'>#define <span class='macro'>SIZE_UNSET<span class='macro_popup'>0</span></span> 0</span></td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"><span class='directive'>#define <span class='macro'>SIZE_ERROR<span class='macro_popup'>-1</span></span> -1</span></td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span> max_texture_size = <span class='macro'>SIZE_UNSET<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span> max_renderbuffer_size = <span class='macro'>SIZE_UNSET<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"><span class='keyword'>static</span> gboolean has_llvmpipe = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line">_print_error (<span class='keyword'>const</span> <span class='keyword'>char</span> *str)</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> fprintf (<span class='macro'>stderr<span class='macro_popup'>stderr</span></span>, <span class='string_literal'>"mate-session-is-accelerated: %s\n"</span>, str);</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"><span class='directive'>#define <span class='macro'>CMDLINE_UNSET<span class='macro_popup'>-1</span></span> -1</span></td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"><span class='directive'>#define <span class='macro'>CMDLINE_NON_FALLBACK_FORCED<span class='macro_popup'>0</span></span> 0</span></td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"><span class='directive'>#define <span class='macro'>CMDLINE_FALLBACK_FORCED<span class='macro_popup'>1</span></span> 1</span></td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"><span class='directive'>#if defined(<span class='macro'>__linux__<span class='macro_popup'>1</span></span>)</span></td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line">_parse_kcmdline (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> <span class='keyword'>int</span> ret = <span class='macro'>CMDLINE_UNSET<span class='macro_popup'>-1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> GRegex *regex;</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> GMatchInfo *match;</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> <span class='keyword'>char</span> *contents;</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> <span class='keyword'>char</span> *word;</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *arg;</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='keyword'>if</span> (!g_file_get_contents (<span class='string_literal'>"/proc/cmdline"</span>, &contents, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>))</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> regex = g_regex_new (<span class='string_literal'>"mate.fallback=(\\S+)"</span>, 0, G_REGEX_MATCH_NOTEMPTY, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>if</span> (!g_regex_match (regex, contents, G_REGEX_MATCH_NOTEMPTY, &match))</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> word = g_match_info_fetch (match, 0);</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> g_debug (<span class='string_literal'>"Found command-line match '%s'"</span>, word);</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> arg = word + strlen (<span class='string_literal'>"mate.fallback="</span>);</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> <span class='keyword'>if</span> (*arg != '0' && *arg != '1')</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> fprintf (<span class='macro'>stderr<span class='macro_popup'>stderr</span></span>, <span class='string_literal'>"mate-session-check-accelerated: Invalid value '%s' for mate.fallback passed in kernel command line.\n"</span>, arg);</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> ret = atoi (arg);</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> g_free (word);</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> g_match_info_free (match);</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> g_regex_unref (regex);</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> g_free (contents);</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> g_debug (<span class='string_literal'>"Command-line parsed to %d"</span>, ret);</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"><span class='directive'>#elif defined(__FreeBSD__)</span></td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line">_parse_kcmdline (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> <span class='keyword'>int</span> ret = <span class='macro'>CMDLINE_UNSET<span class='macro_popup'>-1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> <span class='keyword'>char</span> value[KENV_MVALLEN];</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> <span class='comment'>/* a compile time check to avoid unexpected stack overflow */</span></td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='keyword'>_Static_assert</span>(KENV_MVALLEN < 1024 * 1024, <span class='string_literal'>"KENV_MVALLEN is too large"</span>);</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> <span class='keyword'>if</span> (kenv (KENV_GET, <span class='string_literal'>"mate.fallback"</span>, value, KENV_MVALLEN) == -1)</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> <span class='keyword'>if</span> (*value != '0' && *value != '1')</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> fprintf (<span class='macro'>stderr<span class='macro_popup'>stderr</span></span>, <span class='string_literal'>"mate-session-is-accelerated: Invalid value '%s' for mate.fallback passed in kernel environment.\n"</span>, value);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> ret = atoi (value);</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> g_debug (<span class='string_literal'>"Kernel environment parsed to %d"</span>, ret);</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"><span class='directive'>#else</span></td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line">_parse_kcmdline (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>CMDLINE_UNSET<span class='macro_popup'>-1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line">_has_composite (Display *display)</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>int</span> dummy1, dummy2;</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='keyword'>return</span> XCompositeQueryExtension (display, &dummy1, &dummy2);</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line">_is_comment (<span class='keyword'>const</span> <span class='keyword'>char</span> *line)</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='keyword'>while</span> (*line && <span class='macro'>isspace(*line)<span class='macro_popup'>((*__ctype_b_loc ())[(int) ((*line))] & (unsigned short int<br>) _ISspace)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> line++;</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='keyword'>if</span> (*line == '#' || *line == '\0')</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line">_is_gl_renderer_blacklisted (<span class='keyword'>const</span> <span class='keyword'>char</span> *renderer)</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> FILE *blacklist;</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='keyword'>char</span> *line = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> size_t line_len = 0;</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> gboolean ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> blacklist = fopen(<span class='macro'>PKGDATADIR<span class='macro_popup'>"/usr/local/share/mate-session-manager"</span></span> <span class='string_literal'>"/hardware-compatibility"</span>, <span class='string_literal'>"r"</span>);</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> <span class='keyword'>if</span> (blacklist == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> <span class='keyword'>while</span> (getline (&line, &line_len, blacklist) != -1) {</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='keyword'>int</span> whitelist = 0;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *re_str;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> regex_t re;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> <span class='keyword'>int</span> status;</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> <span class='keyword'>if</span> (line == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='comment'>/* Drop trailing \n */</span></td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> line[strlen(line) - 1] = '\0';</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='keyword'>if</span> (_is_comment (line)) {</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> free (line);</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> line = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> <span class='keyword'>if</span> (line[0] == '+')</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> whitelist = 1;</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (line[0] == '-')</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> whitelist = 0;</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> _print_error (<span class='string_literal'>"Invalid syntax in this line for hardware compatibility:"</span>);</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> _print_error (line);</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> free (line);</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> line = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> re_str = line + 1;</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> <span class='keyword'>if</span> (regcomp (&re, re_str, <span class='macro'>REG_EXTENDED<span class='macro_popup'>1</span></span>|<span class='macro'>REG_ICASE<span class='macro_popup'>(1 << 1)</span></span>|<span class='macro'>REG_NOSUB<span class='macro_popup'>(1 << 3)</span></span>) != 0) {</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> _print_error (<span class='string_literal'>"Cannot use this regular expression for hardware compatibility:"</span>);</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> _print_error (re_str);</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> status = regexec (&re, renderer, 0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0);</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> regfree(&re);</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> <span class='keyword'>if</span> (status == 0) {</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> <span class='keyword'>if</span> (whitelist)</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> free (line);</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> line = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>if</span> (line != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> free (line);</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> <span class='keyword'>if</span> (blacklist != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> fclose (blacklist);</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>char</span> *</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line">_get_hardware_gl (Display *display)</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>int</span> screen;</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> Window root;</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> XVisualInfo *visual = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> GLXContext context = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> XSetWindowAttributes cwa = { 0 };</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> Window window = <span class='macro'>None<span class='macro_popup'>0L</span></span>;</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>char</span> *renderer = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> <span class='keyword'>int</span> attrlist[] = {</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> <span class='macro'>GLX_RGBA<span class='macro_popup'>4</span></span>,</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> <span class='macro'>GLX_RED_SIZE<span class='macro_popup'>8</span></span>, 1,</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> <span class='macro'>GLX_GREEN_SIZE<span class='macro_popup'>9</span></span>, 1,</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='macro'>GLX_BLUE_SIZE<span class='macro_popup'>10</span></span>, 1,</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> <span class='macro'>GLX_DOUBLEBUFFER<span class='macro_popup'>5</span></span>,</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> <span class='macro'>None<span class='macro_popup'>0L</span></span></td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> screen = <span class='macro'>DefaultScreen (display)<span class='macro_popup'>(((_XPrivDisplay)(display))->default_screen)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> root = <span class='macro'>RootWindow (display, screen)<span class='macro_popup'>((&((_XPrivDisplay)(display))->screens[screen])->root<br>)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> visual = glXChooseVisual (display, screen, attrlist);</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> <span class='keyword'>if</span> (!visual)</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> context = glXCreateContext (display, visual, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>True<span class='macro_popup'>1</span></span>);</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> <span class='keyword'>if</span> (!context)</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> cwa.colormap = XCreateColormap (display, root,</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> visual->visual, <span class='macro'>AllocNone<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> cwa.background_pixel = 0;</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> cwa.border_pixel = 0;</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> window = XCreateWindow (display, root,</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> 0, 0, 1, 1, 0,</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> visual->depth, <span class='macro'>InputOutput<span class='macro_popup'>1</span></span>, visual->visual,</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='macro'>CWColormap<span class='macro_popup'>(1L<<13)</span></span> | <span class='macro'>CWBackPixel<span class='macro_popup'>(1L<<1)</span></span> | <span class='macro'>CWBorderPixel<span class='macro_popup'>(1L<<3)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> &cwa);</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> <span class='keyword'>if</span> (!glXMakeCurrent (display, window, context))</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> renderer = <span class='macro'>g_strdup ((<span class='keyword'>const</span> <span class='keyword'>char</span> *) glGetString (GL_RENDERER))<span class='macro_popup'>g_strdup_inline ((const char *) glGetString (0x1F01))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> <span class='keyword'>if</span> (_is_gl_renderer_blacklisted (renderer)) {</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='macro'>g_clear_pointer (&renderer, g_free)<span class='macro_popup'>do { _Static_assert (sizeof *(&renderer) == sizeof (gpointer<br>), "Expression evaluates to false"); __typeof__ ((&renderer<br>)) _pp = (&renderer); __typeof__ (*(&renderer)) _ptr =<br> *_pp; *_pp = ((void*)0); if (_ptr) (g_free) (_ptr); } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> <span class='keyword'>if</span> (renderer && strcasestr (renderer, <span class='string_literal'>"llvmpipe"</span>))</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> has_llvmpipe = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> <span class='comment'>/* we need to get the max texture and renderbuffer sizes while we have</span></td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> <span class='comment'>* a context, but we'll check their values later */</span></td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> glGetIntegerv (<span class='macro'>GL_MAX_TEXTURE_SIZE<span class='macro_popup'>0x0D33</span></span>, &max_texture_size);</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> <span class='keyword'>if</span> (glGetError() != <span class='macro'>GL_NO_ERROR<span class='macro_popup'>0</span></span>)</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> max_texture_size = <span class='macro'>SIZE_ERROR<span class='macro_popup'>-1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> glGetIntegerv (<span class='macro'>GL_MAX_RENDERBUFFER_SIZE_EXT<span class='macro_popup'>0x84E8</span></span>, &max_renderbuffer_size);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (glGetError() != <span class='macro'>GL_NO_ERROR<span class='macro_popup'>0</span></span>)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> max_renderbuffer_size = <span class='macro'>SIZE_ERROR<span class='macro_popup'>-1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> glXMakeCurrent (display, <span class='macro'>None<span class='macro_popup'>0L</span></span>, <span class='macro'>None<span class='macro_popup'>0L</span></span>);</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> <span class='keyword'>if</span> (context)</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> glXDestroyContext (display, context);</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> <span class='keyword'>if</span> (window)</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> XDestroyWindow (display, window);</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='keyword'>if</span> (cwa.colormap)</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> XFreeColormap (display, cwa.colormap);</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='keyword'>return</span> renderer;</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line">_has_extension (<span class='keyword'>const</span> <span class='keyword'>char</span> *extension_list,</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *extension)</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> <span class='keyword'>char</span> **extensions;</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> guint i;</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='macro'>g_return_val_if_fail (extension != NULL, TRUE)<span class='macro_popup'>do { if ((extension != ((void*)0))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "extension != NULL"<br>); return ((!(0))); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='comment'>/* Extension_list is one big string, containing extensions</span></td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='comment'>* separated by spaces. */</span></td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>if</span> (extension_list == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> extensions = g_strsplit (extension_list, <span class='string_literal'>" "</span>, -1);</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>if</span> (extensions == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> <span class='keyword'>for</span> (i = 0; extensions[i] != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; i++) {</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>g_str_equal (extensions[i], extension)<span class='macro_popup'>(strcmp ((const char *) (extensions[i]), (const char *) (extension<br>)) == 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> g_strfreev (extensions);</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line">_has_texture_from_pixmap (Display *display)</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>int</span> screen;</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *server_extensions;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *client_extensions;</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> gboolean ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> screen = <span class='macro'>DefaultScreen (display)<span class='macro_popup'>(((_XPrivDisplay)(display))->default_screen)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> server_extensions = glXQueryServerString (display, screen,</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='macro'>GLX_EXTENSIONS<span class='macro_popup'>3</span></span>);</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> <span class='keyword'>if</span> (!_has_extension (server_extensions,</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='string_literal'>"GLX_EXT_texture_from_pixmap"</span>))</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> client_extensions = glXGetClientString (display, <span class='macro'>GLX_EXTENSIONS<span class='macro_popup'>3</span></span>);</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>if</span> (!_has_extension (client_extensions,</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> <span class='string_literal'>"GLX_EXT_texture_from_pixmap"</span>))</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line">_set_max_screen_size_property (Display *display, <span class='keyword'>int</span> screen, <span class='keyword'>int</span> size)</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> Atom max_screen_size_atom;</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> max_screen_size_atom = XInternAtom (display, <span class='string_literal'>"_GNOME_MAX_SCREEN_SIZE"</span>,</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> <span class='macro'>False<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='comment'>/* Will be read by gnome-settings-daemon and</span></td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> <span class='comment'>* gnome-control-center to avoid display configurations where 3D</span></td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> <span class='comment'>* is not available (and would break gnome-shell) */</span></td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> XChangeProperty (display, <span class='macro'>RootWindow(display, screen)<span class='macro_popup'>((&((_XPrivDisplay)(display))->screens[screen])->root<br>)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> max_screen_size_atom,</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='macro'>XA_CARDINAL<span class='macro_popup'>((Atom) 6)</span></span>, 32, <span class='macro'>PropModeReplace<span class='macro_popup'>0</span></span>,</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> (<span class='keyword'>unsigned</span> <span class='keyword'>char</span> *)&size, 1);</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> XSync(display, <span class='macro'>False<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line">_is_max_texture_size_big_enough (Display *display)</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> <span class='keyword'>int</span> screen, size;</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> screen = <span class='macro'>DefaultScreen (display)<span class='macro_popup'>(((_XPrivDisplay)(display))->default_screen)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> size = <span class='macro'>MIN(max_renderbuffer_size, max_texture_size)<span class='macro_popup'>(((max_renderbuffer_size) < (max_texture_size)) ? (max_renderbuffer_size<br>) : (max_texture_size))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> <span class='keyword'>if</span> (size < <span class='macro'>DisplayWidth (display, screen)<span class='macro_popup'>((&((_XPrivDisplay)(display))->screens[screen])->width<br>)</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> size < <span class='macro'>DisplayHeight (display, screen)<span class='macro_popup'>((&((_XPrivDisplay)(display))->screens[screen])->height<br>)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> _set_max_screen_size_property (display, screen, size);</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"><span class='keyword'>static</span> gboolean print_renderer = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>const</span> GOptionEntry entries[] = {</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> { <span class='string_literal'>"print-renderer"</span>, 'p', 0, G_OPTION_ARG_NONE, &print_renderer, <span class='string_literal'>"Print GL renderer name"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> },</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> { <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, 0, G_OPTION_ARG_NONE, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> },</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"><span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line">main (<span class='keyword'>int</span> argc, <span class='keyword'>char</span> **argv)</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> <span class='keyword'>int</span> kcmdline_parsed;</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> Display *display = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> <span class='keyword'>int</span> ret = <span class='macro'>HELPER_NO_ACCEL<span class='macro_popup'>1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> GOptionContext *context;</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> <span class='keyword'>char</span> *renderer = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> setlocale (<span class='macro'>LC_ALL<span class='macro_popup'>6</span></span>, <span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> context = g_option_context_new (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> g_option_context_add_main_entries (context, entries, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> <span class='keyword'>if</span> (!g_option_context_parse (context, &argc, &argv, &error)) {</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> g_error (<span class='string_literal'>"Can't parse command line: %s\n"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> kcmdline_parsed = _parse_kcmdline ();</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> <span class='keyword'>if</span> (kcmdline_parsed > <span class='macro'>CMDLINE_UNSET<span class='macro_popup'>-1</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='keyword'>if</span> (kcmdline_parsed == <span class='macro'>CMDLINE_NON_FALLBACK_FORCED<span class='macro_popup'>0</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> _print_error (<span class='string_literal'>"Non-fallback mode forced by kernel command line."</span>);</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> ret = <span class='macro'>HELPER_ACCEL<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (kcmdline_parsed == <span class='macro'>CMDLINE_FALLBACK_FORCED<span class='macro_popup'>1</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> _print_error (<span class='string_literal'>"Fallback mode forced by kernel command line."</span>);</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> display = XOpenDisplay (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> <span class='keyword'>if</span> (!display) {</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> _print_error (<span class='string_literal'>"No X display."</span>);</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> <span class='keyword'>if</span> (!_has_composite (display)) {</td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> _print_error (<span class='string_literal'>"No composite extension."</span>);</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> renderer = _get_hardware_gl (display);</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> <span class='keyword'>if</span> (!renderer) {</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> _print_error (<span class='string_literal'>"No hardware 3D support."</span>);</td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> <span class='keyword'>if</span> (!_has_texture_from_pixmap (display)) {</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> _print_error (<span class='string_literal'>"No GLX_EXT_texture_from_pixmap support."</span>);</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='keyword'>if</span> (!_is_max_texture_size_big_enough (display)) {</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> _print_error (<span class='string_literal'>"GL_MAX_{TEXTURE,RENDERBUFFER}_SIZE is too small."</span>);</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> ret = has_llvmpipe ? <span class='macro'>HELPER_SOFTWARE_RENDERING<span class='macro_popup'>2</span></span> : <span class='macro'>HELPER_ACCEL<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> <span class='keyword'>if</span> (print_renderer)</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> <span class="mrange">g_print</span> (<span class='string_literal'>"%s"</span>, renderer);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:17ex">This statement is never executed</div></td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>if</span> (display)</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> XCloseDisplay (display);</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> g_option_context_free (context);</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> g_free (renderer);</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-f05804.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-f05804.html new file mode 100644 index 0000000..4f139fe --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-f05804.html @@ -0,0 +1,915 @@ +<!doctype html> +<html> +<head> +<title>mate-session-check-accelerated-gles-helper.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC This statement is never executed --> + +<!-- BUGTYPE Unreachable code --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/tools/mate-session-check-accelerated-gles-helper.c --> + +<!-- FILENAME mate-session-check-accelerated-gles-helper.c --> + +<!-- FUNCTIONNAME main --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT f0580452f66bc14b3b1b798856f8d613 --> + +<!-- BUGLINE 223 --> + +<!-- BUGCOLUMN 25 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>tools/mate-session-check-accelerated-gles-helper.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 223, column 25</a><br />This statement is never executed</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mate-session-check-accelerated-gles-helper.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/tools -fcoverage-compilation-dir=/rootdir/tools -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -D PKGDATADIR="/usr/local/share/mate-session-manager" -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -D LOCALE_DIR="/usr/local/share/locale" -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/freetype2 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/harfbuzz -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c mate-session-check-accelerated-gles-helper.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"223": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- mode:c; c-basic-offset: 8; indent-tabs-mode: nil; -*- */</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Copyright (C) 2016 Endless Mobile, Inc</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* Copyright (C) 2016-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* This program is free software; you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* it under the terms of the GNU General Public License as published by</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* the Free Software Foundation; either version 2 of the License, or</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>* (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>* GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>* Author:</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> <span class='comment'>* Cosimo Cecchi <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='comment'>/* for strcasestr */</span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#define _GNU_SOURCE</span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <config.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include <locale.h></span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#ifdef GDK_WINDOWING_X11</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#define GL_GLEXT_PROTOTYPES</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#include <GLES2/gl2.h></span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#include <GLES2/gl2ext.h></span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"><span class='directive'>#include <EGL/egl.h></span></td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='directive'>#include <EGL/eglext.h></span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"><span class='directive'>#include "mate-session-check-accelerated-common.h"</span></td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"><span class='directive'>#ifdef GDK_WINDOWING_X11</span></td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='keyword'>static</span> EGLDisplay</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line">get_display (<span class='keyword'>void</span> *native)</td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> EGLDisplay dpy = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *client_exts = eglQueryString (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>EGL_EXTENSIONS<span class='macro_popup'>0x3055</span></span>);</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> <span class='keyword'>if</span> (g_strstr_len (client_exts, -1, <span class='string_literal'>"EGL_KHR_platform_base"</span>)) {</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display =</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> (<span class='keyword'>void</span> *) eglGetProcAddress (<span class='string_literal'>"eglGetPlatformDisplay"</span>);</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> <span class='keyword'>if</span> (get_platform_display)</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> dpy = get_platform_display (<span class='macro'>EGL_PLATFORM_X11_KHR<span class='macro_popup'>0x31D5</span></span>, native, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> <span class='keyword'>if</span> (dpy)</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> <span class='keyword'>return</span> dpy;</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> <span class='keyword'>if</span> (g_strstr_len (client_exts, -1, <span class='string_literal'>"EGL_EXT_platform_base"</span>)) {</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display =</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> (<span class='keyword'>void</span> *) eglGetProcAddress (<span class='string_literal'>"eglGetPlatformDisplayEXT"</span>);</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> <span class='keyword'>if</span> (get_platform_display)</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> dpy = get_platform_display (<span class='macro'>EGL_PLATFORM_X11_KHR<span class='macro_popup'>0x31D5</span></span>, native, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> <span class='keyword'>if</span> (dpy)</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> <span class='keyword'>return</span> dpy;</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> <span class='keyword'>return</span> eglGetDisplay ((EGLNativeDisplayType) native);</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>char</span> *</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line">get_gles_renderer (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> <span class='comment'>/* Select GLESv2 config */</span></td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> EGLint attribs[] = {</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='macro'>EGL_RENDERABLE_TYPE<span class='macro_popup'>0x3040</span></span>, <span class='macro'>EGL_OPENGL_ES2_BIT<span class='macro_popup'>0x0004</span></span>,</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> <span class='macro'>EGL_RED_SIZE<span class='macro_popup'>0x3024</span></span>, 1,</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> <span class='macro'>EGL_GREEN_SIZE<span class='macro_popup'>0x3023</span></span>, 1,</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> <span class='macro'>EGL_BLUE_SIZE<span class='macro_popup'>0x3022</span></span>, 1,</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> <span class='macro'>EGL_NONE<span class='macro_popup'>0x3038</span></span></td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> EGLint ctx_attribs[] = {</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> <span class='macro'>EGL_CONTEXT_CLIENT_VERSION<span class='macro_popup'>0x3098</span></span>, 2,</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> <span class='macro'>EGL_NONE<span class='macro_popup'>0x3038</span></span></td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> gboolean egl_inited = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> GdkDisplay *gdk_dpy;</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> Display *display;</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> Window win = <span class='macro'>None<span class='macro_popup'>0L</span></span>;</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> EGLContext egl_ctx = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> EGLDisplay egl_dpy = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> EGLSurface egl_surf = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> <span class='keyword'>char</span> *renderer = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> gdk_dpy = gdk_display_get_default ();</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> gdk_x11_display_error_trap_push (gdk_dpy);</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> display = <span class='macro'>GDK_DISPLAY_XDISPLAY (gdk_dpy)<span class='macro_popup'>(gdk_x11_display_get_xdisplay (gdk_dpy))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> egl_dpy = get_display (display);</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='keyword'>if</span> (!egl_dpy) {</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> g_warning (<span class='string_literal'>"eglGetDisplay() failed"</span>);</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> EGLint egl_major, egl_minor;</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> <span class='keyword'>if</span> (!eglInitialize (egl_dpy, &egl_major, &egl_minor)) {</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> g_warning (<span class='string_literal'>"eglInitialize() failed"</span>);</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> egl_inited = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> EGLint num_configs;</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> EGLConfig config;</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>if</span> (!eglChooseConfig (egl_dpy, attribs, &config, 1, &num_configs)) {</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> g_warning (<span class='string_literal'>"Failed to get EGL configuration"</span>);</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> EGLint vid;</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> <span class='keyword'>if</span> (!eglGetConfigAttrib (egl_dpy, config, <span class='macro'>EGL_NATIVE_VISUAL_ID<span class='macro_popup'>0x302E</span></span>, &vid)) {</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> g_warning (<span class='string_literal'>"Failed to get EGL visual"</span>);</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> <span class='comment'>/* The X window visual must match the EGL config */</span></td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> XVisualInfo *vis_info, vis_template;</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> <span class='keyword'>int</span> num_visuals;</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> vis_template.visualid = vid;</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> vis_info = XGetVisualInfo (display, <span class='macro'>VisualIDMask<span class='macro_popup'>0x1</span></span>, &vis_template, &num_visuals);</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> <span class='keyword'>if</span> (!vis_info) {</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> g_warning (<span class='string_literal'>"Failed to get X visual"</span>);</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> XSetWindowAttributes attr;</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> attr.colormap = XCreateColormap (display, <span class='macro'>DefaultRootWindow (display)<span class='macro_popup'>((&((_XPrivDisplay)(display))->screens[(((_XPrivDisplay<br>)(display))->default_screen)])->root)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> vis_info->visual, <span class='macro'>AllocNone<span class='macro_popup'>0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> win = XCreateWindow (display, <span class='macro'>DefaultRootWindow (display)<span class='macro_popup'>((&((_XPrivDisplay)(display))->screens[(((_XPrivDisplay<br>)(display))->default_screen)])->root)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> 0, 0, <span class='comment'>/* x, y */</span></td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> 1, 1, <span class='comment'>/* width, height */</span></td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> 0, <span class='comment'>/* border_width */</span></td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> vis_info->depth, <span class='macro'>InputOutput<span class='macro_popup'>1</span></span>,</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> vis_info->visual, <span class='macro'>CWColormap<span class='macro_popup'>(1L<<13)</span></span>, &attr);</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> XFree (vis_info);</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> eglBindAPI (<span class='macro'>EGL_OPENGL_ES_API<span class='macro_popup'>0x30A0</span></span>);</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> egl_ctx = eglCreateContext (egl_dpy, config, <span class='macro'>EGL_NO_CONTEXT<span class='macro_popup'>((EGLContext) (0))</span></span>, ctx_attribs);</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> <span class='keyword'>if</span> (!egl_ctx) {</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> g_warning (<span class='string_literal'>"Failed to create EGL context"</span>);</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> egl_surf = eglCreateWindowSurface (egl_dpy, config, win, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> <span class='keyword'>if</span> (!egl_surf) {</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> g_warning (<span class='string_literal'>"Failed to create EGL surface"</span>);</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> <span class='keyword'>if</span> (!eglMakeCurrent (egl_dpy, egl_surf, egl_surf, egl_ctx)) {</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> g_warning (<span class='string_literal'>"eglMakeCurrent() failed"</span>);</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> renderer = <span class='macro'>g_strdup ((<span class='keyword'>const</span> <span class='keyword'>char</span> *) glGetString (GL_RENDERER))<span class='macro_popup'>g_strdup_inline ((const char *) glGetString (0x1F01))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> out:</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>if</span> (egl_ctx)</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> eglDestroyContext (egl_dpy, egl_ctx);</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='keyword'>if</span> (egl_surf)</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> eglDestroySurface (egl_dpy, egl_surf);</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> <span class='keyword'>if</span> (egl_inited)</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> eglTerminate (egl_dpy);</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='keyword'>if</span> (win != <span class='macro'>None<span class='macro_popup'>0L</span></span>)</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> XDestroyWindow (display, win);</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> gdk_x11_display_error_trap_pop_ignored (gdk_dpy);</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='keyword'>return</span> renderer;</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"><span class='keyword'>static</span> gboolean print_renderer = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>const</span> GOptionEntry entries[] = {</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> { <span class='string_literal'>"print-renderer"</span>, 'p', 0, G_OPTION_ARG_NONE, &print_renderer, <span class='string_literal'>"Print EGL renderer name"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> },</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> { <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, 0, G_OPTION_ARG_NONE, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> },</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"><span class='keyword'>int</span></td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line">main (<span class='keyword'>int</span> argc,</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='keyword'>char</span> **argv)</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> GOptionContext *context;</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> <span class='keyword'>int</span> ret = <span class='macro'>HELPER_NO_ACCEL<span class='macro_popup'>1</span></span>;</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> setlocale (<span class='macro'>LC_ALL<span class='macro_popup'>6</span></span>, <span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> context = g_option_context_new (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> g_option_context_add_group (context, gtk_get_option_group (<span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>));</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> g_option_context_add_main_entries (context, entries, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>if</span> (!g_option_context_parse (context, &argc, &argv, &error)) {</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> g_error (<span class='string_literal'>"Can't parse command line: %s\n"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"><span class='directive'>#ifdef GDK_WINDOWING_X11</span></td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> <span class='keyword'>char</span> *renderer = get_gles_renderer ();</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='keyword'>if</span> (renderer != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> <span class='keyword'>if</span> (print_renderer)</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> <span class="mrange">g_print</span> (<span class='string_literal'>"%s"</span>, renderer);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:25ex">This statement is never executed</div></td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> <span class='keyword'>if</span> (strcasestr (renderer, <span class='string_literal'>"llvmpipe"</span>))</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> ret = <span class='macro'>HELPER_SOFTWARE_RENDERING<span class='macro_popup'>2</span></span>;</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> ret = <span class='macro'>HELPER_ACCEL<span class='macro_popup'>0</span></span>;</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> g_free (renderer);</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> g_option_context_free (context);</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-f291f4.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-f291f4.html new file mode 100644 index 0000000..5cd4cb1 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-f291f4.html @@ -0,0 +1,1474 @@ +<!doctype html> +<html> +<head> +<title>main.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Value stored to 'ret' is never read --> + +<!-- BUGTYPE Dead assignment --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/mate-session/main.c --> + +<!-- FILENAME main.c --> + +<!-- FUNCTIONNAME signal_cb --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT f291f49d96a4166a14dba8488850f222 --> + +<!-- BUGLINE 438 --> + +<!-- BUGCOLUMN 2 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>mate-session/main.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 438, column 2</a><br />Value stored to 'ret' is never read</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/mate-session -fcoverage-compilation-dir=/rootdir/mate-session -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -I /usr/include/uuid -I ../mate-submodules/libegg -D LOCALE_DIR="/usr/local/share/locale" -D DATA_DIR="/usr/local/share/mate-session" -D LIBEXECDIR="/usr/local/libexec" -D GTKBUILDER_DIR="/usr/local/share/mate-session-manager" -D I_KNOW_THE_DEVICEKIT_POWER_API_IS_SUBJECT_TO_CHANGE -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c main.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"438": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2006 Novell, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Copyright (C) 2008 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* This program is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU General Public License as</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* published by the Free Software Foundation; either version 2 of the</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>* License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful, but</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>* Lesser General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>* 02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <config.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <signal.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <<span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span>.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='directive'>#include <time.h></span></td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"><span class='directive'>#include <glib.h></span></td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#include <gio/gio.h></span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"><span class='directive'>#include <dbus/dbus.h></span></td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#include "mdm-signal-handler.h"</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#include "mdm-log.h"</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='directive'>#include "gsm-consolekit.h"</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"><span class='directive'>#include "gsm-systemd.h"</span></td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"><span class='directive'>#include "gsm-util.h"</span></td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"><span class='directive'>#include "gsm-manager.h"</span></td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='directive'>#include "gsm-xsmp-server.h"</span></td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"><span class='directive'>#include "gsm-store.h"</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"><span class='directive'>#include "msm-gnome.h"</span></td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span> "org.mate.session"</span></td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_DEFAULT_SESSION_KEY<span class='macro_popup'>"default-session"</span></span> "default-session"</span></td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_REQUIRED_COMPONENTS_SCHEMA<span class='macro_popup'>"org.mate.session" ".required-components"</span></span> <span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span> ".required-components"</span></td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_REQUIRED_COMPONENTS_LIST_KEY<span class='macro_popup'>"required-components-list"</span></span> "required-components-list"</span></td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"><span class='directive'>#define <span class='macro'>ACCESSIBILITY_KEY<span class='macro_popup'>"accessibility"</span></span> "accessibility"</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"><span class='directive'>#define <span class='macro'>ACCESSIBILITY_SCHEMA<span class='macro_popup'>"org.mate.interface"</span></span> "org.mate.interface"</span></td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"><span class='directive'>#define <span class='macro'>DEBUG_SCHEMA<span class='macro_popup'>"org.mate.debug"</span></span> "org.mate.debug"</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"><span class='directive'>#define <span class='macro'>DEBUG_KEY<span class='macro_popup'>"mate-session"</span></span> "mate-session"</span></td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"><span class='directive'>#define <span class='macro'>VISUAL_SCHEMA<span class='macro_popup'>"org.mate.applications-at-visual"</span></span> "org.mate.applications-at-visual"</span></td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"><span class='directive'>#define <span class='macro'>VISUAL_KEY<span class='macro_popup'>"exec"</span></span> "exec"</span></td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"><span class='directive'>#define <span class='macro'>VISUAL_STARTUP_KEY<span class='macro_popup'>"startup"</span></span> "startup"</span></td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"><span class='directive'>#define <span class='macro'>MOBILITY_SCHEMA<span class='macro_popup'>"org.mate.applications-at-mobility"</span></span> "org.mate.applications-at-mobility"</span></td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"><span class='directive'>#define <span class='macro'>MOBILITY_KEY<span class='macro_popup'>"exec"</span></span> "exec"</span></td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='directive'>#define <span class='macro'>MOBILITY_STARTUP_KEY<span class='macro_popup'>"startup"</span></span> "startup"</span></td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"><span class='directive'>#define <span class='macro'>MATE_INTERFACE_SCHEMA<span class='macro_popup'>"org.mate.interface"</span></span> "org.mate.interface"</span></td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"><span class='directive'>#define <span class='macro'>GTK_OVERLAY_SCROLL<span class='macro_popup'>"gtk-overlay-scrolling"</span></span> "gtk-overlay-scrolling"</span></td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_DBUS_NAME<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_AUTOSAVE<span class='macro_popup'>"auto-save-session"</span></span> "auto-save-session"</span></td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"><span class='keyword'>static</span> gboolean failsafe = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"><span class='keyword'>static</span> gboolean show_version = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='keyword'>static</span> gboolean debug = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"><span class='keyword'>static</span> gboolean disable_acceleration_check = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line">initialize_gsettings (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> GSettings* settings;</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> time_t now = time (0);</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> settings = g_settings_new (<span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> <span class='keyword'>if</span> (!settings)</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> ret = g_settings_set_int (settings, <span class='string_literal'>"session-start"</span>, now);</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> g_settings_sync ();</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> g_object_unref (settings);</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> on_bus_name_lost(DBusGProxy* bus_proxy, <span class='keyword'>const</span> <span class='keyword'>char</span>* name, gpointer data)</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> g_warning(<span class='string_literal'>"Lost name on bus: %s, exiting"</span>, name);</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> exit(1);</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"><span class='keyword'>static</span> gboolean acquire_name_on_proxy(DBusGProxy* bus_proxy, <span class='keyword'>const</span> <span class='keyword'>char</span>* name)</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> guint result;</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> <span class='keyword'>if</span> (bus_proxy == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> res = dbus_g_proxy_call(bus_proxy, <span class='string_literal'>"RequestName"</span>, &error, <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>, name, <span class='macro'>G_TYPE_UINT<span class='macro_popup'>((GType) ((7) << (2)))</span></span>, 0, <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>, <span class='macro'>G_TYPE_UINT<span class='macro_popup'>((GType) ((7) << (2)))</span></span>, &result, <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> <span class='keyword'>if</span> (! res)</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> g_warning(<span class='string_literal'>"Failed to acquire %s: %s"</span>, name, error->message);</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> g_error_free(error);</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> g_warning (<span class='string_literal'>"Failed to acquire %s"</span>, name);</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER<span class='macro_popup'>1</span></span>)</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> g_warning(<span class='string_literal'>"Failed to acquire %s: %s"</span>, name, error->message);</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> g_error_free(error);</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> g_warning(<span class='string_literal'>"Failed to acquire %s"</span>, name);</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> <span class='comment'>/* register for name lost */</span></td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> dbus_g_proxy_add_signal(bus_proxy, <span class='string_literal'>"NameLost"</span>, <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>, <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> dbus_g_proxy_connect_signal(bus_proxy, <span class='string_literal'>"NameLost"</span>, <span class='macro'>G_CALLBACK(on_bus_name_lost)<span class='macro_popup'>((GCallback) (on_bus_name_lost))</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> out:</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"><span class='keyword'>static</span> gboolean acquire_name(<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> DBusGProxy* bus_proxy;</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> DBusGConnection* connection;</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>if</span> (connection == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> gsm_util_init_error(<span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='string_literal'>"Could not connect to session bus: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='comment'>/* not reached */</span></td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> bus_proxy = dbus_g_proxy_new_for_name(connection, <span class='macro'>DBUS_SERVICE_DBUS<span class='macro_popup'>"org.freedesktop.DBus"</span></span>, <span class='macro'>DBUS_PATH_DBUS<span class='macro_popup'>"/org/freedesktop/DBus"</span></span>, <span class='macro'>DBUS_INTERFACE_DBUS<span class='macro_popup'>"org.freedesktop.DBus"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='keyword'>if</span> (!acquire_name_on_proxy(bus_proxy, <span class='macro'>GSM_DBUS_NAME<span class='macro_popup'>"org.gnome.SessionManager"</span></span>))</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> gsm_util_init_error(<span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='string_literal'>"%s"</span>, <span class='string_literal'>"Could not acquire name on session bus"</span>);</td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='comment'>/* not reached */</span></td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> g_object_unref(bus_proxy);</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"><span class='comment'>/* This doesn't contain the required components, so we need to always</span></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='comment'>* call append_required_apps() after a call to append_default_apps(). */</span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> append_default_apps(GsmManager* manager, <span class='keyword'>const</span> <span class='keyword'>char</span>* default_session_key, <span class='keyword'>char</span>** autostart_dirs)</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> gint i;</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> gchar** default_apps;</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> GSettings* settings;</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> g_debug(<span class='string_literal'>"main: *** Adding default apps"</span>);</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> <span class='macro'>g_assert(default_session_key != NULL)<span class='macro_popup'>do { if (default_session_key != ((void*)0)) ; else g_assertion_message_expr<br> (((gchar*) 0), "main.c", 207, ((const char*) (__func__)), "default_session_key != NULL"<br>); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> <span class='macro'>g_assert(autostart_dirs != NULL)<span class='macro_popup'>do { if (autostart_dirs != ((void*)0)) ; else g_assertion_message_expr<br> (((gchar*) 0), "main.c", 208, ((const char*) (__func__)), "autostart_dirs != NULL"<br>); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> settings = g_settings_new (<span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> default_apps = g_settings_get_strv (settings, default_session_key);</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> g_object_unref(settings);</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> <span class='keyword'>for</span> (i = 0; default_apps[i]; i++)</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> <span class='keyword'>char</span>* app_path;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY((<span class='keyword'>char</span>*) default_apps[i])<span class='macro_popup'>(((char*) default_apps[i])==((void*)0)||((char*) default_apps<br>[i])[0]=='\0')</span></span>)</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> app_path = gsm_util_find_desktop_file_for_app_name(default_apps[i], autostart_dirs);</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='keyword'>if</span> (app_path != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> gsm_manager_add_autostart_app(manager, app_path, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> g_free(app_path);</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> g_strfreev (default_apps);</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> append_required_apps(GsmManager* manager)</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> gchar** required_components;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> gint i;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> GSettings* settings;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> GSettings* settings_required_components;</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> g_debug(<span class='string_literal'>"main: *** Adding required apps"</span>);</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> settings = g_settings_new (<span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> settings_required_components = g_settings_new (<span class='macro'>GSM_REQUIRED_COMPONENTS_SCHEMA<span class='macro_popup'>"org.mate.session" ".required-components"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> required_components = g_settings_get_strv(settings, <span class='macro'>GSM_REQUIRED_COMPONENTS_LIST_KEY<span class='macro_popup'>"required-components-list"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> <span class='keyword'>if</span> (required_components == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> g_warning(<span class='string_literal'>"No required applications specified"</span>);</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> <span class='keyword'>for</span> (i = 0; required_components[i]; i++)</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> <span class='keyword'>char</span>* default_provider;</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span>* component;</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY((<span class='keyword'>char</span>*) required_components[i])<span class='macro_popup'>(((char*) required_components[i])==((void*)0)||((char*) required_components<br>[i])[0]=='\0')</span></span>)</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> component = required_components[i];</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> default_provider = g_settings_get_string (settings_required_components, component);</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> g_debug (<span class='string_literal'>"main: %s looking for component: '%s'"</span>, component, default_provider);</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>if</span> (default_provider != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> <span class='keyword'>char</span>* app_path;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> app_path = gsm_util_find_desktop_file_for_app_name(default_provider, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>if</span> (app_path != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> gsm_manager_add_autostart_app(manager, app_path, component);</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> g_warning(<span class='string_literal'>"Unable to find provider '%s' of required component '%s'"</span>, default_provider, component);</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> g_free(app_path);</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> g_free(default_provider);</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> g_debug(<span class='string_literal'>"main: *** Done adding required apps"</span>);</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> g_strfreev(required_components);</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> g_object_unref(settings);</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> g_object_unref(settings_required_components);</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> append_accessibility_apps(GsmManager* manager)</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> GSettings* mobility_settings;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> GSettings* visual_settings;</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> g_debug(<span class='string_literal'>"main: *** Adding accesibility apps"</span>);</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> mobility_settings = g_settings_new (<span class='macro'>MOBILITY_SCHEMA<span class='macro_popup'>"org.mate.applications-at-mobility"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> visual_settings = g_settings_new (<span class='macro'>VISUAL_SCHEMA<span class='macro_popup'>"org.mate.applications-at-visual"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> <span class='keyword'>if</span> (g_settings_get_boolean (mobility_settings, <span class='macro'>MOBILITY_STARTUP_KEY<span class='macro_popup'>"startup"</span></span>))</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> gchar *mobility_exec;</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> mobility_exec = g_settings_get_string (mobility_settings, <span class='macro'>MOBILITY_KEY<span class='macro_popup'>"exec"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> <span class='keyword'>if</span> (mobility_exec != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> && mobility_exec[0] != 0)</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> <span class='keyword'>char</span>* app_path;</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> app_path = gsm_util_find_desktop_file_for_app_name(mobility_exec, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> <span class='keyword'>if</span> (app_path != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> gsm_manager_add_autostart_app(manager, app_path, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> g_free (app_path);</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> g_free (mobility_exec);</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (g_settings_get_boolean (visual_settings, <span class='macro'>VISUAL_STARTUP_KEY<span class='macro_popup'>"startup"</span></span>))</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> gchar *visual_exec;</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> visual_exec = g_settings_get_string (visual_settings, <span class='macro'>VISUAL_KEY<span class='macro_popup'>"exec"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> <span class='keyword'>if</span> (visual_exec != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> && visual_exec[0] != 0)</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> <span class='keyword'>char</span>* app_path;</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> app_path = gsm_util_find_desktop_file_for_app_name(visual_exec, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='keyword'>if</span> (app_path != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> gsm_manager_add_autostart_app(manager, app_path, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> g_free (app_path);</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> g_free (visual_exec);</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> g_object_unref (mobility_settings);</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> g_object_unref (visual_settings);</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> maybe_load_saved_session_apps(GsmManager* manager)</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> GsmConsolekit* consolekit = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> GsmSystemd* systemd = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>char</span>* session_type;</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> gboolean is_login;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> systemd = gsm_get_systemd();</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> session_type = gsm_systemd_get_current_session_type(systemd);</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> is_login = g_strcmp0 (session_type, <span class='macro'>GSM_SYSTEMD_SESSION_TYPE_LOGIN_WINDOW<span class='macro_popup'>"greeter"</span></span>) == 0;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> consolekit = gsm_get_consolekit();</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> session_type = gsm_consolekit_get_current_session_type(consolekit);</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> is_login = g_strcmp0 (session_type, <span class='macro'>GSM_CONSOLEKIT_SESSION_TYPE_LOGIN_WINDOW<span class='macro_popup'>"LoginWindow"</span></span>) == 0;</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>if</span> (!is_login)</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> GSettings* settings;</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> gboolean autostart;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> settings = g_settings_new (<span class='macro'>GSM_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> autostart = g_settings_get_boolean (settings, <span class='macro'>KEY_AUTOSAVE<span class='macro_popup'>"auto-save-session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> g_object_unref (settings);</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> <span class='keyword'>if</span> (autostart == <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>)</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> gsm_manager_add_autostart_apps_from_dir(manager, gsm_util_get_saved_session_dir());</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> <span class='keyword'>if</span> (consolekit != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> g_object_unref(consolekit);</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='keyword'>if</span> (systemd != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> g_object_unref(systemd);</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> g_free(session_type);</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> load_standard_apps (GsmManager* manager, <span class='keyword'>const</span> <span class='keyword'>char</span>* default_session_key)</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> <span class='keyword'>char</span>** autostart_dirs;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> autostart_dirs = gsm_util_get_autostart_dirs();</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> <span class='keyword'>if</span> (!failsafe)</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> maybe_load_saved_session_apps(manager);</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>for</span> (i = 0; autostart_dirs[i]; i++)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> gsm_manager_add_autostart_apps_from_dir(manager, autostart_dirs[i]);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> <span class='comment'>/* We do this at the end in case a saved session contains an</span></td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> <span class='comment'>* application that already provides one of the components. */</span></td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> append_default_apps(manager, default_session_key, autostart_dirs);</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> append_required_apps(manager);</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> append_accessibility_apps(manager);</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> g_strfreev(autostart_dirs);</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> load_override_apps(GsmManager* manager, <span class='keyword'>char</span>** override_autostart_dirs)</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> <span class='keyword'>for</span> (i = 0; override_autostart_dirs[i]; i++)</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> gsm_manager_add_autostart_apps_from_dir(manager, override_autostart_dirs[i]);</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"><span class='keyword'>static</span> gboolean signal_cb(<span class='keyword'>int</span> signo, gpointer data)</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> <span class='keyword'>int</span> ret;</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> GsmManager* manager;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> g_debug(<span class='string_literal'>"Got callback for signal %d"</span>, signo);</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> ret = <span class="mrange"><span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span></span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:9ex">Value stored to 'ret' is never read</div></td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> <span class='keyword'>switch</span> (signo)</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGFPE<span class='macro_popup'>8</span></span>:</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGPIPE<span class='macro_popup'>13</span></span>:</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> <span class='comment'>/* let the fatal signals interrupt us */</span></td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> g_debug (<span class='string_literal'>"Caught signal %d, shutting down abnormally."</span>, signo);</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> ret = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGINT<span class='macro_popup'>2</span></span>:</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGTERM<span class='macro_popup'>15</span></span>:</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> manager = (GsmManager*) data;</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> gsm_manager_logout(manager, GSM_MANAGER_LOGOUT_MODE_FORCE, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> <span class='comment'>/* let the fatal signals interrupt us */</span></td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> g_debug(<span class='string_literal'>"Caught signal %d, shutting down normally."</span>, signo);</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGHUP<span class='macro_popup'>1</span></span>:</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> g_debug(<span class='string_literal'>"Got HUP signal"</span>);</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>SIGUSR1<span class='macro_popup'>10</span></span>:</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> g_debug(<span class='string_literal'>"Got USR1 signal"</span>);</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> mdm_log_toggle_debug();</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> g_debug(<span class='string_literal'>"Caught unhandled signal %d"</span>, signo);</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> ret = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> shutdown_cb(gpointer data)</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> GsmManager* manager = (GsmManager*) data;</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> g_debug(<span class='string_literal'>"Calling shutdown callback function"</span>);</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> <span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='comment'>* When the signal handler gets a shutdown signal, it calls</span></td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> <span class='comment'>* this function to inform GsmManager to not restart</span></td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> <span class='comment'>* applications in the off chance a handler is already queued</span></td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> <span class='comment'>* to dispatch following the below call to gtk_main_quit.</span></td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> gsm_manager_set_phase(manager, GSM_MANAGER_PHASE_EXIT);</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> gtk_main_quit();</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"><span class='keyword'>static</span> gboolean require_dbus_session(<span class='keyword'>int</span> argc, <span class='keyword'>char</span>** argv, GError** error)</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> <span class='keyword'>char</span>** new_argv;</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>if</span> (g_getenv(<span class='string_literal'>"DBUS_SESSION_BUS_ADDRESS"</span>))</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> <span class='comment'>/* Just a sanity check to prevent infinite recursion if</span></td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> <span class='comment'>* dbus-launch fails to set DBUS_SESSION_BUS_ADDRESS</span></td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='macro'>g_return_val_if_fail(!g_str_has_prefix(argv[0], <span class='string_literal'>"dbus-launch"</span>), TRUE)<span class='macro_popup'>do { if ((!(__builtin_constant_p ("dbus-launch")? __extension__<br> ({ const char * const __str = (argv[0]); const char * const __prefix<br> = ("dbus-launch"); gboolean __result = (0); if (__str == ((void<br>*)0) || __prefix == ((void*)0)) __result = (g_str_has_prefix)<br> (__str, __prefix); else { const size_t __str_len = strlen ((<br>(__str) + !(__str))); const size_t __prefix_len = strlen (((__prefix<br>) + !(__prefix))); if (__str_len >= __prefix_len) __result<br> = memcmp (((__str) + !(__str)), ((__prefix) + !(__prefix)), __prefix_len<br>) == 0; } __result; }) : (g_str_has_prefix) (argv[0], "dbus-launch"<br>) ))) { } else { g_return_if_fail_warning (((gchar*) 0), ((const<br> char*) (__func__)), "!g_str_has_prefix(argv[0], \"dbus-launch\")"<br>); return ((!(0))); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> <span class='comment'>/* +2 for our new arguments, +1 for NULL */</span></td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> new_argv = g_malloc(argc + 3 * <span class='keyword'>sizeof</span> (*argv));</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> new_argv[0] = <span class='string_literal'>"dbus-launch"</span>;</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> new_argv[1] = <span class='string_literal'>"--exit-with-session"</span>;</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < argc; i++)</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> new_argv[i + 2] = argv[i];</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> new_argv[i + 2] = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>if</span> (!execvp(<span class='string_literal'>"dbus-launch"</span>, new_argv))</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> g_set_error(error, <span class='macro'>G_SPAWN_ERROR<span class='macro_popup'>g_spawn_error_quark ()</span></span>, G_SPAWN_ERROR_FAILED, <span class='string_literal'>"No session bus and could not exec dbus-launch: %s"</span>, g_strerror(<span class='macro'>errno<span class='macro_popup'>(*__errno_location ())</span></span>));</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> g_free (new_argv);</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> g_free (new_argv);</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> <span class='comment'>/* Should not be reached */</span></td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line">debug_changed (GSettings *settings, gchar *key, gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> debug = g_settings_get_boolean (settings, <span class='macro'>DEBUG_KEY<span class='macro_popup'>"mate-session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> mdm_log_set_debug (debug);</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line">schema_exists (<span class='keyword'>const</span> gchar* schema_name)</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> GSettingsSchemaSource *source;</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> GSettingsSchema *schema;</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> gboolean exists;</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> source = g_settings_schema_source_get_default();</td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> schema = g_settings_schema_source_lookup (source, schema_name, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> exists = (schema != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> <span class='keyword'>if</span> (schema)</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> g_settings_schema_unref (schema);</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='keyword'>return</span> exists;</td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> set_overlay_scroll (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> GSettings *settings;</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> gboolean enabled;</td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> settings = g_settings_new (<span class='macro'>MATE_INTERFACE_SCHEMA<span class='macro_popup'>"org.mate.interface"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> enabled = g_settings_get_boolean (settings, <span class='macro'>GTK_OVERLAY_SCROLL<span class='macro_popup'>"gtk-overlay-scrolling"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> <span class='keyword'>if</span> (enabled) {</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> gsm_util_setenv (<span class='string_literal'>"GTK_OVERLAY_SCROLLING"</span>, <span class='string_literal'>"1"</span>);</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> gsm_util_setenv (<span class='string_literal'>"GTK_OVERLAY_SCROLLING"</span>, <span class='string_literal'>"0"</span>);</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> g_object_unref (settings);</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line">check_gl (gchar **gl_renderer, GError **error)</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> <span class='keyword'>int</span> status;</td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> <span class='keyword'>char</span> *argv[] = { <span class='macro'>LIBEXECDIR<span class='macro_popup'>"/usr/local/libexec"</span></span> <span class='string_literal'>"/mate-session-check-accelerated"</span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> };</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>if</span> (getenv (<span class='string_literal'>"DISPLAY"</span>) == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> <span class='comment'>/* Not connected to X11, someone else will take care of checking GL */</span></td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> <span class='keyword'>if</span> (!g_spawn_sync (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, (<span class='keyword'>char</span> **) argv, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, gl_renderer, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> &status, error)) {</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> <span class='keyword'>return</span> g_spawn_check_exit_status (status, error);</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"><span class='keyword'>int</span> main(<span class='keyword'>int</span> argc, <span class='keyword'>char</span>** argv)</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> <span class='keyword'>struct</span> sigaction sa;</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> GError* error;</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span>* display_str;</td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> GsmManager* manager;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> GsmStore* client_store;</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> GsmXsmpServer* xsmp_server;</td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> GSettings* debug_settings = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> GSettings* accessibility_settings;</td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> MdmSignalHandler* signal_handler;</td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>char</span>** override_autostart_dirs = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> <span class='keyword'>char</span>* gl_renderer = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> gboolean gl_failed = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> <span class='keyword'>static</span> GOptionEntry entries[] = {</td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> {<span class='string_literal'>"autostart"</span>, 'a', 0, G_OPTION_ARG_STRING_ARRAY, &override_autostart_dirs, <span class='macro'>N_(<span class='string_literal'>"Override standard autostart directories"</span>)<span class='macro_popup'>("Override standard autostart directories")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> {<span class='string_literal'>"debug"</span>, 0, 0, G_OPTION_ARG_NONE, &debug, <span class='macro'>N_(<span class='string_literal'>"Enable debugging code"</span>)<span class='macro_popup'>("Enable debugging code")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> {<span class='string_literal'>"failsafe"</span>, 'f', 0, G_OPTION_ARG_NONE, &failsafe, <span class='macro'>N_(<span class='string_literal'>"Do not load user-specified applications"</span>)<span class='macro_popup'>("Do not load user-specified applications")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> {<span class='string_literal'>"version"</span>, 0, 0, G_OPTION_ARG_NONE, &show_version, <span class='macro'>N_(<span class='string_literal'>"Version of this application"</span>)<span class='macro_popup'>("Version of this application")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>},</td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> { <span class='string_literal'>"disable-acceleration-check"</span>, 0, 0, G_OPTION_ARG_NONE, &disable_acceleration_check, <span class='macro'>N_(<span class='string_literal'>"Disable hardware acceleration check"</span>)<span class='macro_popup'>("Disable hardware acceleration check")</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> },</td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> {<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, 0, 0, 0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> }</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> <span class='comment'>/* Make sure that we have a session bus */</span></td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> <span class='keyword'>if</span> (!require_dbus_session(argc, argv, &error))</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> gsm_util_init_error(<span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, <span class='string_literal'>"%s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"><span class='directive'>#ifdef <span class='macro'>ENABLE_NLS<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line"> bindtextdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='macro'>LOCALE_DIR<span class='macro_popup'>"/usr/local/share/locale"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> bind_textdomain_codeset(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, <span class='string_literal'>"UTF-8"</span>);</td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"> textdomain(<span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line"><span class='directive'>#endif /* ENABLE_NLS */</span></td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> sa.<span class='macro'>sa_handler<span class='macro_popup'>__sigaction_handler.sa_handler</span></span> = <span class='macro'>SIG_IGN<span class='macro_popup'>((__sighandler_t) 1)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> sa.sa_flags = 0;</td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> sigemptyset(&sa.sa_mask);</td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> sigaction(<span class='macro'>SIGPIPE<span class='macro_popup'>13</span></span>, &sa, 0);</td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> gtk_init_with_args(&argc, &argv, (<span class='keyword'>char</span>*) <span class='macro'>_(<span class='string_literal'>" - the MATE session manager"</span>)<span class='macro_popup'>gettext (" - the MATE session manager")</span></span>, entries, <span class='macro'>GETTEXT_PACKAGE<span class='macro_popup'>"mate-session-manager"</span></span>, &error);</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> g_warning(<span class='string_literal'>"%s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> exit(1);</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='keyword'>if</span> (show_version)</td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> g_print(<span class='string_literal'>"%s %s\n"</span>, g_get_application_name(), <span class='macro'>VERSION<span class='macro_popup'>"1.28.0"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> exit(1);</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> gsm_util_export_activation_environment (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> gsm_util_export_user_environment (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> mdm_log_init();</td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line"> <span class='comment'>/* Allows to enable/disable debug from GSettings only if it is not set from argument */</span></td></tr> +<tr class="codeline" data-linenumber="657"><td class="num" id="LN657">657</td><td class="line"> <span class='keyword'>if</span> (!debug && schema_exists(<span class='macro'>DEBUG_SCHEMA<span class='macro_popup'>"org.mate.debug"</span></span>))</td></tr> +<tr class="codeline" data-linenumber="658"><td class="num" id="LN658">658</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="659"><td class="num" id="LN659">659</td><td class="line"> debug_settings = g_settings_new (<span class='macro'>DEBUG_SCHEMA<span class='macro_popup'>"org.mate.debug"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="660"><td class="num" id="LN660">660</td><td class="line"> <span class='macro'>g_signal_connect (debug_settings, <span class='string_literal'>"changed::"</span> DEBUG_KEY, G_CALLBACK (debug_changed), NULL)<span class='macro_popup'>g_signal_connect_data ((debug_settings), ("changed::" "mate-session"<br>), (((GCallback) (debug_changed))), (((void*)0)), ((void*)0),<br> (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="661"><td class="num" id="LN661">661</td><td class="line"> debug = g_settings_get_boolean (debug_settings, <span class='macro'>DEBUG_KEY<span class='macro_popup'>"mate-session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="662"><td class="num" id="LN662">662</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="663"><td class="num" id="LN663">663</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="664"><td class="num" id="LN664">664</td><td class="line"> mdm_log_set_debug(debug);</td></tr> +<tr class="codeline" data-linenumber="665"><td class="num" id="LN665">665</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="666"><td class="num" id="LN666">666</td><td class="line"> <span class='keyword'>if</span> (disable_acceleration_check) {</td></tr> +<tr class="codeline" data-linenumber="667"><td class="num" id="LN667">667</td><td class="line"> g_debug (<span class='string_literal'>"hardware acceleration check is disabled"</span>);</td></tr> +<tr class="codeline" data-linenumber="668"><td class="num" id="LN668">668</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="669"><td class="num" id="LN669">669</td><td class="line"> <span class='comment'>/* Check GL, if it doesn't work out then force software fallback */</span></td></tr> +<tr class="codeline" data-linenumber="670"><td class="num" id="LN670">670</td><td class="line"> <span class='keyword'>if</span> (!check_gl (&gl_renderer, &error)) {</td></tr> +<tr class="codeline" data-linenumber="671"><td class="num" id="LN671">671</td><td class="line"> gl_failed = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="672"><td class="num" id="LN672">672</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="673"><td class="num" id="LN673">673</td><td class="line"> g_debug (<span class='string_literal'>"hardware acceleration check failed: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="674"><td class="num" id="LN674">674</td><td class="line"> error? error->message : <span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="675"><td class="num" id="LN675">675</td><td class="line"> g_clear_error (&error);</td></tr> +<tr class="codeline" data-linenumber="676"><td class="num" id="LN676">676</td><td class="line"> <span class='keyword'>if</span> (g_getenv (<span class='string_literal'>"LIBGL_ALWAYS_SOFTWARE"</span>) == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="677"><td class="num" id="LN677">677</td><td class="line"> g_setenv (<span class='string_literal'>"LIBGL_ALWAYS_SOFTWARE"</span>, <span class='string_literal'>"1"</span>, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="678"><td class="num" id="LN678">678</td><td class="line"> <span class='keyword'>if</span> (!check_gl (&gl_renderer, &error)) {</td></tr> +<tr class="codeline" data-linenumber="679"><td class="num" id="LN679">679</td><td class="line"> g_warning (<span class='string_literal'>"software acceleration check failed: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="680"><td class="num" id="LN680">680</td><td class="line"> error? error->message : <span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="681"><td class="num" id="LN681">681</td><td class="line"> g_clear_error (&error);</td></tr> +<tr class="codeline" data-linenumber="682"><td class="num" id="LN682">682</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="683"><td class="num" id="LN683">683</td><td class="line"> gl_failed = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="684"><td class="num" id="LN684">684</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="685"><td class="num" id="LN685">685</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="686"><td class="num" id="LN686">686</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="687"><td class="num" id="LN687">687</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="688"><td class="num" id="LN688">688</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="689"><td class="num" id="LN689">689</td><td class="line"> <span class='keyword'>if</span> (gl_failed) {</td></tr> +<tr class="codeline" data-linenumber="690"><td class="num" id="LN690">690</td><td class="line"> g_warning (<span class='string_literal'>"gl_failed!"</span>);</td></tr> +<tr class="codeline" data-linenumber="691"><td class="num" id="LN691">691</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="692"><td class="num" id="LN692">692</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="693"><td class="num" id="LN693">693</td><td class="line"> <span class='keyword'>if</span> (g_getenv (<span class='string_literal'>"XDG_CURRENT_DESKTOP"</span>) == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="694"><td class="num" id="LN694">694</td><td class="line"> gsm_util_setenv (<span class='string_literal'>"XDG_CURRENT_DESKTOP"</span>, <span class='string_literal'>"MATE"</span>);</td></tr> +<tr class="codeline" data-linenumber="695"><td class="num" id="LN695">695</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="696"><td class="num" id="LN696">696</td><td class="line"> <span class='comment'>/* Set DISPLAY explicitly for all our children, in case --display</span></td></tr> +<tr class="codeline" data-linenumber="697"><td class="num" id="LN697">697</td><td class="line"> <span class='comment'>* was specified on the command line.</span></td></tr> +<tr class="codeline" data-linenumber="698"><td class="num" id="LN698">698</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="699"><td class="num" id="LN699">699</td><td class="line"> display_str = gdk_display_get_name (gdk_display_get_default());</td></tr> +<tr class="codeline" data-linenumber="700"><td class="num" id="LN700">700</td><td class="line"> gsm_util_setenv(<span class='string_literal'>"DISPLAY"</span>, display_str);</td></tr> +<tr class="codeline" data-linenumber="701"><td class="num" id="LN701">701</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="702"><td class="num" id="LN702">702</td><td class="line"> <span class='comment'>/* Some third-party programs rely on MATE_DESKTOP_SESSION_ID to</span></td></tr> +<tr class="codeline" data-linenumber="703"><td class="num" id="LN703">703</td><td class="line"> <span class='comment'>* detect if MATE is running. We keep this for compatibility reasons.</span></td></tr> +<tr class="codeline" data-linenumber="704"><td class="num" id="LN704">704</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="705"><td class="num" id="LN705">705</td><td class="line"> gsm_util_setenv(<span class='string_literal'>"MATE_DESKTOP_SESSION_ID"</span>, <span class='string_literal'>"this-is-deprecated"</span>);</td></tr> +<tr class="codeline" data-linenumber="706"><td class="num" id="LN706">706</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="707"><td class="num" id="LN707">707</td><td class="line"> <span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="708"><td class="num" id="LN708">708</td><td class="line"> <span class='comment'>* Make sure gsettings is set up correctly. If not, then bail.</span></td></tr> +<tr class="codeline" data-linenumber="709"><td class="num" id="LN709">709</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="710"><td class="num" id="LN710">710</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="711"><td class="num" id="LN711">711</td><td class="line"> <span class='keyword'>if</span> (initialize_gsettings () != <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>)</td></tr> +<tr class="codeline" data-linenumber="712"><td class="num" id="LN712">712</td><td class="line"> exit (1);</td></tr> +<tr class="codeline" data-linenumber="713"><td class="num" id="LN713">713</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="714"><td class="num" id="LN714">714</td><td class="line"> <span class='comment'>/* Look if accessibility is enabled */</span></td></tr> +<tr class="codeline" data-linenumber="715"><td class="num" id="LN715">715</td><td class="line"> accessibility_settings = g_settings_new (<span class='macro'>ACCESSIBILITY_SCHEMA<span class='macro_popup'>"org.mate.interface"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="716"><td class="num" id="LN716">716</td><td class="line"> <span class='keyword'>if</span> (g_settings_get_boolean (accessibility_settings, <span class='macro'>ACCESSIBILITY_KEY<span class='macro_popup'>"accessibility"</span></span>))</td></tr> +<tr class="codeline" data-linenumber="717"><td class="num" id="LN717">717</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="718"><td class="num" id="LN718">718</td><td class="line"> gsm_util_setenv(<span class='string_literal'>"GTK_MODULES"</span>, <span class='string_literal'>"gail:atk-bridge"</span>);</td></tr> +<tr class="codeline" data-linenumber="719"><td class="num" id="LN719">719</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="720"><td class="num" id="LN720">720</td><td class="line"> g_object_unref (accessibility_settings);</td></tr> +<tr class="codeline" data-linenumber="721"><td class="num" id="LN721">721</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="722"><td class="num" id="LN722">722</td><td class="line"> client_store = gsm_store_new();</td></tr> +<tr class="codeline" data-linenumber="723"><td class="num" id="LN723">723</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="724"><td class="num" id="LN724">724</td><td class="line"> xsmp_server = gsm_xsmp_server_new(client_store);</td></tr> +<tr class="codeline" data-linenumber="725"><td class="num" id="LN725">725</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="726"><td class="num" id="LN726">726</td><td class="line"> <span class='comment'>/* Now make sure they succeeded. (They'll call</span></td></tr> +<tr class="codeline" data-linenumber="727"><td class="num" id="LN727">727</td><td class="line"> <span class='comment'>* gsm_util_init_error() if they failed.)</span></td></tr> +<tr class="codeline" data-linenumber="728"><td class="num" id="LN728">728</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="729"><td class="num" id="LN729">729</td><td class="line"> acquire_name();</td></tr> +<tr class="codeline" data-linenumber="730"><td class="num" id="LN730">730</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="731"><td class="num" id="LN731">731</td><td class="line"> <span class='comment'>/* Starts gnome compat mode */</span></td></tr> +<tr class="codeline" data-linenumber="732"><td class="num" id="LN732">732</td><td class="line"> msm_gnome_start();</td></tr> +<tr class="codeline" data-linenumber="733"><td class="num" id="LN733">733</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="734"><td class="num" id="LN734">734</td><td class="line"> <span class='comment'>/* Set to use Gtk3 overlay scroll */</span></td></tr> +<tr class="codeline" data-linenumber="735"><td class="num" id="LN735">735</td><td class="line"> set_overlay_scroll ();</td></tr> +<tr class="codeline" data-linenumber="736"><td class="num" id="LN736">736</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="737"><td class="num" id="LN737">737</td><td class="line"> manager = gsm_manager_new(client_store, failsafe);</td></tr> +<tr class="codeline" data-linenumber="738"><td class="num" id="LN738">738</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="739"><td class="num" id="LN739">739</td><td class="line"> signal_handler = mdm_signal_handler_new();</td></tr> +<tr class="codeline" data-linenumber="740"><td class="num" id="LN740">740</td><td class="line"> mdm_signal_handler_add_fatal(signal_handler);</td></tr> +<tr class="codeline" data-linenumber="741"><td class="num" id="LN741">741</td><td class="line"> mdm_signal_handler_add(signal_handler, <span class='macro'>SIGFPE<span class='macro_popup'>8</span></span>, signal_cb, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="742"><td class="num" id="LN742">742</td><td class="line"> mdm_signal_handler_add(signal_handler, <span class='macro'>SIGHUP<span class='macro_popup'>1</span></span>, signal_cb, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="743"><td class="num" id="LN743">743</td><td class="line"> mdm_signal_handler_add(signal_handler, <span class='macro'>SIGUSR1<span class='macro_popup'>10</span></span>, signal_cb, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="744"><td class="num" id="LN744">744</td><td class="line"> mdm_signal_handler_add(signal_handler, <span class='macro'>SIGTERM<span class='macro_popup'>15</span></span>, signal_cb, manager);</td></tr> +<tr class="codeline" data-linenumber="745"><td class="num" id="LN745">745</td><td class="line"> mdm_signal_handler_add(signal_handler, <span class='macro'>SIGINT<span class='macro_popup'>2</span></span>, signal_cb, manager);</td></tr> +<tr class="codeline" data-linenumber="746"><td class="num" id="LN746">746</td><td class="line"> mdm_signal_handler_set_fatal_func(signal_handler, shutdown_cb, manager);</td></tr> +<tr class="codeline" data-linenumber="747"><td class="num" id="LN747">747</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="748"><td class="num" id="LN748">748</td><td class="line"> <span class='keyword'>if</span> (override_autostart_dirs != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="749"><td class="num" id="LN749">749</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="750"><td class="num" id="LN750">750</td><td class="line"> load_override_apps(manager, override_autostart_dirs);</td></tr> +<tr class="codeline" data-linenumber="751"><td class="num" id="LN751">751</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="752"><td class="num" id="LN752">752</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="753"><td class="num" id="LN753">753</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="754"><td class="num" id="LN754">754</td><td class="line"> load_standard_apps(manager, <span class='macro'>GSM_DEFAULT_SESSION_KEY<span class='macro_popup'>"default-session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="755"><td class="num" id="LN755">755</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="756"><td class="num" id="LN756">756</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="757"><td class="num" id="LN757">757</td><td class="line"> gsm_xsmp_server_start(xsmp_server);</td></tr> +<tr class="codeline" data-linenumber="758"><td class="num" id="LN758">758</td><td class="line"> _gsm_manager_set_renderer (manager, gl_renderer);</td></tr> +<tr class="codeline" data-linenumber="759"><td class="num" id="LN759">759</td><td class="line"> gsm_manager_start(manager);</td></tr> +<tr class="codeline" data-linenumber="760"><td class="num" id="LN760">760</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="761"><td class="num" id="LN761">761</td><td class="line"> gtk_main();</td></tr> +<tr class="codeline" data-linenumber="762"><td class="num" id="LN762">762</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="763"><td class="num" id="LN763">763</td><td class="line"> <span class='keyword'>if</span> (xsmp_server != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="764"><td class="num" id="LN764">764</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="765"><td class="num" id="LN765">765</td><td class="line"> g_object_unref(xsmp_server);</td></tr> +<tr class="codeline" data-linenumber="766"><td class="num" id="LN766">766</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="767"><td class="num" id="LN767">767</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="768"><td class="num" id="LN768">768</td><td class="line"> <span class='keyword'>if</span> (manager != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="769"><td class="num" id="LN769">769</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="770"><td class="num" id="LN770">770</td><td class="line"> g_debug(<span class='string_literal'>"Unreffing manager"</span>);</td></tr> +<tr class="codeline" data-linenumber="771"><td class="num" id="LN771">771</td><td class="line"> g_object_unref(manager);</td></tr> +<tr class="codeline" data-linenumber="772"><td class="num" id="LN772">772</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="773"><td class="num" id="LN773">773</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="774"><td class="num" id="LN774">774</td><td class="line"> <span class='keyword'>if</span> (gl_renderer != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="775"><td class="num" id="LN775">775</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="776"><td class="num" id="LN776">776</td><td class="line"> g_free (gl_renderer);</td></tr> +<tr class="codeline" data-linenumber="777"><td class="num" id="LN777">777</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="778"><td class="num" id="LN778">778</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="779"><td class="num" id="LN779">779</td><td class="line"> <span class='keyword'>if</span> (client_store != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="780"><td class="num" id="LN780">780</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="781"><td class="num" id="LN781">781</td><td class="line"> g_object_unref(client_store);</td></tr> +<tr class="codeline" data-linenumber="782"><td class="num" id="LN782">782</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="783"><td class="num" id="LN783">783</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="784"><td class="num" id="LN784">784</td><td class="line"> <span class='keyword'>if</span> (debug_settings != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="785"><td class="num" id="LN785">785</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="786"><td class="num" id="LN786">786</td><td class="line"> g_object_unref(debug_settings);</td></tr> +<tr class="codeline" data-linenumber="787"><td class="num" id="LN787">787</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="788"><td class="num" id="LN788">788</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="789"><td class="num" id="LN789">789</td><td class="line"> msm_gnome_stop();</td></tr> +<tr class="codeline" data-linenumber="790"><td class="num" id="LN790">790</td><td class="line"> mdm_log_shutdown();</td></tr> +<tr class="codeline" data-linenumber="791"><td class="num" id="LN791">791</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="792"><td class="num" id="LN792">792</td><td class="line"> <span class='keyword'>return</span> 0;</td></tr> +<tr class="codeline" data-linenumber="793"><td class="num" id="LN793">793</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="794"><td class="num" id="LN794">794</td><td class="line"> </td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-fc5e64.html b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-fc5e64.html new file mode 100644 index 0000000..234ecaf --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/report-fc5e64.html @@ -0,0 +1,4937 @@ +<!doctype html> +<html> +<head> +<title>gsm-manager.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Value stored to 'reply' is never read --> + +<!-- BUGTYPE Dead assignment --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/mate-session/gsm-manager.c --> + +<!-- FILENAME gsm-manager.c --> + +<!-- FUNCTIONNAME maybe_restart_user_bus --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT fc5e6400388f349be92d662af0fec843 --> + +<!-- BUGLINE 919 --> + +<!-- BUGCOLUMN 9 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>mate-session/gsm-manager.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 919, column 9</a><br />Value stored to 'reply' is never read</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name gsm-manager.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/rootdir/mate-session -fcoverage-compilation-dir=/rootdir/mate-session -resource-dir /usr/bin/../lib/clang/18 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/atk-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -I /usr/include/webp -D WITH_GZFILEOP -I /usr/include/libpng16 -I /usr/include/libxml2 -I /usr/include/pixman-1 -I /usr/include/cloudproviders -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/fribidi -I /usr/include/gio-unix-2.0 -I /usr/include/uuid -I ../mate-submodules/libegg -D LOCALE_DIR="/usr/local/share/locale" -D DATA_DIR="/usr/local/share/mate-session" -D LIBEXECDIR="/usr/local/libexec" -D GTKBUILDER_DIR="/usr/local/share/mate-session-manager" -D I_KNOW_THE_DEVICEKIT_POWER_API_IS_SUBJECT_TO_CHANGE -internal-isystem /usr/bin/../lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-unused-parameter -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-08-21-191347-5925-1 -x c gsm-manager.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"919": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2007 Novell, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Copyright (C) 2008 Red Hat, Inc.</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* Copyright (C) 2008 William Jon McCann <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* This program is free software; you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* it under the terms of the GNU General Public License as published by</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>* the Free Software Foundation; either version 2 of the License, or</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>* along with this program; if not, write to the Free Software</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> <span class='comment'>* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.</span></td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include "config.h"</span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <stdlib.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"><span class='directive'>#include <fcntl.h></span></td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include <signal.h></span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include <sys/stat.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"><span class='directive'>#include <sys/types.h></span></td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#include <glib.h></span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#include <glib/gi18n.h></span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"><span class='directive'>#include <glib/gstdio.h></span></td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"><span class='directive'>#include <glib-object.h></span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#include <dbus/dbus-glib.h></span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#include <dbus/dbus-glib-lowlevel.h></span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='directive'>#include <gtk/gtk.h> /* for logout dialog */</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"><span class='directive'>#include <gio/gio.h> /* for gsettings */</span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"><span class='directive'>#include "gsm-manager.h"</span></td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"><span class='directive'>#include "gsm-manager-glue.h"</span></td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"><span class='directive'>#include "gsm-store.h"</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='directive'>#include "gsm-inhibitor.h"</span></td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"><span class='directive'>#include "gsm-presence.h"</span></td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='directive'>#include "gsm-xsmp-client.h"</span></td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"><span class='directive'>#include "gsm-dbus-client.h"</span></td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"><span class='directive'>#include "gsm-autostart-app.h"</span></td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"><span class='directive'>#include "gsm-util.h"</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"><span class='directive'>#include "mdm.h"</span></td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='directive'>#include "gsm-logout-dialog.h"</span></td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"><span class='directive'>#include "gsm-inhibit-dialog.h"</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"><span class='directive'>#include "gsm-consolekit.h"</span></td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"><span class='directive'>#include "gsm-systemd.h"</span></td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"><span class='directive'>#include "gsm-session-save.h"</span></td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_MANAGER_GET_PRIVATE(o)<span class='macro_popup'>(((GsmManagerPrivate*) g_type_instance_get_private ((GTypeInstance<br>*) ((o)), ((gsm_manager_get_type ())))) GCC warning "Deprecated pre-processor symbol: replace with \"G_ADD_PRIVATE\""<br> +)</span></span> (<span class='macro'>G_TYPE_INSTANCE_GET_PRIVATE ((o), GSM_TYPE_MANAGER, GsmManagerPrivate)<span class='macro_popup'>((GsmManagerPrivate*) g_type_instance_get_private ((GTypeInstance<br>*) ((o)), ((gsm_manager_get_type ())))) GCC warning "Deprecated pre-processor symbol: replace with \"G_ADD_PRIVATE\""<br> +</span></span>)</span></td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_MANAGER_DBUS_PATH<span class='macro_popup'>"/org/gnome/SessionManager"</span></span> "/org/gnome/SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_MANAGER_DBUS_NAME<span class='macro_popup'>"org.gnome.SessionManager"</span></span> "org.gnome.SessionManager"</span></td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_MANAGER_PHASE_TIMEOUT<span class='macro_popup'>30</span></span> 30 /* seconds */</span></td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"><span class='comment'>/* In the exit phase, all apps were already given the chance to inhibit the session end</span></td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> <span class='comment'>* At that stage we don't want to wait much for apps to respond, we want to exit, and fast.</span></td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"><span class='directive'>#define <span class='macro'>GSM_MANAGER_EXIT_PHASE_TIMEOUT<span class='macro_popup'>1</span></span> 1 /* seconds */</span></td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"><span class='directive'>#define <span class='macro'>MDM_FLEXISERVER_COMMAND<span class='macro_popup'>"mdmflexiserver"</span></span> "mdmflexiserver"</span></td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='directive'>#define <span class='macro'>MDM_FLEXISERVER_ARGS<span class='macro_popup'>"--startnew Standard"</span></span> "--startnew Standard"</span></td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"><span class='directive'>#define <span class='macro'>GDM_FLEXISERVER_COMMAND<span class='macro_popup'>"gdmflexiserver"</span></span> "gdmflexiserver"</span></td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"><span class='directive'>#define <span class='macro'>GDM_FLEXISERVER_ARGS<span class='macro_popup'>"--startnew Standard"</span></span> "--startnew Standard"</span></td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"><span class='directive'>#define <span class='macro'>LOCKDOWN_SCHEMA<span class='macro_popup'>"org.mate.lockdown"</span></span> "org.mate.lockdown"</span></td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_LOCK_DISABLE<span class='macro_popup'>"disable-lock-screen"</span></span> "disable-lock-screen"</span></td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_LOG_OUT_DISABLE<span class='macro_popup'>"disable-log-out"</span></span> "disable-log-out"</span></td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_USER_SWITCH_DISABLE<span class='macro_popup'>"disable-user-switching"</span></span> "disable-user-switching"</span></td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"><span class='directive'>#define <span class='macro'>SESSION_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span> "org.mate.session"</span></td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_IDLE_DELAY<span class='macro_popup'>"idle-delay"</span></span> "idle-delay"</span></td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_AUTOSAVE<span class='macro_popup'>"auto-save-session"</span></span> "auto-save-session"</span></td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"><span class='directive'>#define <span class='macro'>SCREENSAVER_SCHEMA<span class='macro_popup'>"org.mate.screensaver"</span></span> "org.mate.screensaver"</span></td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_SLEEP_LOCK<span class='macro_popup'>"lock-enabled"</span></span> "lock-enabled"</span></td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"><span class='directive'>#ifdef <span class='macro'>__GNUC__<span class='macro_popup'>4</span></span></span></td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"><span class='directive'>#define <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> __attribute__ ((unused))</span></td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"><span class='directive'>#else</span></td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"><span class='directive'>#define <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span></span></td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>enum</span></td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> GSM_MANAGER_LOGOUT_NONE,</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> GSM_MANAGER_LOGOUT_LOGOUT,</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> GSM_MANAGER_LOGOUT_REBOOT,</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> GSM_MANAGER_LOGOUT_REBOOT_INTERACT,</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> GSM_MANAGER_LOGOUT_REBOOT_MDM,</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> GSM_MANAGER_LOGOUT_SHUTDOWN,</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> GSM_MANAGER_LOGOUT_SHUTDOWN_INTERACT,</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> GSM_MANAGER_LOGOUT_SHUTDOWN_MDM</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line">} GsmManagerLogoutType;</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span> {</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> gboolean failsafe;</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> GsmStore *clients;</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> GsmStore *inhibitors;</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> GsmStore *apps;</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> GsmPresence *presence;</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> <span class='comment'>/* Current status */</span></td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> GsmManagerPhase phase;</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> guint phase_timeout_id;</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> GSList *pending_apps;</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> GsmManagerLogoutMode logout_mode;</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> GSList *query_clients;</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> guint query_timeout_id;</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> <span class='comment'>/* This is used for GSM_MANAGER_PHASE_END_SESSION only at the moment,</span></td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> <span class='comment'>* since it uses a sublist of all running client that replied in a</span></td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='comment'>* specific way */</span></td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> GSList *next_query_clients;</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> <span class='comment'>/* This is the action that will be done just before we exit */</span></td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> GsmManagerLogoutType logout_type;</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> GtkWidget *inhibit_dialog;</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> <span class='comment'>/* List of clients which were disconnected due to disabled condition</span></td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> <span class='comment'>* and shouldn't be automatically restarted */</span></td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> GSList *condition_clients;</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> GSettings *settings_session;</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> GSettings *settings_lockdown;</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> GSettings *settings_screensaver;</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> <span class='keyword'>char</span> *renderer;</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> DBusGProxy *bus_proxy;</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> DBusGConnection *connection;</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> gboolean dbus_disconnected : 1;</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">} GsmManagerPrivate;</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> PROP_0,</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> PROP_CLIENT_STORE,</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> PROP_RENDERER,</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> PROP_FAILSAFE</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"><span class='keyword'>enum</span> {</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> PHASE_CHANGED,</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> CLIENT_ADDED,</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> CLIENT_REMOVED,</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> INHIBITOR_ADDED,</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> INHIBITOR_REMOVED,</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> SESSION_RUNNING,</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> SESSION_OVER,</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> LAST_SIGNAL</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"><span class='keyword'>static</span> guint signals [LAST_SIGNAL] = { 0 };</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> gsm_manager_finalize (GObject *object);</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"><span class='keyword'>static</span> gboolean _log_out_is_locked_down (GsmManager *manager);</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"><span class='keyword'>static</span> gboolean _switch_user_is_locked_down (GsmManager *manager);</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> _handle_client_end_session_response (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> gboolean is_ok,</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> gboolean do_last,</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> gboolean cancel,</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *reason);</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"><span class='keyword'>static</span> gboolean auto_save_is_enabled (GsmManager *manager);</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> maybe_save_session (GsmManager *manager);</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"><span class='keyword'>static</span> gpointer manager_object = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"><span class='macro'>G_DEFINE_TYPE_WITH_PRIVATE (GsmManager, gsm_manager, G_TYPE_OBJECT)<span class='macro_popup'>static void gsm_manager_init (GsmManager *self); static void gsm_manager_class_init<br> (GsmManagerClass *klass); static GType gsm_manager_get_type_once<br> (void); static gpointer gsm_manager_parent_class = ((void*)0<br>); static gint GsmManager_private_offset; static void gsm_manager_class_intern_init<br> (gpointer klass) { gsm_manager_parent_class = g_type_class_peek_parent<br> (klass); if (GsmManager_private_offset != 0) g_type_class_adjust_private_offset<br> (klass, &GsmManager_private_offset); gsm_manager_class_init<br> ((GsmManagerClass*) klass); } __attribute__ ((__unused__)) static<br> inline gpointer gsm_manager_get_instance_private (GsmManager<br> *self) { return (((gpointer) ((guint8*) (self) + (glong) (GsmManager_private_offset<br>)))); } GType gsm_manager_get_type (void) { static GType static_g_define_type_id<br> = 0; if ((__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); (void<br>) (0 ? (gpointer) * (&static_g_define_type_id) : ((void*)<br>0)); (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); __typeof__<br> (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__<br> ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id<br>); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)<br>; gapg_temp_newval; })) && g_once_init_enter_pointer (<br>&static_g_define_type_id)); })) ) { GType g_define_type_id<br> = gsm_manager_get_type_once (); (__extension__ ({ _Static_assert<br> (sizeof *(&static_g_define_type_id) == sizeof (gpointer)<br>, "Expression evaluates to false"); 0 ? (void) (*(&static_g_define_type_id<br>) = (g_define_type_id)) : (void) 0; g_once_init_leave_pointer<br> ((&static_g_define_type_id), (gpointer) (guintptr) (g_define_type_id<br>)); })) ; } return static_g_define_type_id; } __attribute__ (<br>(__noinline__)) static GType gsm_manager_get_type_once (void)<br> { GType g_define_type_id = g_type_register_static_simple (((<br>GType) ((20) << (2))), g_intern_static_string ("GsmManager"<br>), sizeof (GsmManagerClass), (GClassInitFunc)(void (*)(void))<br> gsm_manager_class_intern_init, sizeof (GsmManager), (GInstanceInitFunc<br>)(void (*)(void)) gsm_manager_init, (GTypeFlags) 0); { {{ GsmManager_private_offset<br> = g_type_add_instance_private (g_define_type_id, sizeof (GsmManagerPrivate<br>)); };} } return g_define_type_id; }</span></span></td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line">GQuark</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line">gsm_manager_error_quark (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='keyword'>static</span> GQuark ret = 0;</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='keyword'>if</span> (ret == 0) {</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> ret = g_quark_from_static_string (<span class='string_literal'>"gsm_manager_error"</span>);</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='keyword'>return</span> ret;</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"><span class='directive'>#define <span class='macro'>ENUM_ENTRY(NAME, DESC)<span class='macro_popup'>{ NAME, "" "NAME" "", DESC }</span></span> { NAME, "" #NAME "", DESC }</span></td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line">GType</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line">gsm_manager_error_get_type (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> <span class='keyword'>static</span> GType etype = 0;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> <span class='keyword'>if</span> (etype == 0) {</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> GEnumValue values[] = {</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='macro'>ENUM_ENTRY (GSM_MANAGER_ERROR_GENERAL, <span class='string_literal'>"GeneralError"</span>)<span class='macro_popup'>{ GSM_MANAGER_ERROR_GENERAL, "" "GSM_MANAGER_ERROR_GENERAL" ""<br>, "GeneralError" }</span></span>,</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> <span class='macro'>ENUM_ENTRY (GSM_MANAGER_ERROR_NOT_IN_INITIALIZATION, <span class='string_literal'>"NotInInitialization"</span>)<span class='macro_popup'>{ GSM_MANAGER_ERROR_NOT_IN_INITIALIZATION, "" "GSM_MANAGER_ERROR_NOT_IN_INITIALIZATION"<br> "", "NotInInitialization" }</span></span>,</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='macro'>ENUM_ENTRY (GSM_MANAGER_ERROR_NOT_IN_RUNNING, <span class='string_literal'>"NotInRunning"</span>)<span class='macro_popup'>{ GSM_MANAGER_ERROR_NOT_IN_RUNNING, "" "GSM_MANAGER_ERROR_NOT_IN_RUNNING"<br> "", "NotInRunning" }</span></span>,</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> <span class='macro'>ENUM_ENTRY (GSM_MANAGER_ERROR_ALREADY_REGISTERED, <span class='string_literal'>"AlreadyRegistered"</span>)<span class='macro_popup'>{ GSM_MANAGER_ERROR_ALREADY_REGISTERED, "" "GSM_MANAGER_ERROR_ALREADY_REGISTERED"<br> "", "AlreadyRegistered" }</span></span>,</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> <span class='macro'>ENUM_ENTRY (GSM_MANAGER_ERROR_NOT_REGISTERED, <span class='string_literal'>"NotRegistered"</span>)<span class='macro_popup'>{ GSM_MANAGER_ERROR_NOT_REGISTERED, "" "GSM_MANAGER_ERROR_NOT_REGISTERED"<br> "", "NotRegistered" }</span></span>,</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='macro'>ENUM_ENTRY (GSM_MANAGER_ERROR_INVALID_OPTION, <span class='string_literal'>"InvalidOption"</span>)<span class='macro_popup'>{ GSM_MANAGER_ERROR_INVALID_OPTION, "" "GSM_MANAGER_ERROR_INVALID_OPTION"<br> "", "InvalidOption" }</span></span>,</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> <span class='macro'>ENUM_ENTRY (GSM_MANAGER_ERROR_LOCKED_DOWN, <span class='string_literal'>"LockedDown"</span>)<span class='macro_popup'>{ GSM_MANAGER_ERROR_LOCKED_DOWN, "" "GSM_MANAGER_ERROR_LOCKED_DOWN"<br> "", "LockedDown" }</span></span>,</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> { 0, 0, 0 }</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> <span class='macro'>g_assert (GSM_MANAGER_NUM_ERRORS == G_N_ELEMENTS (values) - 1)<span class='macro_popup'>do { if (GSM_MANAGER_NUM_ERRORS == (sizeof (values) / sizeof (<br>(values)[0])) - 1) ; else g_assertion_message_expr (((gchar*)<br> 0), "gsm-manager.c", 223, ((const char*) (__func__)), "GSM_MANAGER_NUM_ERRORS == G_N_ELEMENTS (values) - 1"<br>); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> etype = g_enum_register_static (<span class='string_literal'>"GsmManagerError"</span>, values);</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> <span class='keyword'>return</span> etype;</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line">_debug_client (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Client %s"</span>, gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line">debug_clients (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> gsm_store_foreach (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> (GsmStoreFunc)_debug_client,</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> manager);</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line">_debug_inhibitor (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> GsmInhibitor *inhibitor,</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Inhibitor app:%s client:%s bus-name:%s reason:%s"</span>,</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> gsm_inhibitor_peek_app_id (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> gsm_inhibitor_peek_client_id (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> gsm_inhibitor_peek_bus_name (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> gsm_inhibitor_peek_reason (inhibitor));</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line">debug_inhibitors (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> gsm_store_foreach (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> (GsmStoreFunc)_debug_inhibitor,</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> manager);</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line">_find_by_cookie (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> GsmInhibitor *inhibitor,</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> guint *cookie_ap)</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> guint cookie_b;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> cookie_b = gsm_inhibitor_peek_cookie (inhibitor);</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='keyword'>return</span> (*cookie_ap == cookie_b);</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line">_find_by_startup_id (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id_a)</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id_b;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> startup_id_b = gsm_client_peek_startup_id (client);</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (startup_id_b)<span class='macro_popup'>((startup_id_b)==((void*)0)||(startup_id_b)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> <span class='keyword'>return</span> (strcmp (startup_id_a, startup_id_b) == 0);</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line">app_condition_changed (GsmApp *app,</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> gboolean condition,</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> GsmClient *client;</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: app:%s condition changed condition:%d"</span>,</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> gsm_app_peek_id (app),</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> condition);</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> client = (GsmClient *)gsm_store_find (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> (GsmStoreFunc)_find_by_startup_id,</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> (<span class='keyword'>char</span> *)gsm_app_peek_startup_id (app));</td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> <span class='keyword'>if</span> (condition) {</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> <span class='keyword'>if</span> (!gsm_app_is_running (app) && client == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> gboolean <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> res;</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: starting app '%s'"</span>, gsm_app_peek_id (app));</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> res = gsm_app_start (app, &error);</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> g_warning (<span class='string_literal'>"Not able to start app from its condition: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: not starting - app still running '%s'"</span>, gsm_app_peek_id (app));</td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> gboolean <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> res;</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> <span class='keyword'>if</span> (client != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='comment'>/* Kill client in case condition if false and make sure it won't</span></td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> <span class='comment'>* be automatically restarted by adding the client to</span></td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='comment'>* condition_clients */</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> priv->condition_clients =</td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> g_slist_prepend (priv->condition_clients, client);</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: stopping client %s for app"</span>, gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> res = gsm_client_stop (client, &error);</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> g_warning (<span class='string_literal'>"Not able to stop app client from its condition: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: stopping app %s"</span>, gsm_app_peek_id (app));</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='comment'>/* If we don't have a client then we should try to kill the app,</span></td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='comment'>* if it is running */</span></td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>if</span> (gsm_app_is_running (app)) {</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> res = gsm_app_stop (app, &error);</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> g_warning (<span class='string_literal'>"Not able to stop app from its condition: %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>const</span> <span class='keyword'>char</span> *</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line">phase_num_to_name (guint phase)</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *name;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> <span class='keyword'>switch</span> (phase) {</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_STARTUP:</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> name = <span class='string_literal'>"STARTUP"</span>;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_INITIALIZATION:</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> name = <span class='string_literal'>"INITIALIZATION"</span>;</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_WINDOW_MANAGER:</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> name = <span class='string_literal'>"WINDOW_MANAGER"</span>;</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_PANEL:</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> name = <span class='string_literal'>"PANEL"</span>;</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_DESKTOP:</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> name = <span class='string_literal'>"DESKTOP"</span>;</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_APPLICATION:</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> name = <span class='string_literal'>"APPLICATION"</span>;</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_RUNNING:</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> name = <span class='string_literal'>"RUNNING"</span>;</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_QUERY_END_SESSION:</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> name = <span class='string_literal'>"QUERY_END_SESSION"</span>;</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_END_SESSION:</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> name = <span class='string_literal'>"END_SESSION"</span>;</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_EXIT:</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> name = <span class='string_literal'>"EXIT"</span>;</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-manager.c",<br> 410, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> <span class='keyword'>return</span> name;</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span> start_phase (GsmManager *manager);</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line">quit_request_completed_consolekit (GsmConsolekit *consolekit,</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> GError *error,</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> MdmLogoutAction fallback_action = <span class='macro'>GPOINTER_TO_INT (user_data)<span class='macro_popup'>((gint) (glong) (user_data))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> mdm_set_logout_action (fallback_action);</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> g_object_unref (consolekit);</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> gtk_main_quit ();</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line">quit_request_completed_systemd (GsmSystemd *systemd,</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> GError *error,</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> MdmLogoutAction fallback_action = <span class='macro'>GPOINTER_TO_INT (user_data)<span class='macro_popup'>((gint) (glong) (user_data))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> mdm_set_logout_action (fallback_action);</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> g_object_unref (systemd);</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> gtk_main_quit ();</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line">gsm_manager_quit (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> <span class='comment'>/* See the comment in request_reboot() for some more details about how</span></td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> <span class='comment'>* this works. */</span></td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> <span class='keyword'>switch</span> (priv->logout_type) {</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_LOGOUT:</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> gtk_main_quit ();</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_REBOOT:</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_REBOOT_INTERACT:</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> mdm_set_logout_action (MDM_LOGOUT_ACTION_NONE);</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> <span class='macro'>g_signal_connect (systemd,<span class='macro_popup'>g_signal_connect_data ((systemd), ("request-completed"), (((GCallback<br>) (quit_request_completed_systemd))), (((gpointer) (glong) (MDM_LOGOUT_ACTION_REBOOT<br>))), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> <span class='string_literal'><span class='macro'>"request-completed"</span>,<span class='macro_popup'>g_signal_connect_data ((systemd), ("request-completed"), (((GCallback<br>) (quit_request_completed_systemd))), (((gpointer) (glong) (MDM_LOGOUT_ACTION_REBOOT<br>))), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> <span class='macro'>G_CALLBACK (quit_request_completed_systemd),<span class='macro_popup'>g_signal_connect_data ((systemd), ("request-completed"), (((GCallback<br>) (quit_request_completed_systemd))), (((gpointer) (glong) (MDM_LOGOUT_ACTION_REBOOT<br>))), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='macro'>GINT_TO_POINTER (MDM_LOGOUT_ACTION_REBOOT))<span class='macro_popup'>g_signal_connect_data ((systemd), ("request-completed"), (((GCallback<br>) (quit_request_completed_systemd))), (((gpointer) (glong) (MDM_LOGOUT_ACTION_REBOOT<br>))), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> gsm_systemd_attempt_restart (systemd);</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> <span class='macro'>g_signal_connect (consolekit,<span class='macro_popup'>g_signal_connect_data ((consolekit), ("request-completed"), (<br>((GCallback) (quit_request_completed_consolekit))), (((gpointer<br>) (glong) (MDM_LOGOUT_ACTION_REBOOT))), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> <span class='string_literal'><span class='macro'>"request-completed"</span>,<span class='macro_popup'>g_signal_connect_data ((consolekit), ("request-completed"), (<br>((GCallback) (quit_request_completed_consolekit))), (((gpointer<br>) (glong) (MDM_LOGOUT_ACTION_REBOOT))), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> <span class='macro'>G_CALLBACK (quit_request_completed_consolekit),<span class='macro_popup'>g_signal_connect_data ((consolekit), ("request-completed"), (<br>((GCallback) (quit_request_completed_consolekit))), (((gpointer<br>) (glong) (MDM_LOGOUT_ACTION_REBOOT))), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> <span class='macro'>GINT_TO_POINTER (MDM_LOGOUT_ACTION_REBOOT))<span class='macro_popup'>g_signal_connect_data ((consolekit), ("request-completed"), (<br>((GCallback) (quit_request_completed_consolekit))), (((gpointer<br>) (glong) (MDM_LOGOUT_ACTION_REBOOT))), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> gsm_consolekit_attempt_restart (consolekit);</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_REBOOT_MDM:</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> mdm_set_logout_action (MDM_LOGOUT_ACTION_REBOOT);</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> gtk_main_quit ();</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_SHUTDOWN:</td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_SHUTDOWN_INTERACT:</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> mdm_set_logout_action (MDM_LOGOUT_ACTION_NONE);</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> <span class='macro'>g_signal_connect (systemd,<span class='macro_popup'>g_signal_connect_data ((systemd), ("request-completed"), (((GCallback<br>) (quit_request_completed_systemd))), (((gpointer) (glong) (MDM_LOGOUT_ACTION_SHUTDOWN<br>))), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> <span class='string_literal'><span class='macro'>"request-completed"</span>,<span class='macro_popup'>g_signal_connect_data ((systemd), ("request-completed"), (((GCallback<br>) (quit_request_completed_systemd))), (((gpointer) (glong) (MDM_LOGOUT_ACTION_SHUTDOWN<br>))), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> <span class='macro'>G_CALLBACK (quit_request_completed_systemd),<span class='macro_popup'>g_signal_connect_data ((systemd), ("request-completed"), (((GCallback<br>) (quit_request_completed_systemd))), (((gpointer) (glong) (MDM_LOGOUT_ACTION_SHUTDOWN<br>))), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='macro'>GINT_TO_POINTER (MDM_LOGOUT_ACTION_SHUTDOWN))<span class='macro_popup'>g_signal_connect_data ((systemd), ("request-completed"), (((GCallback<br>) (quit_request_completed_systemd))), (((gpointer) (glong) (MDM_LOGOUT_ACTION_SHUTDOWN<br>))), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> gsm_systemd_attempt_stop (systemd);</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> <span class='macro'>g_signal_connect (consolekit,<span class='macro_popup'>g_signal_connect_data ((consolekit), ("request-completed"), (<br>((GCallback) (quit_request_completed_consolekit))), (((gpointer<br>) (glong) (MDM_LOGOUT_ACTION_SHUTDOWN))), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> <span class='string_literal'><span class='macro'>"request-completed"</span>,<span class='macro_popup'>g_signal_connect_data ((consolekit), ("request-completed"), (<br>((GCallback) (quit_request_completed_consolekit))), (((gpointer<br>) (glong) (MDM_LOGOUT_ACTION_SHUTDOWN))), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> <span class='macro'>G_CALLBACK (quit_request_completed_consolekit),<span class='macro_popup'>g_signal_connect_data ((consolekit), ("request-completed"), (<br>((GCallback) (quit_request_completed_consolekit))), (((gpointer<br>) (glong) (MDM_LOGOUT_ACTION_SHUTDOWN))), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> <span class='macro'>GINT_TO_POINTER (MDM_LOGOUT_ACTION_SHUTDOWN))<span class='macro_popup'>g_signal_connect_data ((consolekit), ("request-completed"), (<br>((GCallback) (quit_request_completed_consolekit))), (((gpointer<br>) (glong) (MDM_LOGOUT_ACTION_SHUTDOWN))), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> gsm_consolekit_attempt_stop (consolekit);</td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_SHUTDOWN_MDM:</td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> mdm_set_logout_action (MDM_LOGOUT_ACTION_SHUTDOWN);</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> gtk_main_quit ();</td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-manager.c",<br> 529, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line">end_phase (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> gboolean start_next_phase = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: ending phase %s\n"</span>,</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> phase_num_to_name (priv->phase));</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> g_slist_free (priv->pending_apps);</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> priv->pending_apps = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> g_slist_free (priv->query_clients);</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> priv->query_clients = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> g_slist_free (priv->next_query_clients);</td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> priv->next_query_clients = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> <span class='keyword'>if</span> (priv->phase_timeout_id > 0) {</td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> g_source_remove (priv->phase_timeout_id);</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> priv->phase_timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> <span class='keyword'>switch</span> (priv->phase) {</td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_STARTUP:</td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_INITIALIZATION:</td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_WINDOW_MANAGER:</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_PANEL:</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_DESKTOP:</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_APPLICATION:</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_RUNNING:</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> <span class='keyword'>if</span> (_log_out_is_locked_down (manager)) {</td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> g_warning (<span class='string_literal'>"Unable to logout: Logout has been locked down"</span>);</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> start_next_phase = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_QUERY_END_SESSION:</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_END_SESSION:</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> <span class='keyword'>if</span> (auto_save_is_enabled (manager))</td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> maybe_save_session (manager);</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_EXIT:</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> start_next_phase = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> gsm_manager_quit (manager);</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-manager.c",<br> 584, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>if</span> (start_next_phase) {</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> priv->phase++;</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> start_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line">app_registered (GsmApp *app,</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> priv->pending_apps = g_slist_remove (priv->pending_apps, app);</td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (app, app_registered, manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((app), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (app_registered), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> <span class='keyword'>if</span> (priv->pending_apps == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> <span class='keyword'>if</span> (priv->phase_timeout_id > 0) {</td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> g_source_remove (priv->phase_timeout_id);</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> priv->phase_timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line">on_phase_timeout (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> GSList *a;</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> priv->phase_timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line"> <span class='keyword'>switch</span> (priv->phase) {</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_STARTUP:</td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_INITIALIZATION:</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_WINDOW_MANAGER:</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_PANEL:</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_DESKTOP:</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_APPLICATION:</td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> <span class='keyword'>for</span> (a = priv->pending_apps; a; a = a->next) {</td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> g_warning (<span class='string_literal'>"Application '%s' failed to register before timeout"</span>,</td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> gsm_app_peek_app_id (a->data));</td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (a->data, app_registered, manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((a->data), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (app_registered), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> <span class='comment'>/* FIXME: what if the app was filling in a required slot? */</span></td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_RUNNING:</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_QUERY_END_SESSION:</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_END_SESSION:</td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_EXIT:</td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-manager.c",<br> 645, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line">_autostart_delay_timeout (GsmApp *app)</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="657"><td class="num" id="LN657">657</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="658"><td class="num" id="LN658">658</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="659"><td class="num" id="LN659">659</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="660"><td class="num" id="LN660">660</td><td class="line"> <span class='keyword'>if</span> (!gsm_app_peek_is_disabled (app)</td></tr> +<tr class="codeline" data-linenumber="661"><td class="num" id="LN661">661</td><td class="line"> && !gsm_app_peek_is_conditionally_disabled (app)) {</td></tr> +<tr class="codeline" data-linenumber="662"><td class="num" id="LN662">662</td><td class="line"> res = gsm_app_start (app, &error);</td></tr> +<tr class="codeline" data-linenumber="663"><td class="num" id="LN663">663</td><td class="line"> <span class='keyword'>if</span> (!res) {</td></tr> +<tr class="codeline" data-linenumber="664"><td class="num" id="LN664">664</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="665"><td class="num" id="LN665">665</td><td class="line"> g_warning (<span class='string_literal'>"Could not launch application '%s': %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="666"><td class="num" id="LN666">666</td><td class="line"> gsm_app_peek_app_id (app),</td></tr> +<tr class="codeline" data-linenumber="667"><td class="num" id="LN667">667</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="668"><td class="num" id="LN668">668</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="669"><td class="num" id="LN669">669</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="670"><td class="num" id="LN670">670</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="671"><td class="num" id="LN671">671</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="672"><td class="num" id="LN672">672</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="673"><td class="num" id="LN673">673</td><td class="line"> g_object_unref (app);</td></tr> +<tr class="codeline" data-linenumber="674"><td class="num" id="LN674">674</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="675"><td class="num" id="LN675">675</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="676"><td class="num" id="LN676">676</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="677"><td class="num" id="LN677">677</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="678"><td class="num" id="LN678">678</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="679"><td class="num" id="LN679">679</td><td class="line">_start_app (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="680"><td class="num" id="LN680">680</td><td class="line"> GsmApp *app,</td></tr> +<tr class="codeline" data-linenumber="681"><td class="num" id="LN681">681</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="682"><td class="num" id="LN682">682</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="683"><td class="num" id="LN683">683</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="684"><td class="num" id="LN684">684</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="685"><td class="num" id="LN685">685</td><td class="line"> <span class='keyword'>int</span> delay;</td></tr> +<tr class="codeline" data-linenumber="686"><td class="num" id="LN686">686</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="687"><td class="num" id="LN687">687</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="688"><td class="num" id="LN688">688</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="689"><td class="num" id="LN689">689</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="690"><td class="num" id="LN690">690</td><td class="line"> <span class='keyword'>if</span> (gsm_app_peek_phase (app) != priv->phase) {</td></tr> +<tr class="codeline" data-linenumber="691"><td class="num" id="LN691">691</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="692"><td class="num" id="LN692">692</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="693"><td class="num" id="LN693">693</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="694"><td class="num" id="LN694">694</td><td class="line"> <span class='comment'>/* Keep track of app autostart condition in order to react</span></td></tr> +<tr class="codeline" data-linenumber="695"><td class="num" id="LN695">695</td><td class="line"> <span class='comment'>* accordingly in the future. */</span></td></tr> +<tr class="codeline" data-linenumber="696"><td class="num" id="LN696">696</td><td class="line"> <span class='macro'>g_signal_connect (app,<span class='macro_popup'>g_signal_connect_data ((app), ("condition-changed"), (((GCallback<br>) (app_condition_changed))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="697"><td class="num" id="LN697">697</td><td class="line"> <span class='string_literal'><span class='macro'>"condition-changed"</span>,<span class='macro_popup'>g_signal_connect_data ((app), ("condition-changed"), (((GCallback<br>) (app_condition_changed))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="698"><td class="num" id="LN698">698</td><td class="line"> <span class='macro'>G_CALLBACK (app_condition_changed),<span class='macro_popup'>g_signal_connect_data ((app), ("condition-changed"), (((GCallback<br>) (app_condition_changed))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="699"><td class="num" id="LN699">699</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((app), ("condition-changed"), (((GCallback<br>) (app_condition_changed))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="700"><td class="num" id="LN700">700</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="701"><td class="num" id="LN701">701</td><td class="line"> <span class='keyword'>if</span> (gsm_app_peek_is_disabled (app)</td></tr> +<tr class="codeline" data-linenumber="702"><td class="num" id="LN702">702</td><td class="line"> || gsm_app_peek_is_conditionally_disabled (app)) {</td></tr> +<tr class="codeline" data-linenumber="703"><td class="num" id="LN703">703</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Skipping disabled app: %s"</span>, id);</td></tr> +<tr class="codeline" data-linenumber="704"><td class="num" id="LN704">704</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="705"><td class="num" id="LN705">705</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="706"><td class="num" id="LN706">706</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="707"><td class="num" id="LN707">707</td><td class="line"> delay = gsm_app_peek_autostart_delay (app);</td></tr> +<tr class="codeline" data-linenumber="708"><td class="num" id="LN708">708</td><td class="line"> <span class='keyword'>if</span> (delay > 0) {</td></tr> +<tr class="codeline" data-linenumber="709"><td class="num" id="LN709">709</td><td class="line"> g_timeout_add_seconds (delay,</td></tr> +<tr class="codeline" data-linenumber="710"><td class="num" id="LN710">710</td><td class="line"> (GSourceFunc)_autostart_delay_timeout,</td></tr> +<tr class="codeline" data-linenumber="711"><td class="num" id="LN711">711</td><td class="line"> <span class='macro'>g_object_ref (app)<span class='macro_popup'>((__typeof__ (app)) (g_object_ref) (app))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="712"><td class="num" id="LN712">712</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: %s is scheduled to start in %d seconds"</span>, id, delay);</td></tr> +<tr class="codeline" data-linenumber="713"><td class="num" id="LN713">713</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="714"><td class="num" id="LN714">714</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="715"><td class="num" id="LN715">715</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="716"><td class="num" id="LN716">716</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="717"><td class="num" id="LN717">717</td><td class="line"> res = gsm_app_start (app, &error);</td></tr> +<tr class="codeline" data-linenumber="718"><td class="num" id="LN718">718</td><td class="line"> <span class='keyword'>if</span> (!res) {</td></tr> +<tr class="codeline" data-linenumber="719"><td class="num" id="LN719">719</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="720"><td class="num" id="LN720">720</td><td class="line"> g_warning (<span class='string_literal'>"Could not launch application '%s': %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="721"><td class="num" id="LN721">721</td><td class="line"> gsm_app_peek_app_id (app),</td></tr> +<tr class="codeline" data-linenumber="722"><td class="num" id="LN722">722</td><td class="line"> error->message);</td></tr> +<tr class="codeline" data-linenumber="723"><td class="num" id="LN723">723</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="724"><td class="num" id="LN724">724</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="725"><td class="num" id="LN725">725</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="726"><td class="num" id="LN726">726</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="727"><td class="num" id="LN727">727</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="728"><td class="num" id="LN728">728</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="729"><td class="num" id="LN729">729</td><td class="line"> <span class='keyword'>if</span> (priv->phase < GSM_MANAGER_PHASE_APPLICATION) {</td></tr> +<tr class="codeline" data-linenumber="730"><td class="num" id="LN730">730</td><td class="line"> <span class='macro'>g_signal_connect (app,<span class='macro_popup'>g_signal_connect_data ((app), ("exited"), (((GCallback) (app_registered<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="731"><td class="num" id="LN731">731</td><td class="line"> <span class='string_literal'><span class='macro'>"exited"</span>,<span class='macro_popup'>g_signal_connect_data ((app), ("exited"), (((GCallback) (app_registered<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="732"><td class="num" id="LN732">732</td><td class="line"> <span class='macro'>G_CALLBACK (app_registered),<span class='macro_popup'>g_signal_connect_data ((app), ("exited"), (((GCallback) (app_registered<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="733"><td class="num" id="LN733">733</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((app), ("exited"), (((GCallback) (app_registered<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="734"><td class="num" id="LN734">734</td><td class="line"> <span class='macro'>g_signal_connect (app,<span class='macro_popup'>g_signal_connect_data ((app), ("registered"), (((GCallback) (<br>app_registered))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="735"><td class="num" id="LN735">735</td><td class="line"> <span class='string_literal'><span class='macro'>"registered"</span>,<span class='macro_popup'>g_signal_connect_data ((app), ("registered"), (((GCallback) (<br>app_registered))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="736"><td class="num" id="LN736">736</td><td class="line"> <span class='macro'>G_CALLBACK (app_registered),<span class='macro_popup'>g_signal_connect_data ((app), ("registered"), (((GCallback) (<br>app_registered))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="737"><td class="num" id="LN737">737</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((app), ("registered"), (((GCallback) (<br>app_registered))), (manager), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="738"><td class="num" id="LN738">738</td><td class="line"> priv->pending_apps = g_slist_prepend (priv->pending_apps, app);</td></tr> +<tr class="codeline" data-linenumber="739"><td class="num" id="LN739">739</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="740"><td class="num" id="LN740">740</td><td class="line"> out:</td></tr> +<tr class="codeline" data-linenumber="741"><td class="num" id="LN741">741</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="742"><td class="num" id="LN742">742</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="743"><td class="num" id="LN743">743</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="744"><td class="num" id="LN744">744</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="745"><td class="num" id="LN745">745</td><td class="line">do_phase_startup (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="746"><td class="num" id="LN746">746</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="747"><td class="num" id="LN747">747</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="748"><td class="num" id="LN748">748</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="749"><td class="num" id="LN749">749</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="750"><td class="num" id="LN750">750</td><td class="line"> gsm_store_foreach (priv->apps,</td></tr> +<tr class="codeline" data-linenumber="751"><td class="num" id="LN751">751</td><td class="line"> (GsmStoreFunc)_start_app,</td></tr> +<tr class="codeline" data-linenumber="752"><td class="num" id="LN752">752</td><td class="line"> manager);</td></tr> +<tr class="codeline" data-linenumber="753"><td class="num" id="LN753">753</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="754"><td class="num" id="LN754">754</td><td class="line"> <span class='keyword'>if</span> (priv->pending_apps != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="755"><td class="num" id="LN755">755</td><td class="line"> <span class='keyword'>if</span> (priv->phase < GSM_MANAGER_PHASE_APPLICATION) {</td></tr> +<tr class="codeline" data-linenumber="756"><td class="num" id="LN756">756</td><td class="line"> priv->phase_timeout_id = g_timeout_add_seconds (<span class='macro'>GSM_MANAGER_PHASE_TIMEOUT<span class='macro_popup'>30</span></span>,</td></tr> +<tr class="codeline" data-linenumber="757"><td class="num" id="LN757">757</td><td class="line"> (GSourceFunc)on_phase_timeout,</td></tr> +<tr class="codeline" data-linenumber="758"><td class="num" id="LN758">758</td><td class="line"> manager);</td></tr> +<tr class="codeline" data-linenumber="759"><td class="num" id="LN759">759</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="760"><td class="num" id="LN760">760</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="761"><td class="num" id="LN761">761</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="762"><td class="num" id="LN762">762</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="763"><td class="num" id="LN763">763</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="764"><td class="num" id="LN764">764</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="765"><td class="num" id="LN765">765</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span> {</td></tr> +<tr class="codeline" data-linenumber="766"><td class="num" id="LN766">766</td><td class="line"> GsmManager *manager;</td></tr> +<tr class="codeline" data-linenumber="767"><td class="num" id="LN767">767</td><td class="line"> guint flags;</td></tr> +<tr class="codeline" data-linenumber="768"><td class="num" id="LN768">768</td><td class="line">} ClientEndSessionData;</td></tr> +<tr class="codeline" data-linenumber="769"><td class="num" id="LN769">769</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="770"><td class="num" id="LN770">770</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="771"><td class="num" id="LN771">771</td><td class="line">_client_end_session (GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="772"><td class="num" id="LN772">772</td><td class="line"> ClientEndSessionData *data)</td></tr> +<tr class="codeline" data-linenumber="773"><td class="num" id="LN773">773</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="774"><td class="num" id="LN774">774</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="775"><td class="num" id="LN775">775</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="776"><td class="num" id="LN776">776</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="777"><td class="num" id="LN777">777</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="778"><td class="num" id="LN778">778</td><td class="line"> priv = gsm_manager_get_instance_private (data->manager);</td></tr> +<tr class="codeline" data-linenumber="779"><td class="num" id="LN779">779</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="780"><td class="num" id="LN780">780</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="781"><td class="num" id="LN781">781</td><td class="line"> ret = gsm_client_end_session (client, data->flags, &error);</td></tr> +<tr class="codeline" data-linenumber="782"><td class="num" id="LN782">782</td><td class="line"> <span class='keyword'>if</span> (! ret) {</td></tr> +<tr class="codeline" data-linenumber="783"><td class="num" id="LN783">783</td><td class="line"> g_warning (<span class='string_literal'>"Unable to query client: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="784"><td class="num" id="LN784">784</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="785"><td class="num" id="LN785">785</td><td class="line"> <span class='comment'>/* FIXME: what should we do if we can't communicate with client? */</span></td></tr> +<tr class="codeline" data-linenumber="786"><td class="num" id="LN786">786</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="787"><td class="num" id="LN787">787</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: adding client to end-session clients: %s"</span>, gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="788"><td class="num" id="LN788">788</td><td class="line"> priv->query_clients = g_slist_prepend (priv->query_clients,</td></tr> +<tr class="codeline" data-linenumber="789"><td class="num" id="LN789">789</td><td class="line"> client);</td></tr> +<tr class="codeline" data-linenumber="790"><td class="num" id="LN790">790</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="791"><td class="num" id="LN791">791</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="792"><td class="num" id="LN792">792</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="793"><td class="num" id="LN793">793</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="794"><td class="num" id="LN794">794</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="795"><td class="num" id="LN795">795</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="796"><td class="num" id="LN796">796</td><td class="line">_client_end_session_helper (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="797"><td class="num" id="LN797">797</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="798"><td class="num" id="LN798">798</td><td class="line"> ClientEndSessionData *data)</td></tr> +<tr class="codeline" data-linenumber="799"><td class="num" id="LN799">799</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="800"><td class="num" id="LN800">800</td><td class="line"> <span class='keyword'>return</span> _client_end_session (client, data);</td></tr> +<tr class="codeline" data-linenumber="801"><td class="num" id="LN801">801</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="802"><td class="num" id="LN802">802</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="803"><td class="num" id="LN803">803</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="804"><td class="num" id="LN804">804</td><td class="line">do_phase_end_session (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="805"><td class="num" id="LN805">805</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="806"><td class="num" id="LN806">806</td><td class="line"> ClientEndSessionData data;</td></tr> +<tr class="codeline" data-linenumber="807"><td class="num" id="LN807">807</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="808"><td class="num" id="LN808">808</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="809"><td class="num" id="LN809">809</td><td class="line"> data.manager = manager;</td></tr> +<tr class="codeline" data-linenumber="810"><td class="num" id="LN810">810</td><td class="line"> data.flags = 0;</td></tr> +<tr class="codeline" data-linenumber="811"><td class="num" id="LN811">811</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="812"><td class="num" id="LN812">812</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="813"><td class="num" id="LN813">813</td><td class="line"> <span class='keyword'>if</span> (priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_FORCE) {</td></tr> +<tr class="codeline" data-linenumber="814"><td class="num" id="LN814">814</td><td class="line"> data.flags |= GSM_CLIENT_END_SESSION_FLAG_FORCEFUL;</td></tr> +<tr class="codeline" data-linenumber="815"><td class="num" id="LN815">815</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="816"><td class="num" id="LN816">816</td><td class="line"> <span class='keyword'>if</span> (auto_save_is_enabled (manager)) {</td></tr> +<tr class="codeline" data-linenumber="817"><td class="num" id="LN817">817</td><td class="line"> data.flags |= GSM_CLIENT_END_SESSION_FLAG_SAVE;</td></tr> +<tr class="codeline" data-linenumber="818"><td class="num" id="LN818">818</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="819"><td class="num" id="LN819">819</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="820"><td class="num" id="LN820">820</td><td class="line"> <span class='keyword'>if</span> (priv->phase_timeout_id > 0) {</td></tr> +<tr class="codeline" data-linenumber="821"><td class="num" id="LN821">821</td><td class="line"> g_source_remove (priv->phase_timeout_id);</td></tr> +<tr class="codeline" data-linenumber="822"><td class="num" id="LN822">822</td><td class="line"> priv->phase_timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="823"><td class="num" id="LN823">823</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="824"><td class="num" id="LN824">824</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="825"><td class="num" id="LN825">825</td><td class="line"> <span class='keyword'>if</span> (gsm_store_size (priv->clients) > 0) {</td></tr> +<tr class="codeline" data-linenumber="826"><td class="num" id="LN826">826</td><td class="line"> priv->phase_timeout_id = g_timeout_add_seconds (<span class='macro'>GSM_MANAGER_PHASE_TIMEOUT<span class='macro_popup'>30</span></span>,</td></tr> +<tr class="codeline" data-linenumber="827"><td class="num" id="LN827">827</td><td class="line"> (GSourceFunc)on_phase_timeout,</td></tr> +<tr class="codeline" data-linenumber="828"><td class="num" id="LN828">828</td><td class="line"> manager);</td></tr> +<tr class="codeline" data-linenumber="829"><td class="num" id="LN829">829</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="830"><td class="num" id="LN830">830</td><td class="line"> gsm_store_foreach (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="831"><td class="num" id="LN831">831</td><td class="line"> (GsmStoreFunc)_client_end_session_helper,</td></tr> +<tr class="codeline" data-linenumber="832"><td class="num" id="LN832">832</td><td class="line"> &data);</td></tr> +<tr class="codeline" data-linenumber="833"><td class="num" id="LN833">833</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="834"><td class="num" id="LN834">834</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="835"><td class="num" id="LN835">835</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="836"><td class="num" id="LN836">836</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="837"><td class="num" id="LN837">837</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="838"><td class="num" id="LN838">838</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="839"><td class="num" id="LN839">839</td><td class="line">do_phase_end_session_part_2 (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="840"><td class="num" id="LN840">840</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="841"><td class="num" id="LN841">841</td><td class="line"> ClientEndSessionData data;</td></tr> +<tr class="codeline" data-linenumber="842"><td class="num" id="LN842">842</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="843"><td class="num" id="LN843">843</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="844"><td class="num" id="LN844">844</td><td class="line"> data.manager = manager;</td></tr> +<tr class="codeline" data-linenumber="845"><td class="num" id="LN845">845</td><td class="line"> data.flags = 0;</td></tr> +<tr class="codeline" data-linenumber="846"><td class="num" id="LN846">846</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="847"><td class="num" id="LN847">847</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="848"><td class="num" id="LN848">848</td><td class="line"> <span class='keyword'>if</span> (priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_FORCE) {</td></tr> +<tr class="codeline" data-linenumber="849"><td class="num" id="LN849">849</td><td class="line"> data.flags |= GSM_CLIENT_END_SESSION_FLAG_FORCEFUL;</td></tr> +<tr class="codeline" data-linenumber="850"><td class="num" id="LN850">850</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="851"><td class="num" id="LN851">851</td><td class="line"> <span class='keyword'>if</span> (auto_save_is_enabled (manager)) {</td></tr> +<tr class="codeline" data-linenumber="852"><td class="num" id="LN852">852</td><td class="line"> data.flags |= GSM_CLIENT_END_SESSION_FLAG_SAVE;</td></tr> +<tr class="codeline" data-linenumber="853"><td class="num" id="LN853">853</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="854"><td class="num" id="LN854">854</td><td class="line"> data.flags |= GSM_CLIENT_END_SESSION_FLAG_LAST;</td></tr> +<tr class="codeline" data-linenumber="855"><td class="num" id="LN855">855</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="856"><td class="num" id="LN856">856</td><td class="line"> <span class='comment'>/* keep the timeout that was started at the beginning of the</span></td></tr> +<tr class="codeline" data-linenumber="857"><td class="num" id="LN857">857</td><td class="line"> <span class='comment'>* GSM_MANAGER_PHASE_END_SESSION phase */</span></td></tr> +<tr class="codeline" data-linenumber="858"><td class="num" id="LN858">858</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="859"><td class="num" id="LN859">859</td><td class="line"> <span class='keyword'>if</span> (g_slist_length (priv->next_query_clients) > 0) {</td></tr> +<tr class="codeline" data-linenumber="860"><td class="num" id="LN860">860</td><td class="line"> g_slist_foreach (priv->next_query_clients,</td></tr> +<tr class="codeline" data-linenumber="861"><td class="num" id="LN861">861</td><td class="line"> (GFunc)_client_end_session,</td></tr> +<tr class="codeline" data-linenumber="862"><td class="num" id="LN862">862</td><td class="line"> &data);</td></tr> +<tr class="codeline" data-linenumber="863"><td class="num" id="LN863">863</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="864"><td class="num" id="LN864">864</td><td class="line"> g_slist_free (priv->next_query_clients);</td></tr> +<tr class="codeline" data-linenumber="865"><td class="num" id="LN865">865</td><td class="line"> priv->next_query_clients = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="866"><td class="num" id="LN866">866</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="867"><td class="num" id="LN867">867</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="868"><td class="num" id="LN868">868</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="869"><td class="num" id="LN869">869</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="870"><td class="num" id="LN870">870</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="871"><td class="num" id="LN871">871</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="872"><td class="num" id="LN872">872</td><td class="line">_client_stop (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="873"><td class="num" id="LN873">873</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="874"><td class="num" id="LN874">874</td><td class="line"> gpointer user_data)</td></tr> +<tr class="codeline" data-linenumber="875"><td class="num" id="LN875">875</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="876"><td class="num" id="LN876">876</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="877"><td class="num" id="LN877">877</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="878"><td class="num" id="LN878">878</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="879"><td class="num" id="LN879">879</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="880"><td class="num" id="LN880">880</td><td class="line"> ret = gsm_client_stop (client, &error);</td></tr> +<tr class="codeline" data-linenumber="881"><td class="num" id="LN881">881</td><td class="line"> <span class='keyword'>if</span> (! ret) {</td></tr> +<tr class="codeline" data-linenumber="882"><td class="num" id="LN882">882</td><td class="line"> g_warning (<span class='string_literal'>"Unable to stop client: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="883"><td class="num" id="LN883">883</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="884"><td class="num" id="LN884">884</td><td class="line"> <span class='comment'>/* FIXME: what should we do if we can't communicate with client? */</span></td></tr> +<tr class="codeline" data-linenumber="885"><td class="num" id="LN885">885</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="886"><td class="num" id="LN886">886</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: stopped client: %s"</span>, gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="887"><td class="num" id="LN887">887</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="888"><td class="num" id="LN888">888</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="889"><td class="num" id="LN889">889</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="890"><td class="num" id="LN890">890</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="891"><td class="num" id="LN891">891</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="892"><td class="num" id="LN892">892</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="893"><td class="num" id="LN893">893</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="894"><td class="num" id="LN894">894</td><td class="line">maybe_restart_user_bus (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="895"><td class="num" id="LN895">895</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="896"><td class="num" id="LN896">896</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="897"><td class="num" id="LN897">897</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="898"><td class="num" id="LN898">898</td><td class="line"> GDBusConnection *connection;</td></tr> +<tr class="codeline" data-linenumber="899"><td class="num" id="LN899">899</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="900"><td class="num" id="LN900">900</td><td class="line"> <span class='macro'>g_autoptr(GVariant)<span class='macro_popup'>__attribute__((cleanup(glib_autoptr_cleanup_GVariant))) GVariant_autoptr</span></span> reply = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="901"><td class="num" id="LN901">901</td><td class="line"> <span class='macro'>g_autoptr(GError)<span class='macro_popup'>__attribute__((cleanup(glib_autoptr_cleanup_GError))) GError_autoptr</span></span> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="902"><td class="num" id="LN902">902</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="903"><td class="num" id="LN903">903</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="904"><td class="num" id="LN904">904</td><td class="line"> <span class='keyword'>if</span> (priv->dbus_disconnected)</td></tr> +<tr class="codeline" data-linenumber="905"><td class="num" id="LN905">905</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="906"><td class="num" id="LN906">906</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="907"><td class="num" id="LN907">907</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="908"><td class="num" id="LN908">908</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="909"><td class="num" id="LN909">909</td><td class="line"> <span class='keyword'>if</span> (!gsm_systemd_is_last_session_for_user (systemd))</td></tr> +<tr class="codeline" data-linenumber="910"><td class="num" id="LN910">910</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="911"><td class="num" id="LN911">911</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="912"><td class="num" id="LN912">912</td><td class="line"> connection = g_bus_get_sync (G_BUS_TYPE_SESSION, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &error);</td></tr> +<tr class="codeline" data-linenumber="913"><td class="num" id="LN913">913</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="914"><td class="num" id="LN914">914</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="915"><td class="num" id="LN915">915</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: failed to connect to session bus: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="916"><td class="num" id="LN916">916</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="917"><td class="num" id="LN917">917</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="918"><td class="num" id="LN918">918</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="919"><td class="num" id="LN919">919</td><td class="line"> reply = <span class="mrange">g_dbus_connection_call_sync (connection,</td></tr></span> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:9ex">Value stored to 'reply' is never read</div></td></tr> +<tr class="codeline" data-linenumber="920"><td class="num" id="LN920">920</td><td class="line"> <span class="mrange"><span class='string_literal'>"org.freedesktop.systemd1"</span>,</td></tr></span> +<tr class="codeline" data-linenumber="921"><td class="num" id="LN921">921</td><td class="line"> <span class="mrange"><span class='string_literal'>"/org/freedesktop/systemd1"</span>,</td></tr></span> +<tr class="codeline" data-linenumber="922"><td class="num" id="LN922">922</td><td class="line"> <span class="mrange"><span class='string_literal'>"org.freedesktop.systemd1.Manager"</span>,</td></tr></span> +<tr class="codeline" data-linenumber="923"><td class="num" id="LN923">923</td><td class="line"> <span class="mrange"><span class='string_literal'>"TryRestartUnit"</span>,</td></tr></span> +<tr class="codeline" data-linenumber="924"><td class="num" id="LN924">924</td><td class="line"> <span class="mrange">g_variant_new (<span class='string_literal'>"(ss)"</span>, <span class='string_literal'>"dbus.service"</span>, <span class='string_literal'>"replace"</span>),</td></tr></span> +<tr class="codeline" data-linenumber="925"><td class="num" id="LN925">925</td><td class="line"> <span class="mrange"><span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr></span> +<tr class="codeline" data-linenumber="926"><td class="num" id="LN926">926</td><td class="line"> <span class="mrange">G_DBUS_CALL_FLAGS_NONE,</td></tr></span> +<tr class="codeline" data-linenumber="927"><td class="num" id="LN927">927</td><td class="line"> <span class="mrange">-1,</td></tr></span> +<tr class="codeline" data-linenumber="928"><td class="num" id="LN928">928</td><td class="line"> <span class="mrange"><span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr></span> +<tr class="codeline" data-linenumber="929"><td class="num" id="LN929">929</td><td class="line"> <span class="mrange">&error)</span>;</td></tr> +<tr class="codeline" data-linenumber="930"><td class="num" id="LN930">930</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="931"><td class="num" id="LN931">931</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="932"><td class="num" id="LN932">932</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: reloading user bus failed: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="933"><td class="num" id="LN933">933</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="934"><td class="num" id="LN934">934</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="935"><td class="num" id="LN935">935</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="936"><td class="num" id="LN936">936</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="937"><td class="num" id="LN937">937</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="938"><td class="num" id="LN938">938</td><td class="line">do_phase_exit (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="939"><td class="num" id="LN939">939</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="940"><td class="num" id="LN940">940</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="941"><td class="num" id="LN941">941</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="942"><td class="num" id="LN942">942</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="943"><td class="num" id="LN943">943</td><td class="line"> <span class='keyword'>if</span> (gsm_store_size (priv->clients) > 0) {</td></tr> +<tr class="codeline" data-linenumber="944"><td class="num" id="LN944">944</td><td class="line"> gsm_store_foreach (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="945"><td class="num" id="LN945">945</td><td class="line"> (GsmStoreFunc)_client_stop,</td></tr> +<tr class="codeline" data-linenumber="946"><td class="num" id="LN946">946</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="947"><td class="num" id="LN947">947</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="948"><td class="num" id="LN948">948</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="949"><td class="num" id="LN949">949</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="950"><td class="num" id="LN950">950</td><td class="line"> maybe_restart_user_bus (manager);</td></tr> +<tr class="codeline" data-linenumber="951"><td class="num" id="LN951">951</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="952"><td class="num" id="LN952">952</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="953"><td class="num" id="LN953">953</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="954"><td class="num" id="LN954">954</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="955"><td class="num" id="LN955">955</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="956"><td class="num" id="LN956">956</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="957"><td class="num" id="LN957">957</td><td class="line">_client_query_end_session (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="958"><td class="num" id="LN958">958</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="959"><td class="num" id="LN959">959</td><td class="line"> ClientEndSessionData *data)</td></tr> +<tr class="codeline" data-linenumber="960"><td class="num" id="LN960">960</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="961"><td class="num" id="LN961">961</td><td class="line"> gboolean ret;</td></tr> +<tr class="codeline" data-linenumber="962"><td class="num" id="LN962">962</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="963"><td class="num" id="LN963">963</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="964"><td class="num" id="LN964">964</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="965"><td class="num" id="LN965">965</td><td class="line"> priv = gsm_manager_get_instance_private (data->manager);</td></tr> +<tr class="codeline" data-linenumber="966"><td class="num" id="LN966">966</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="967"><td class="num" id="LN967">967</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="968"><td class="num" id="LN968">968</td><td class="line"> ret = gsm_client_query_end_session (client, data->flags, &error);</td></tr> +<tr class="codeline" data-linenumber="969"><td class="num" id="LN969">969</td><td class="line"> <span class='keyword'>if</span> (! ret) {</td></tr> +<tr class="codeline" data-linenumber="970"><td class="num" id="LN970">970</td><td class="line"> g_warning (<span class='string_literal'>"Unable to query client: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="971"><td class="num" id="LN971">971</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="972"><td class="num" id="LN972">972</td><td class="line"> <span class='comment'>/* FIXME: what should we do if we can't communicate with client? */</span></td></tr> +<tr class="codeline" data-linenumber="973"><td class="num" id="LN973">973</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="974"><td class="num" id="LN974">974</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: adding client to query clients: %s"</span>, gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="975"><td class="num" id="LN975">975</td><td class="line"> priv->query_clients = g_slist_prepend (priv->query_clients, client);</td></tr> +<tr class="codeline" data-linenumber="976"><td class="num" id="LN976">976</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="977"><td class="num" id="LN977">977</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="978"><td class="num" id="LN978">978</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="979"><td class="num" id="LN979">979</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="980"><td class="num" id="LN980">980</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="981"><td class="num" id="LN981">981</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="982"><td class="num" id="LN982">982</td><td class="line">inhibitor_has_flag (gpointer key,</td></tr> +<tr class="codeline" data-linenumber="983"><td class="num" id="LN983">983</td><td class="line"> GsmInhibitor *inhibitor,</td></tr> +<tr class="codeline" data-linenumber="984"><td class="num" id="LN984">984</td><td class="line"> gpointer data)</td></tr> +<tr class="codeline" data-linenumber="985"><td class="num" id="LN985">985</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="986"><td class="num" id="LN986">986</td><td class="line"> guint flag;</td></tr> +<tr class="codeline" data-linenumber="987"><td class="num" id="LN987">987</td><td class="line"> guint flags;</td></tr> +<tr class="codeline" data-linenumber="988"><td class="num" id="LN988">988</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="989"><td class="num" id="LN989">989</td><td class="line"> flag = <span class='macro'>GPOINTER_TO_UINT (data)<span class='macro_popup'>((guint) (gulong) (data))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="990"><td class="num" id="LN990">990</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="991"><td class="num" id="LN991">991</td><td class="line"> flags = gsm_inhibitor_peek_flags (inhibitor);</td></tr> +<tr class="codeline" data-linenumber="992"><td class="num" id="LN992">992</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="993"><td class="num" id="LN993">993</td><td class="line"> <span class='keyword'>return</span> (flags & flag);</td></tr> +<tr class="codeline" data-linenumber="994"><td class="num" id="LN994">994</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="995"><td class="num" id="LN995">995</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="996"><td class="num" id="LN996">996</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="997"><td class="num" id="LN997">997</td><td class="line">gsm_manager_is_logout_inhibited (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="998"><td class="num" id="LN998">998</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="999"><td class="num" id="LN999">999</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="1000"><td class="num" id="LN1000">1000</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1001"><td class="num" id="LN1001">1001</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1002"><td class="num" id="LN1002">1002</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1003"><td class="num" id="LN1003">1003</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1004"><td class="num" id="LN1004">1004</td><td class="line"> <span class='keyword'>if</span> (priv->inhibitors == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1005"><td class="num" id="LN1005">1005</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1006"><td class="num" id="LN1006">1006</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1007"><td class="num" id="LN1007">1007</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1008"><td class="num" id="LN1008">1008</td><td class="line"> inhibitor = (GsmInhibitor *)gsm_store_find (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="1009"><td class="num" id="LN1009">1009</td><td class="line"> (GsmStoreFunc)inhibitor_has_flag,</td></tr> +<tr class="codeline" data-linenumber="1010"><td class="num" id="LN1010">1010</td><td class="line"> <span class='macro'>GUINT_TO_POINTER (GSM_INHIBITOR_FLAG_LOGOUT)<span class='macro_popup'>((gpointer) (gulong) (GSM_INHIBITOR_FLAG_LOGOUT))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1011"><td class="num" id="LN1011">1011</td><td class="line"> <span class='keyword'>if</span> (inhibitor == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1012"><td class="num" id="LN1012">1012</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1013"><td class="num" id="LN1013">1013</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1014"><td class="num" id="LN1014">1014</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1015"><td class="num" id="LN1015">1015</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1016"><td class="num" id="LN1016">1016</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1017"><td class="num" id="LN1017">1017</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1018"><td class="num" id="LN1018">1018</td><td class="line">gsm_manager_is_idle_inhibited (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1019"><td class="num" id="LN1019">1019</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1020"><td class="num" id="LN1020">1020</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="1021"><td class="num" id="LN1021">1021</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1022"><td class="num" id="LN1022">1022</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1023"><td class="num" id="LN1023">1023</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1024"><td class="num" id="LN1024">1024</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1025"><td class="num" id="LN1025">1025</td><td class="line"> <span class='keyword'>if</span> (priv->inhibitors == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1026"><td class="num" id="LN1026">1026</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1027"><td class="num" id="LN1027">1027</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1028"><td class="num" id="LN1028">1028</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1029"><td class="num" id="LN1029">1029</td><td class="line"> inhibitor = (GsmInhibitor *)gsm_store_find (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="1030"><td class="num" id="LN1030">1030</td><td class="line"> (GsmStoreFunc)inhibitor_has_flag,</td></tr> +<tr class="codeline" data-linenumber="1031"><td class="num" id="LN1031">1031</td><td class="line"> <span class='macro'>GUINT_TO_POINTER (GSM_INHIBITOR_FLAG_IDLE)<span class='macro_popup'>((gpointer) (gulong) (GSM_INHIBITOR_FLAG_IDLE))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1032"><td class="num" id="LN1032">1032</td><td class="line"> <span class='keyword'>if</span> (inhibitor == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1033"><td class="num" id="LN1033">1033</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1034"><td class="num" id="LN1034">1034</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1035"><td class="num" id="LN1035">1035</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1036"><td class="num" id="LN1036">1036</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1037"><td class="num" id="LN1037">1037</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1038"><td class="num" id="LN1038">1038</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1039"><td class="num" id="LN1039">1039</td><td class="line">_client_cancel_end_session (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="1040"><td class="num" id="LN1040">1040</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="1041"><td class="num" id="LN1041">1041</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1042"><td class="num" id="LN1042">1042</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1043"><td class="num" id="LN1043">1043</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="1044"><td class="num" id="LN1044">1044</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="1045"><td class="num" id="LN1045">1045</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1046"><td class="num" id="LN1046">1046</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1047"><td class="num" id="LN1047">1047</td><td class="line"> res = gsm_client_cancel_end_session (client, &error);</td></tr> +<tr class="codeline" data-linenumber="1048"><td class="num" id="LN1048">1048</td><td class="line"> <span class='keyword'>if</span> (! res) {</td></tr> +<tr class="codeline" data-linenumber="1049"><td class="num" id="LN1049">1049</td><td class="line"> g_warning (<span class='string_literal'>"Unable to cancel end session: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="1050"><td class="num" id="LN1050">1050</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="1051"><td class="num" id="LN1051">1051</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1052"><td class="num" id="LN1052">1052</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1053"><td class="num" id="LN1053">1053</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1054"><td class="num" id="LN1054">1054</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1055"><td class="num" id="LN1055">1055</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1056"><td class="num" id="LN1056">1056</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1057"><td class="num" id="LN1057">1057</td><td class="line">inhibitor_is_jit (gpointer key,</td></tr> +<tr class="codeline" data-linenumber="1058"><td class="num" id="LN1058">1058</td><td class="line"> GsmInhibitor *inhibitor,</td></tr> +<tr class="codeline" data-linenumber="1059"><td class="num" id="LN1059">1059</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1060"><td class="num" id="LN1060">1060</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1061"><td class="num" id="LN1061">1061</td><td class="line"> gboolean matches;</td></tr> +<tr class="codeline" data-linenumber="1062"><td class="num" id="LN1062">1062</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *id;</td></tr> +<tr class="codeline" data-linenumber="1063"><td class="num" id="LN1063">1063</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1064"><td class="num" id="LN1064">1064</td><td class="line"> id = gsm_inhibitor_peek_client_id (inhibitor);</td></tr> +<tr class="codeline" data-linenumber="1065"><td class="num" id="LN1065">1065</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1066"><td class="num" id="LN1066">1066</td><td class="line"> matches = (id != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> && id[0] != '\0');</td></tr> +<tr class="codeline" data-linenumber="1067"><td class="num" id="LN1067">1067</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1068"><td class="num" id="LN1068">1068</td><td class="line"> <span class='keyword'>return</span> matches;</td></tr> +<tr class="codeline" data-linenumber="1069"><td class="num" id="LN1069">1069</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1070"><td class="num" id="LN1070">1070</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1071"><td class="num" id="LN1071">1071</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1072"><td class="num" id="LN1072">1072</td><td class="line">cancel_end_session (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1073"><td class="num" id="LN1073">1073</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1074"><td class="num" id="LN1074">1074</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1075"><td class="num" id="LN1075">1075</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1076"><td class="num" id="LN1076">1076</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1077"><td class="num" id="LN1077">1077</td><td class="line"> <span class='comment'>/* just ignore if received outside of shutdown */</span></td></tr> +<tr class="codeline" data-linenumber="1078"><td class="num" id="LN1078">1078</td><td class="line"> <span class='keyword'>if</span> (priv->phase < GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="1079"><td class="num" id="LN1079">1079</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1080"><td class="num" id="LN1080">1080</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1081"><td class="num" id="LN1081">1081</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1082"><td class="num" id="LN1082">1082</td><td class="line"> <span class='comment'>/* switch back to running phase */</span></td></tr> +<tr class="codeline" data-linenumber="1083"><td class="num" id="LN1083">1083</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Cancelling the end of session"</span>);</td></tr> +<tr class="codeline" data-linenumber="1084"><td class="num" id="LN1084">1084</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1085"><td class="num" id="LN1085">1085</td><td class="line"> <span class='comment'>/* remove the dialog before we remove the inhibitors, else the dialog</span></td></tr> +<tr class="codeline" data-linenumber="1086"><td class="num" id="LN1086">1086</td><td class="line"> <span class='comment'>* will activate itself automatically when the last inhibitor will be</span></td></tr> +<tr class="codeline" data-linenumber="1087"><td class="num" id="LN1087">1087</td><td class="line"> <span class='comment'>* removed */</span></td></tr> +<tr class="codeline" data-linenumber="1088"><td class="num" id="LN1088">1088</td><td class="line"> <span class='keyword'>if</span> (priv->inhibit_dialog)</td></tr> +<tr class="codeline" data-linenumber="1089"><td class="num" id="LN1089">1089</td><td class="line"> gtk_widget_destroy (<span class='macro'>GTK_WIDGET (priv->inhibit_dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((priv->inhibit_dialog)), ((gtk_widget_get_type ())))))<br>)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1090"><td class="num" id="LN1090">1090</td><td class="line"> priv->inhibit_dialog = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1091"><td class="num" id="LN1091">1091</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1092"><td class="num" id="LN1092">1092</td><td class="line"> <span class='comment'>/* clear all JIT inhibitors */</span></td></tr> +<tr class="codeline" data-linenumber="1093"><td class="num" id="LN1093">1093</td><td class="line"> gsm_store_foreach_remove (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="1094"><td class="num" id="LN1094">1094</td><td class="line"> (GsmStoreFunc)inhibitor_is_jit,</td></tr> +<tr class="codeline" data-linenumber="1095"><td class="num" id="LN1095">1095</td><td class="line"> (gpointer)manager);</td></tr> +<tr class="codeline" data-linenumber="1096"><td class="num" id="LN1096">1096</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1097"><td class="num" id="LN1097">1097</td><td class="line"> gsm_store_foreach (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="1098"><td class="num" id="LN1098">1098</td><td class="line"> (GsmStoreFunc)_client_cancel_end_session,</td></tr> +<tr class="codeline" data-linenumber="1099"><td class="num" id="LN1099">1099</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1100"><td class="num" id="LN1100">1100</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1101"><td class="num" id="LN1101">1101</td><td class="line"> gsm_manager_set_phase (manager, GSM_MANAGER_PHASE_RUNNING);</td></tr> +<tr class="codeline" data-linenumber="1102"><td class="num" id="LN1102">1102</td><td class="line"> priv->logout_mode = GSM_MANAGER_LOGOUT_MODE_NORMAL;</td></tr> +<tr class="codeline" data-linenumber="1103"><td class="num" id="LN1103">1103</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1104"><td class="num" id="LN1104">1104</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_NONE;</td></tr> +<tr class="codeline" data-linenumber="1105"><td class="num" id="LN1105">1105</td><td class="line"> mdm_set_logout_action (MDM_LOGOUT_ACTION_NONE);</td></tr> +<tr class="codeline" data-linenumber="1106"><td class="num" id="LN1106">1106</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1107"><td class="num" id="LN1107">1107</td><td class="line"> start_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="1108"><td class="num" id="LN1108">1108</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1109"><td class="num" id="LN1109">1109</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1110"><td class="num" id="LN1110">1110</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1111"><td class="num" id="LN1111">1111</td><td class="line">process_is_running (<span class='keyword'>const</span> <span class='keyword'>char</span> * name)</td></tr> +<tr class="codeline" data-linenumber="1112"><td class="num" id="LN1112">1112</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1113"><td class="num" id="LN1113">1113</td><td class="line"> <span class='keyword'>int</span> num_processes;</td></tr> +<tr class="codeline" data-linenumber="1114"><td class="num" id="LN1114">1114</td><td class="line"> <span class='keyword'>char</span> * command = g_strdup_printf (<span class='string_literal'>"pidof %s | wc -l"</span>, name);</td></tr> +<tr class="codeline" data-linenumber="1115"><td class="num" id="LN1115">1115</td><td class="line"> FILE *fp = popen(command, <span class='string_literal'>"r"</span>);</td></tr> +<tr class="codeline" data-linenumber="1116"><td class="num" id="LN1116">1116</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1117"><td class="num" id="LN1117">1117</td><td class="line"> <span class='keyword'>if</span> (fscanf(fp, <span class='string_literal'>"%d"</span>, &num_processes) != 1)</td></tr> +<tr class="codeline" data-linenumber="1118"><td class="num" id="LN1118">1118</td><td class="line"> num_processes = 0;</td></tr> +<tr class="codeline" data-linenumber="1119"><td class="num" id="LN1119">1119</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1120"><td class="num" id="LN1120">1120</td><td class="line"> pclose(fp);</td></tr> +<tr class="codeline" data-linenumber="1121"><td class="num" id="LN1121">1121</td><td class="line"> g_free (command);</td></tr> +<tr class="codeline" data-linenumber="1122"><td class="num" id="LN1122">1122</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1123"><td class="num" id="LN1123">1123</td><td class="line"> <span class='keyword'>if</span> (num_processes > 0) {</td></tr> +<tr class="codeline" data-linenumber="1124"><td class="num" id="LN1124">1124</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1125"><td class="num" id="LN1125">1125</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1126"><td class="num" id="LN1126">1126</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1127"><td class="num" id="LN1127">1127</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1128"><td class="num" id="LN1128">1128</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1129"><td class="num" id="LN1129">1129</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1130"><td class="num" id="LN1130">1130</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1131"><td class="num" id="LN1131">1131</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1132"><td class="num" id="LN1132">1132</td><td class="line">manager_switch_user (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1133"><td class="num" id="LN1133">1133</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1134"><td class="num" id="LN1134">1134</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="1135"><td class="num" id="LN1135">1135</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="1136"><td class="num" id="LN1136">1136</td><td class="line"> <span class='keyword'>char</span> *command;</td></tr> +<tr class="codeline" data-linenumber="1137"><td class="num" id="LN1137">1137</td><td class="line"> <span class='keyword'>const</span> gchar *xdg_seat_path = g_getenv (<span class='string_literal'>"XDG_SEAT_PATH"</span>);</td></tr> +<tr class="codeline" data-linenumber="1138"><td class="num" id="LN1138">1138</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1139"><td class="num" id="LN1139">1139</td><td class="line"> <span class='comment'>/* We have to do this here and in request_switch_user() because this</span></td></tr> +<tr class="codeline" data-linenumber="1140"><td class="num" id="LN1140">1140</td><td class="line"> <span class='comment'>* function can be called at a later time, not just directly after</span></td></tr> +<tr class="codeline" data-linenumber="1141"><td class="num" id="LN1141">1141</td><td class="line"> <span class='comment'>* request_switch_user(). */</span></td></tr> +<tr class="codeline" data-linenumber="1142"><td class="num" id="LN1142">1142</td><td class="line"> <span class='keyword'>if</span> (_switch_user_is_locked_down (manager)) {</td></tr> +<tr class="codeline" data-linenumber="1143"><td class="num" id="LN1143">1143</td><td class="line"> g_warning (<span class='string_literal'>"Unable to switch user: User switching has been locked down"</span>);</td></tr> +<tr class="codeline" data-linenumber="1144"><td class="num" id="LN1144">1144</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1145"><td class="num" id="LN1145">1145</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1146"><td class="num" id="LN1146">1146</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1147"><td class="num" id="LN1147">1147</td><td class="line"> <span class='keyword'>if</span> (process_is_running(<span class='string_literal'>"mdm"</span>)) {</td></tr> +<tr class="codeline" data-linenumber="1148"><td class="num" id="LN1148">1148</td><td class="line"> <span class='comment'>/* MDM */</span></td></tr> +<tr class="codeline" data-linenumber="1149"><td class="num" id="LN1149">1149</td><td class="line"> command = g_strdup_printf (<span class='string_literal'>"%s %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="1150"><td class="num" id="LN1150">1150</td><td class="line"> <span class='macro'>MDM_FLEXISERVER_COMMAND<span class='macro_popup'>"mdmflexiserver"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1151"><td class="num" id="LN1151">1151</td><td class="line"> <span class='macro'>MDM_FLEXISERVER_ARGS<span class='macro_popup'>"--startnew Standard"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1152"><td class="num" id="LN1152">1152</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1153"><td class="num" id="LN1153">1153</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1154"><td class="num" id="LN1154">1154</td><td class="line"> res = g_spawn_command_line_sync (command, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &error);</td></tr> +<tr class="codeline" data-linenumber="1155"><td class="num" id="LN1155">1155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1156"><td class="num" id="LN1156">1156</td><td class="line"> g_free (command);</td></tr> +<tr class="codeline" data-linenumber="1157"><td class="num" id="LN1157">1157</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1158"><td class="num" id="LN1158">1158</td><td class="line"> <span class='keyword'>if</span> (! res) {</td></tr> +<tr class="codeline" data-linenumber="1159"><td class="num" id="LN1159">1159</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Unable to start MDM greeter: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="1160"><td class="num" id="LN1160">1160</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="1161"><td class="num" id="LN1161">1161</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1162"><td class="num" id="LN1162">1162</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1163"><td class="num" id="LN1163">1163</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (process_is_running(<span class='string_literal'>"gdm"</span>) || process_is_running(<span class='string_literal'>"gdm3"</span>) || process_is_running(<span class='string_literal'>"gdm-binary"</span>)) {</td></tr> +<tr class="codeline" data-linenumber="1164"><td class="num" id="LN1164">1164</td><td class="line"> <span class='comment'>/* GDM */</span></td></tr> +<tr class="codeline" data-linenumber="1165"><td class="num" id="LN1165">1165</td><td class="line"> command = g_strdup_printf (<span class='string_literal'>"%s %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="1166"><td class="num" id="LN1166">1166</td><td class="line"> <span class='macro'>GDM_FLEXISERVER_COMMAND<span class='macro_popup'>"gdmflexiserver"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1167"><td class="num" id="LN1167">1167</td><td class="line"> <span class='macro'>GDM_FLEXISERVER_ARGS<span class='macro_popup'>"--startnew Standard"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1168"><td class="num" id="LN1168">1168</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1169"><td class="num" id="LN1169">1169</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1170"><td class="num" id="LN1170">1170</td><td class="line"> res = g_spawn_command_line_sync (command, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &error);</td></tr> +<tr class="codeline" data-linenumber="1171"><td class="num" id="LN1171">1171</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1172"><td class="num" id="LN1172">1172</td><td class="line"> g_free (command);</td></tr> +<tr class="codeline" data-linenumber="1173"><td class="num" id="LN1173">1173</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1174"><td class="num" id="LN1174">1174</td><td class="line"> <span class='keyword'>if</span> (! res) {</td></tr> +<tr class="codeline" data-linenumber="1175"><td class="num" id="LN1175">1175</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Unable to start GDM greeter: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="1176"><td class="num" id="LN1176">1176</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="1177"><td class="num" id="LN1177">1177</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1178"><td class="num" id="LN1178">1178</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1179"><td class="num" id="LN1179">1179</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (xdg_seat_path != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1180"><td class="num" id="LN1180">1180</td><td class="line"> <span class='comment'>/* LightDM */</span></td></tr> +<tr class="codeline" data-linenumber="1181"><td class="num" id="LN1181">1181</td><td class="line"> GDBusProxyFlags flags = G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START;</td></tr> +<tr class="codeline" data-linenumber="1182"><td class="num" id="LN1182">1182</td><td class="line"> GDBusProxy *proxy = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1183"><td class="num" id="LN1183">1183</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1184"><td class="num" id="LN1184">1184</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1185"><td class="num" id="LN1185">1185</td><td class="line"> proxy = g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM,</td></tr> +<tr class="codeline" data-linenumber="1186"><td class="num" id="LN1186">1186</td><td class="line"> flags,</td></tr> +<tr class="codeline" data-linenumber="1187"><td class="num" id="LN1187">1187</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1188"><td class="num" id="LN1188">1188</td><td class="line"> <span class='string_literal'>"org.freedesktop.DisplayManager"</span>,</td></tr> +<tr class="codeline" data-linenumber="1189"><td class="num" id="LN1189">1189</td><td class="line"> xdg_seat_path,</td></tr> +<tr class="codeline" data-linenumber="1190"><td class="num" id="LN1190">1190</td><td class="line"> <span class='string_literal'>"org.freedesktop.DisplayManager.Seat"</span>,</td></tr> +<tr class="codeline" data-linenumber="1191"><td class="num" id="LN1191">1191</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1192"><td class="num" id="LN1192">1192</td><td class="line"> &error);</td></tr> +<tr class="codeline" data-linenumber="1193"><td class="num" id="LN1193">1193</td><td class="line"> <span class='keyword'>if</span> (proxy != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1194"><td class="num" id="LN1194">1194</td><td class="line"> g_dbus_proxy_call_sync (proxy,</td></tr> +<tr class="codeline" data-linenumber="1195"><td class="num" id="LN1195">1195</td><td class="line"> <span class='string_literal'>"SwitchToGreeter"</span>,</td></tr> +<tr class="codeline" data-linenumber="1196"><td class="num" id="LN1196">1196</td><td class="line"> g_variant_new (<span class='string_literal'>"()"</span>),</td></tr> +<tr class="codeline" data-linenumber="1197"><td class="num" id="LN1197">1197</td><td class="line"> G_DBUS_CALL_FLAGS_NONE,</td></tr> +<tr class="codeline" data-linenumber="1198"><td class="num" id="LN1198">1198</td><td class="line"> -1,</td></tr> +<tr class="codeline" data-linenumber="1199"><td class="num" id="LN1199">1199</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1200"><td class="num" id="LN1200">1200</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1201"><td class="num" id="LN1201">1201</td><td class="line"> g_object_unref (proxy);</td></tr> +<tr class="codeline" data-linenumber="1202"><td class="num" id="LN1202">1202</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1203"><td class="num" id="LN1203">1203</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1204"><td class="num" id="LN1204">1204</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Unable to start LightDM greeter: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="1205"><td class="num" id="LN1205">1205</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="1206"><td class="num" id="LN1206">1206</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1207"><td class="num" id="LN1207">1207</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1208"><td class="num" id="LN1208">1208</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1209"><td class="num" id="LN1209">1209</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1210"><td class="num" id="LN1210">1210</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1211"><td class="num" id="LN1211">1211</td><td class="line">sleep_lock_is_enabled (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1212"><td class="num" id="LN1212">1212</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1213"><td class="num" id="LN1213">1213</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1214"><td class="num" id="LN1214">1214</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1215"><td class="num" id="LN1215">1215</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1216"><td class="num" id="LN1216">1216</td><td class="line"> <span class='keyword'>if</span> (priv->settings_screensaver != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="1217"><td class="num" id="LN1217">1217</td><td class="line"> <span class='keyword'>return</span> g_settings_get_boolean (priv->settings_screensaver,</td></tr> +<tr class="codeline" data-linenumber="1218"><td class="num" id="LN1218">1218</td><td class="line"> <span class='macro'>KEY_SLEEP_LOCK<span class='macro_popup'>"lock-enabled"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1219"><td class="num" id="LN1219">1219</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="1220"><td class="num" id="LN1220">1220</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1221"><td class="num" id="LN1221">1221</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1222"><td class="num" id="LN1222">1222</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1223"><td class="num" id="LN1223">1223</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1224"><td class="num" id="LN1224">1224</td><td class="line">manager_perhaps_lock (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1225"><td class="num" id="LN1225">1225</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1226"><td class="num" id="LN1226">1226</td><td class="line"> gchar **screen_locker_command;</td></tr> +<tr class="codeline" data-linenumber="1227"><td class="num" id="LN1227">1227</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1228"><td class="num" id="LN1228">1228</td><td class="line"> <span class='keyword'>if</span> ((screen_locker_command = gsm_get_screen_locker_command ()) != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1229"><td class="num" id="LN1229">1229</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1230"><td class="num" id="LN1230">1230</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1231"><td class="num" id="LN1231">1231</td><td class="line"> <span class='comment'>/* only lock if mate-screensaver is set to lock */</span></td></tr> +<tr class="codeline" data-linenumber="1232"><td class="num" id="LN1232">1232</td><td class="line"> <span class='keyword'>if</span> (!g_strcmp0 (screen_locker_command[0], <span class='string_literal'>"mate-screensaver-command"</span>) &&</td></tr> +<tr class="codeline" data-linenumber="1233"><td class="num" id="LN1233">1233</td><td class="line"> !sleep_lock_is_enabled (manager)) {</td></tr> +<tr class="codeline" data-linenumber="1234"><td class="num" id="LN1234">1234</td><td class="line"> <span class='keyword'>goto</span> clear_screen_locker_command;</td></tr> +<tr class="codeline" data-linenumber="1235"><td class="num" id="LN1235">1235</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1236"><td class="num" id="LN1236">1236</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1237"><td class="num" id="LN1237">1237</td><td class="line"> <span class='comment'>/* do this sync to ensure it's on the screen when we start suspending */</span></td></tr> +<tr class="codeline" data-linenumber="1238"><td class="num" id="LN1238">1238</td><td class="line"> g_spawn_sync (<span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, screen_locker_command, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1239"><td class="num" id="LN1239">1239</td><td class="line"> G_SPAWN_DEFAULT | G_SPAWN_SEARCH_PATH,</td></tr> +<tr class="codeline" data-linenumber="1240"><td class="num" id="LN1240">1240</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, &error);</td></tr> +<tr class="codeline" data-linenumber="1241"><td class="num" id="LN1241">1241</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1242"><td class="num" id="LN1242">1242</td><td class="line"> <span class='keyword'>if</span> (error) {</td></tr> +<tr class="codeline" data-linenumber="1243"><td class="num" id="LN1243">1243</td><td class="line"> g_warning (<span class='string_literal'>"Couldn't lock screen: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="1244"><td class="num" id="LN1244">1244</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="1245"><td class="num" id="LN1245">1245</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1246"><td class="num" id="LN1246">1246</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1247"><td class="num" id="LN1247">1247</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1248"><td class="num" id="LN1248">1248</td><td class="line"> g_warning (<span class='string_literal'>"Couldn't find any screen locker"</span>);</td></tr> +<tr class="codeline" data-linenumber="1249"><td class="num" id="LN1249">1249</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1250"><td class="num" id="LN1250">1250</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1251"><td class="num" id="LN1251">1251</td><td class="line">clear_screen_locker_command:</td></tr> +<tr class="codeline" data-linenumber="1252"><td class="num" id="LN1252">1252</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1253"><td class="num" id="LN1253">1253</td><td class="line"> g_strfreev (screen_locker_command);</td></tr> +<tr class="codeline" data-linenumber="1254"><td class="num" id="LN1254">1254</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1255"><td class="num" id="LN1255">1255</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1256"><td class="num" id="LN1256">1256</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1257"><td class="num" id="LN1257">1257</td><td class="line">manager_attempt_hibernate (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1258"><td class="num" id="LN1258">1258</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1259"><td class="num" id="LN1259">1259</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="1260"><td class="num" id="LN1260">1260</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1261"><td class="num" id="LN1261">1261</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1262"><td class="num" id="LN1262">1262</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="1263"><td class="num" id="LN1263">1263</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1264"><td class="num" id="LN1264">1264</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="1265"><td class="num" id="LN1265">1265</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1266"><td class="num" id="LN1266">1266</td><td class="line"> <span class='comment'>/* lock the screen before we suspend */</span></td></tr> +<tr class="codeline" data-linenumber="1267"><td class="num" id="LN1267">1267</td><td class="line"> manager_perhaps_lock (manager);</td></tr> +<tr class="codeline" data-linenumber="1268"><td class="num" id="LN1268">1268</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1269"><td class="num" id="LN1269">1269</td><td class="line"> gsm_systemd_attempt_hibernate (systemd);</td></tr> +<tr class="codeline" data-linenumber="1270"><td class="num" id="LN1270">1270</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1271"><td class="num" id="LN1271">1271</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1272"><td class="num" id="LN1272">1272</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="1273"><td class="num" id="LN1273">1273</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="1274"><td class="num" id="LN1274">1274</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="1275"><td class="num" id="LN1275">1275</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1276"><td class="num" id="LN1276">1276</td><td class="line"> gboolean can_hibernate = gsm_consolekit_can_hibernate (consolekit);</td></tr> +<tr class="codeline" data-linenumber="1277"><td class="num" id="LN1277">1277</td><td class="line"> <span class='keyword'>if</span> (can_hibernate) {</td></tr> +<tr class="codeline" data-linenumber="1278"><td class="num" id="LN1278">1278</td><td class="line"> <span class='comment'>/* lock the screen before we suspend */</span></td></tr> +<tr class="codeline" data-linenumber="1279"><td class="num" id="LN1279">1279</td><td class="line"> manager_perhaps_lock (manager);</td></tr> +<tr class="codeline" data-linenumber="1280"><td class="num" id="LN1280">1280</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1281"><td class="num" id="LN1281">1281</td><td class="line"> gsm_consolekit_attempt_hibernate (consolekit);</td></tr> +<tr class="codeline" data-linenumber="1282"><td class="num" id="LN1282">1282</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1283"><td class="num" id="LN1283">1283</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="1284"><td class="num" id="LN1284">1284</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1285"><td class="num" id="LN1285">1285</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="1286"><td class="num" id="LN1286">1286</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1287"><td class="num" id="LN1287">1287</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1288"><td class="num" id="LN1288">1288</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1289"><td class="num" id="LN1289">1289</td><td class="line">manager_attempt_suspend (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1290"><td class="num" id="LN1290">1290</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1291"><td class="num" id="LN1291">1291</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="1292"><td class="num" id="LN1292">1292</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1293"><td class="num" id="LN1293">1293</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1294"><td class="num" id="LN1294">1294</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="1295"><td class="num" id="LN1295">1295</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1296"><td class="num" id="LN1296">1296</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="1297"><td class="num" id="LN1297">1297</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1298"><td class="num" id="LN1298">1298</td><td class="line"> <span class='comment'>/* lock the screen before we suspend */</span></td></tr> +<tr class="codeline" data-linenumber="1299"><td class="num" id="LN1299">1299</td><td class="line"> manager_perhaps_lock (manager);</td></tr> +<tr class="codeline" data-linenumber="1300"><td class="num" id="LN1300">1300</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1301"><td class="num" id="LN1301">1301</td><td class="line"> gsm_systemd_attempt_suspend (systemd);</td></tr> +<tr class="codeline" data-linenumber="1302"><td class="num" id="LN1302">1302</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1303"><td class="num" id="LN1303">1303</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1304"><td class="num" id="LN1304">1304</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="1305"><td class="num" id="LN1305">1305</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="1306"><td class="num" id="LN1306">1306</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="1307"><td class="num" id="LN1307">1307</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1308"><td class="num" id="LN1308">1308</td><td class="line"> gboolean can_suspend = gsm_consolekit_can_suspend (consolekit);</td></tr> +<tr class="codeline" data-linenumber="1309"><td class="num" id="LN1309">1309</td><td class="line"> <span class='keyword'>if</span> (can_suspend) {</td></tr> +<tr class="codeline" data-linenumber="1310"><td class="num" id="LN1310">1310</td><td class="line"> <span class='comment'>/* lock the screen before we suspend */</span></td></tr> +<tr class="codeline" data-linenumber="1311"><td class="num" id="LN1311">1311</td><td class="line"> manager_perhaps_lock (manager);</td></tr> +<tr class="codeline" data-linenumber="1312"><td class="num" id="LN1312">1312</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1313"><td class="num" id="LN1313">1313</td><td class="line"> gsm_consolekit_attempt_suspend (consolekit);</td></tr> +<tr class="codeline" data-linenumber="1314"><td class="num" id="LN1314">1314</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1315"><td class="num" id="LN1315">1315</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="1316"><td class="num" id="LN1316">1316</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1317"><td class="num" id="LN1317">1317</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="1318"><td class="num" id="LN1318">1318</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1319"><td class="num" id="LN1319">1319</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1320"><td class="num" id="LN1320">1320</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1321"><td class="num" id="LN1321">1321</td><td class="line">do_inhibit_dialog_action (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="1322"><td class="num" id="LN1322">1322</td><td class="line"> <span class='keyword'>int</span> action)</td></tr> +<tr class="codeline" data-linenumber="1323"><td class="num" id="LN1323">1323</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1324"><td class="num" id="LN1324">1324</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1325"><td class="num" id="LN1325">1325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1326"><td class="num" id="LN1326">1326</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1327"><td class="num" id="LN1327">1327</td><td class="line"> <span class='keyword'>switch</span> (action) {</td></tr> +<tr class="codeline" data-linenumber="1328"><td class="num" id="LN1328">1328</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_ACTION_SWITCH_USER:</td></tr> +<tr class="codeline" data-linenumber="1329"><td class="num" id="LN1329">1329</td><td class="line"> manager_switch_user (manager);</td></tr> +<tr class="codeline" data-linenumber="1330"><td class="num" id="LN1330">1330</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1331"><td class="num" id="LN1331">1331</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_ACTION_HIBERNATE:</td></tr> +<tr class="codeline" data-linenumber="1332"><td class="num" id="LN1332">1332</td><td class="line"> manager_attempt_hibernate (manager);</td></tr> +<tr class="codeline" data-linenumber="1333"><td class="num" id="LN1333">1333</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1334"><td class="num" id="LN1334">1334</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_ACTION_SLEEP:</td></tr> +<tr class="codeline" data-linenumber="1335"><td class="num" id="LN1335">1335</td><td class="line"> manager_attempt_suspend (manager);</td></tr> +<tr class="codeline" data-linenumber="1336"><td class="num" id="LN1336">1336</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1337"><td class="num" id="LN1337">1337</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_ACTION_SHUTDOWN:</td></tr> +<tr class="codeline" data-linenumber="1338"><td class="num" id="LN1338">1338</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_ACTION_REBOOT:</td></tr> +<tr class="codeline" data-linenumber="1339"><td class="num" id="LN1339">1339</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_ACTION_LOGOUT:</td></tr> +<tr class="codeline" data-linenumber="1340"><td class="num" id="LN1340">1340</td><td class="line"> priv->logout_mode = GSM_MANAGER_LOGOUT_MODE_FORCE;</td></tr> +<tr class="codeline" data-linenumber="1341"><td class="num" id="LN1341">1341</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="1342"><td class="num" id="LN1342">1342</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1343"><td class="num" id="LN1343">1343</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="1344"><td class="num" id="LN1344">1344</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-manager.c",<br> 1344, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1345"><td class="num" id="LN1345">1345</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1346"><td class="num" id="LN1346">1346</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1347"><td class="num" id="LN1347">1347</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1348"><td class="num" id="LN1348">1348</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1349"><td class="num" id="LN1349">1349</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1350"><td class="num" id="LN1350">1350</td><td class="line">inhibit_dialog_response (GsmInhibitDialog *dialog,</td></tr> +<tr class="codeline" data-linenumber="1351"><td class="num" id="LN1351">1351</td><td class="line"> guint response_id,</td></tr> +<tr class="codeline" data-linenumber="1352"><td class="num" id="LN1352">1352</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1353"><td class="num" id="LN1353">1353</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1354"><td class="num" id="LN1354">1354</td><td class="line"> <span class='keyword'>int</span> action;</td></tr> +<tr class="codeline" data-linenumber="1355"><td class="num" id="LN1355">1355</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1356"><td class="num" id="LN1356">1356</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1357"><td class="num" id="LN1357">1357</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Inhibit dialog response: %d"</span>, response_id);</td></tr> +<tr class="codeline" data-linenumber="1358"><td class="num" id="LN1358">1358</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1359"><td class="num" id="LN1359">1359</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1360"><td class="num" id="LN1360">1360</td><td class="line"> <span class='comment'>/* must destroy dialog before cancelling since we'll</span></td></tr> +<tr class="codeline" data-linenumber="1361"><td class="num" id="LN1361">1361</td><td class="line"> <span class='comment'>remove JIT inhibitors and we don't want to trigger</span></td></tr> +<tr class="codeline" data-linenumber="1362"><td class="num" id="LN1362">1362</td><td class="line"> <span class='comment'>action. */</span></td></tr> +<tr class="codeline" data-linenumber="1363"><td class="num" id="LN1363">1363</td><td class="line"> g_object_get (dialog, <span class='string_literal'>"action"</span>, &action, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1364"><td class="num" id="LN1364">1364</td><td class="line"> gtk_widget_destroy (<span class='macro'>GTK_WIDGET (dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_widget_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1365"><td class="num" id="LN1365">1365</td><td class="line"> priv->inhibit_dialog = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1366"><td class="num" id="LN1366">1366</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1367"><td class="num" id="LN1367">1367</td><td class="line"> <span class='comment'>/* In case of dialog cancel, switch user, hibernate and</span></td></tr> +<tr class="codeline" data-linenumber="1368"><td class="num" id="LN1368">1368</td><td class="line"> <span class='comment'>* suspend, we just perform the respective action and return,</span></td></tr> +<tr class="codeline" data-linenumber="1369"><td class="num" id="LN1369">1369</td><td class="line"> <span class='comment'>* without shutting down the session. */</span></td></tr> +<tr class="codeline" data-linenumber="1370"><td class="num" id="LN1370">1370</td><td class="line"> <span class='keyword'>switch</span> (response_id) {</td></tr> +<tr class="codeline" data-linenumber="1371"><td class="num" id="LN1371">1371</td><td class="line"> <span class='keyword'>case</span> GTK_RESPONSE_CANCEL:</td></tr> +<tr class="codeline" data-linenumber="1372"><td class="num" id="LN1372">1372</td><td class="line"> <span class='keyword'>case</span> GTK_RESPONSE_NONE:</td></tr> +<tr class="codeline" data-linenumber="1373"><td class="num" id="LN1373">1373</td><td class="line"> <span class='keyword'>case</span> GTK_RESPONSE_DELETE_EVENT:</td></tr> +<tr class="codeline" data-linenumber="1374"><td class="num" id="LN1374">1374</td><td class="line"> <span class='keyword'>if</span> (action == GSM_LOGOUT_ACTION_LOGOUT</td></tr> +<tr class="codeline" data-linenumber="1375"><td class="num" id="LN1375">1375</td><td class="line"> || action == GSM_LOGOUT_ACTION_SHUTDOWN</td></tr> +<tr class="codeline" data-linenumber="1376"><td class="num" id="LN1376">1376</td><td class="line"> || action == GSM_LOGOUT_ACTION_REBOOT) {</td></tr> +<tr class="codeline" data-linenumber="1377"><td class="num" id="LN1377">1377</td><td class="line"> cancel_end_session (manager);</td></tr> +<tr class="codeline" data-linenumber="1378"><td class="num" id="LN1378">1378</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1379"><td class="num" id="LN1379">1379</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1380"><td class="num" id="LN1380">1380</td><td class="line"> <span class='keyword'>case</span> GTK_RESPONSE_ACCEPT:</td></tr> +<tr class="codeline" data-linenumber="1381"><td class="num" id="LN1381">1381</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: doing action %d"</span>, action);</td></tr> +<tr class="codeline" data-linenumber="1382"><td class="num" id="LN1382">1382</td><td class="line"> do_inhibit_dialog_action (manager, action);</td></tr> +<tr class="codeline" data-linenumber="1383"><td class="num" id="LN1383">1383</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1384"><td class="num" id="LN1384">1384</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="1385"><td class="num" id="LN1385">1385</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-manager.c",<br> 1385, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1386"><td class="num" id="LN1386">1386</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1387"><td class="num" id="LN1387">1387</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1388"><td class="num" id="LN1388">1388</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1389"><td class="num" id="LN1389">1389</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1390"><td class="num" id="LN1390">1390</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1391"><td class="num" id="LN1391">1391</td><td class="line">query_end_session_complete (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1392"><td class="num" id="LN1392">1392</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1393"><td class="num" id="LN1393">1393</td><td class="line"> GsmLogoutAction action;</td></tr> +<tr class="codeline" data-linenumber="1394"><td class="num" id="LN1394">1394</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1395"><td class="num" id="LN1395">1395</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1396"><td class="num" id="LN1396">1396</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1397"><td class="num" id="LN1397">1397</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1398"><td class="num" id="LN1398">1398</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: query end session complete"</span>);</td></tr> +<tr class="codeline" data-linenumber="1399"><td class="num" id="LN1399">1399</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1400"><td class="num" id="LN1400">1400</td><td class="line"> <span class='comment'>/* Remove the timeout since this can be called from outside the timer</span></td></tr> +<tr class="codeline" data-linenumber="1401"><td class="num" id="LN1401">1401</td><td class="line"> <span class='comment'>* and we don't want to have it called twice */</span></td></tr> +<tr class="codeline" data-linenumber="1402"><td class="num" id="LN1402">1402</td><td class="line"> <span class='keyword'>if</span> (priv->query_timeout_id > 0) {</td></tr> +<tr class="codeline" data-linenumber="1403"><td class="num" id="LN1403">1403</td><td class="line"> g_source_remove (priv->query_timeout_id);</td></tr> +<tr class="codeline" data-linenumber="1404"><td class="num" id="LN1404">1404</td><td class="line"> priv->query_timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="1405"><td class="num" id="LN1405">1405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1406"><td class="num" id="LN1406">1406</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1407"><td class="num" id="LN1407">1407</td><td class="line"> <span class='keyword'>if</span> (! gsm_manager_is_logout_inhibited (manager)) {</td></tr> +<tr class="codeline" data-linenumber="1408"><td class="num" id="LN1408">1408</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="1409"><td class="num" id="LN1409">1409</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1410"><td class="num" id="LN1410">1410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1411"><td class="num" id="LN1411">1411</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1412"><td class="num" id="LN1412">1412</td><td class="line"> <span class='keyword'>if</span> (priv->inhibit_dialog != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1413"><td class="num" id="LN1413">1413</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: inhibit dialog already up"</span>);</td></tr> +<tr class="codeline" data-linenumber="1414"><td class="num" id="LN1414">1414</td><td class="line"> gtk_window_present (<span class='macro'>GTK_WINDOW (priv->inhibit_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((priv->inhibit_dialog)), ((gtk_window_get_type ())))))<br>)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1415"><td class="num" id="LN1415">1415</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="1416"><td class="num" id="LN1416">1416</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1417"><td class="num" id="LN1417">1417</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1418"><td class="num" id="LN1418">1418</td><td class="line"> <span class='keyword'>switch</span> (priv->logout_type) {</td></tr> +<tr class="codeline" data-linenumber="1419"><td class="num" id="LN1419">1419</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_LOGOUT:</td></tr> +<tr class="codeline" data-linenumber="1420"><td class="num" id="LN1420">1420</td><td class="line"> action = GSM_LOGOUT_ACTION_LOGOUT;</td></tr> +<tr class="codeline" data-linenumber="1421"><td class="num" id="LN1421">1421</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1422"><td class="num" id="LN1422">1422</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_REBOOT:</td></tr> +<tr class="codeline" data-linenumber="1423"><td class="num" id="LN1423">1423</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_REBOOT_INTERACT:</td></tr> +<tr class="codeline" data-linenumber="1424"><td class="num" id="LN1424">1424</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_REBOOT_MDM:</td></tr> +<tr class="codeline" data-linenumber="1425"><td class="num" id="LN1425">1425</td><td class="line"> action = GSM_LOGOUT_ACTION_REBOOT;</td></tr> +<tr class="codeline" data-linenumber="1426"><td class="num" id="LN1426">1426</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1427"><td class="num" id="LN1427">1427</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_SHUTDOWN:</td></tr> +<tr class="codeline" data-linenumber="1428"><td class="num" id="LN1428">1428</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_SHUTDOWN_INTERACT:</td></tr> +<tr class="codeline" data-linenumber="1429"><td class="num" id="LN1429">1429</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_SHUTDOWN_MDM:</td></tr> +<tr class="codeline" data-linenumber="1430"><td class="num" id="LN1430">1430</td><td class="line"> action = GSM_LOGOUT_ACTION_SHUTDOWN;</td></tr> +<tr class="codeline" data-linenumber="1431"><td class="num" id="LN1431">1431</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1432"><td class="num" id="LN1432">1432</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="1433"><td class="num" id="LN1433">1433</td><td class="line"> g_warning (<span class='string_literal'>"Unexpected logout type %d when creating inhibit dialog"</span>,</td></tr> +<tr class="codeline" data-linenumber="1434"><td class="num" id="LN1434">1434</td><td class="line"> priv->logout_type);</td></tr> +<tr class="codeline" data-linenumber="1435"><td class="num" id="LN1435">1435</td><td class="line"> action = GSM_LOGOUT_ACTION_LOGOUT;</td></tr> +<tr class="codeline" data-linenumber="1436"><td class="num" id="LN1436">1436</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1437"><td class="num" id="LN1437">1437</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1438"><td class="num" id="LN1438">1438</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1439"><td class="num" id="LN1439">1439</td><td class="line"> <span class='comment'>/* Note: GSM_LOGOUT_ACTION_SHUTDOWN and GSM_LOGOUT_ACTION_REBOOT are</span></td></tr> +<tr class="codeline" data-linenumber="1440"><td class="num" id="LN1440">1440</td><td class="line"> <span class='comment'>* actually handled the same way as GSM_LOGOUT_ACTION_LOGOUT in the</span></td></tr> +<tr class="codeline" data-linenumber="1441"><td class="num" id="LN1441">1441</td><td class="line"> <span class='comment'>* inhibit dialog; the action, if the button is clicked, will be to</span></td></tr> +<tr class="codeline" data-linenumber="1442"><td class="num" id="LN1442">1442</td><td class="line"> <span class='comment'>* simply go to the next phase. */</span></td></tr> +<tr class="codeline" data-linenumber="1443"><td class="num" id="LN1443">1443</td><td class="line"> priv->inhibit_dialog = gsm_inhibit_dialog_new (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="1444"><td class="num" id="LN1444">1444</td><td class="line"> priv->clients,</td></tr> +<tr class="codeline" data-linenumber="1445"><td class="num" id="LN1445">1445</td><td class="line"> action);</td></tr> +<tr class="codeline" data-linenumber="1446"><td class="num" id="LN1446">1446</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1447"><td class="num" id="LN1447">1447</td><td class="line"> <span class='macro'>g_signal_connect (priv->inhibit_dialog,<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="1448"><td class="num" id="LN1448">1448</td><td class="line"> <span class='string_literal'><span class='macro'>"response"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="1449"><td class="num" id="LN1449">1449</td><td class="line"> <span class='macro'>G_CALLBACK (inhibit_dialog_response),<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="1450"><td class="num" id="LN1450">1450</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1451"><td class="num" id="LN1451">1451</td><td class="line"> gtk_widget_show (priv->inhibit_dialog);</td></tr> +<tr class="codeline" data-linenumber="1452"><td class="num" id="LN1452">1452</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1453"><td class="num" id="LN1453">1453</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1454"><td class="num" id="LN1454">1454</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1455"><td class="num" id="LN1455">1455</td><td class="line"><span class='keyword'>static</span> guint32</td></tr> +<tr class="codeline" data-linenumber="1456"><td class="num" id="LN1456">1456</td><td class="line">generate_cookie (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="1457"><td class="num" id="LN1457">1457</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1458"><td class="num" id="LN1458">1458</td><td class="line"> guint32 cookie;</td></tr> +<tr class="codeline" data-linenumber="1459"><td class="num" id="LN1459">1459</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1460"><td class="num" id="LN1460">1460</td><td class="line"> cookie = (guint32)g_random_int_range (1, <span class='macro'>G_MAXINT32<span class='macro_popup'>((gint32) 0x7fffffff)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1461"><td class="num" id="LN1461">1461</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1462"><td class="num" id="LN1462">1462</td><td class="line"> <span class='keyword'>return</span> cookie;</td></tr> +<tr class="codeline" data-linenumber="1463"><td class="num" id="LN1463">1463</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1464"><td class="num" id="LN1464">1464</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1465"><td class="num" id="LN1465">1465</td><td class="line"><span class='keyword'>static</span> guint32</td></tr> +<tr class="codeline" data-linenumber="1466"><td class="num" id="LN1466">1466</td><td class="line">_generate_unique_cookie (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1467"><td class="num" id="LN1467">1467</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1468"><td class="num" id="LN1468">1468</td><td class="line"> guint32 cookie;</td></tr> +<tr class="codeline" data-linenumber="1469"><td class="num" id="LN1469">1469</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1470"><td class="num" id="LN1470">1470</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1471"><td class="num" id="LN1471">1471</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1472"><td class="num" id="LN1472">1472</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1473"><td class="num" id="LN1473">1473</td><td class="line"> <span class='keyword'>do</span> {</td></tr> +<tr class="codeline" data-linenumber="1474"><td class="num" id="LN1474">1474</td><td class="line"> cookie = generate_cookie ();</td></tr> +<tr class="codeline" data-linenumber="1475"><td class="num" id="LN1475">1475</td><td class="line"> } <span class='keyword'>while</span> (gsm_store_find (priv->inhibitors, (GsmStoreFunc)_find_by_cookie, &cookie) != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1476"><td class="num" id="LN1476">1476</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1477"><td class="num" id="LN1477">1477</td><td class="line"> <span class='keyword'>return</span> cookie;</td></tr> +<tr class="codeline" data-linenumber="1478"><td class="num" id="LN1478">1478</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1479"><td class="num" id="LN1479">1479</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1480"><td class="num" id="LN1480">1480</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1481"><td class="num" id="LN1481">1481</td><td class="line">_on_query_end_session_timeout (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1482"><td class="num" id="LN1482">1482</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1483"><td class="num" id="LN1483">1483</td><td class="line"> GSList *l;</td></tr> +<tr class="codeline" data-linenumber="1484"><td class="num" id="LN1484">1484</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1485"><td class="num" id="LN1485">1485</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1486"><td class="num" id="LN1486">1486</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1487"><td class="num" id="LN1487">1487</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1488"><td class="num" id="LN1488">1488</td><td class="line"> priv->query_timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="1489"><td class="num" id="LN1489">1489</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1490"><td class="num" id="LN1490">1490</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: query end session timed out"</span>);</td></tr> +<tr class="codeline" data-linenumber="1491"><td class="num" id="LN1491">1491</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1492"><td class="num" id="LN1492">1492</td><td class="line"> <span class='keyword'>for</span> (l = priv->query_clients; l != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; l = l->next) {</td></tr> +<tr class="codeline" data-linenumber="1493"><td class="num" id="LN1493">1493</td><td class="line"> guint cookie;</td></tr> +<tr class="codeline" data-linenumber="1494"><td class="num" id="LN1494">1494</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="1495"><td class="num" id="LN1495">1495</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *bus_name;</td></tr> +<tr class="codeline" data-linenumber="1496"><td class="num" id="LN1496">1496</td><td class="line"> <span class='keyword'>char</span> *app_id;</td></tr> +<tr class="codeline" data-linenumber="1497"><td class="num" id="LN1497">1497</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1498"><td class="num" id="LN1498">1498</td><td class="line"> g_warning (<span class='string_literal'>"Client '%s' failed to reply before timeout"</span>,</td></tr> +<tr class="codeline" data-linenumber="1499"><td class="num" id="LN1499">1499</td><td class="line"> gsm_client_peek_id (l->data));</td></tr> +<tr class="codeline" data-linenumber="1500"><td class="num" id="LN1500">1500</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1501"><td class="num" id="LN1501">1501</td><td class="line"> <span class='comment'>/* Don't add "not responding" inhibitors if logout is forced</span></td></tr> +<tr class="codeline" data-linenumber="1502"><td class="num" id="LN1502">1502</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1503"><td class="num" id="LN1503">1503</td><td class="line"> <span class='keyword'>if</span> (priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_FORCE) {</td></tr> +<tr class="codeline" data-linenumber="1504"><td class="num" id="LN1504">1504</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="1505"><td class="num" id="LN1505">1505</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1506"><td class="num" id="LN1506">1506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1507"><td class="num" id="LN1507">1507</td><td class="line"> <span class='comment'>/* Add JIT inhibit for unresponsive client */</span></td></tr> +<tr class="codeline" data-linenumber="1508"><td class="num" id="LN1508">1508</td><td class="line"> <span class='keyword'>if</span> (GSM_IS_DBUS_CLIENT (l->data)) {</td></tr> +<tr class="codeline" data-linenumber="1509"><td class="num" id="LN1509">1509</td><td class="line"> bus_name = gsm_dbus_client_get_bus_name (l->data);</td></tr> +<tr class="codeline" data-linenumber="1510"><td class="num" id="LN1510">1510</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1511"><td class="num" id="LN1511">1511</td><td class="line"> bus_name = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1512"><td class="num" id="LN1512">1512</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1513"><td class="num" id="LN1513">1513</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1514"><td class="num" id="LN1514">1514</td><td class="line"> app_id = <span class='macro'>g_strdup (gsm_client_peek_app_id (l->data))<span class='macro_popup'>g_strdup_inline (gsm_client_peek_app_id (l->data))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1515"><td class="num" id="LN1515">1515</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (app_id)<span class='macro_popup'>((app_id)==((void*)0)||(app_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1516"><td class="num" id="LN1516">1516</td><td class="line"> <span class='comment'>/* XSMP clients don't give us an app id unless we start them */</span></td></tr> +<tr class="codeline" data-linenumber="1517"><td class="num" id="LN1517">1517</td><td class="line"> g_free (app_id);</td></tr> +<tr class="codeline" data-linenumber="1518"><td class="num" id="LN1518">1518</td><td class="line"> app_id = gsm_client_get_app_name (l->data);</td></tr> +<tr class="codeline" data-linenumber="1519"><td class="num" id="LN1519">1519</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1520"><td class="num" id="LN1520">1520</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1521"><td class="num" id="LN1521">1521</td><td class="line"> cookie = _generate_unique_cookie (manager);</td></tr> +<tr class="codeline" data-linenumber="1522"><td class="num" id="LN1522">1522</td><td class="line"> inhibitor = gsm_inhibitor_new_for_client (gsm_client_peek_id (l->data),</td></tr> +<tr class="codeline" data-linenumber="1523"><td class="num" id="LN1523">1523</td><td class="line"> app_id,</td></tr> +<tr class="codeline" data-linenumber="1524"><td class="num" id="LN1524">1524</td><td class="line"> GSM_INHIBITOR_FLAG_LOGOUT,</td></tr> +<tr class="codeline" data-linenumber="1525"><td class="num" id="LN1525">1525</td><td class="line"> <span class='macro'>_(<span class='string_literal'>"Not responding"</span>)<span class='macro_popup'>gettext ("Not responding")</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1526"><td class="num" id="LN1526">1526</td><td class="line"> bus_name,</td></tr> +<tr class="codeline" data-linenumber="1527"><td class="num" id="LN1527">1527</td><td class="line"> cookie);</td></tr> +<tr class="codeline" data-linenumber="1528"><td class="num" id="LN1528">1528</td><td class="line"> g_free (app_id);</td></tr> +<tr class="codeline" data-linenumber="1529"><td class="num" id="LN1529">1529</td><td class="line"> gsm_store_add (priv->inhibitors, gsm_inhibitor_peek_id (inhibitor), <span class='macro'>G_OBJECT (inhibitor)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((inhibitor)), (((GType) ((20) << (2))))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1530"><td class="num" id="LN1530">1530</td><td class="line"> g_object_unref (inhibitor);</td></tr> +<tr class="codeline" data-linenumber="1531"><td class="num" id="LN1531">1531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1532"><td class="num" id="LN1532">1532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1533"><td class="num" id="LN1533">1533</td><td class="line"> g_slist_free (priv->query_clients);</td></tr> +<tr class="codeline" data-linenumber="1534"><td class="num" id="LN1534">1534</td><td class="line"> priv->query_clients = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1535"><td class="num" id="LN1535">1535</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1536"><td class="num" id="LN1536">1536</td><td class="line"> query_end_session_complete (manager);</td></tr> +<tr class="codeline" data-linenumber="1537"><td class="num" id="LN1537">1537</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1538"><td class="num" id="LN1538">1538</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1539"><td class="num" id="LN1539">1539</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1540"><td class="num" id="LN1540">1540</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1541"><td class="num" id="LN1541">1541</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1542"><td class="num" id="LN1542">1542</td><td class="line">do_phase_query_end_session (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1543"><td class="num" id="LN1543">1543</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1544"><td class="num" id="LN1544">1544</td><td class="line"> ClientEndSessionData data;</td></tr> +<tr class="codeline" data-linenumber="1545"><td class="num" id="LN1545">1545</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1546"><td class="num" id="LN1546">1546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1547"><td class="num" id="LN1547">1547</td><td class="line"> data.manager = manager;</td></tr> +<tr class="codeline" data-linenumber="1548"><td class="num" id="LN1548">1548</td><td class="line"> data.flags = 0;</td></tr> +<tr class="codeline" data-linenumber="1549"><td class="num" id="LN1549">1549</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1550"><td class="num" id="LN1550">1550</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1551"><td class="num" id="LN1551">1551</td><td class="line"> <span class='keyword'>if</span> (priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_FORCE) {</td></tr> +<tr class="codeline" data-linenumber="1552"><td class="num" id="LN1552">1552</td><td class="line"> data.flags |= GSM_CLIENT_END_SESSION_FLAG_FORCEFUL;</td></tr> +<tr class="codeline" data-linenumber="1553"><td class="num" id="LN1553">1553</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1554"><td class="num" id="LN1554">1554</td><td class="line"> <span class='comment'>/* We only query if an app is ready to log out, so we don't use</span></td></tr> +<tr class="codeline" data-linenumber="1555"><td class="num" id="LN1555">1555</td><td class="line"> <span class='comment'>* GSM_CLIENT_END_SESSION_FLAG_SAVE here.</span></td></tr> +<tr class="codeline" data-linenumber="1556"><td class="num" id="LN1556">1556</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1557"><td class="num" id="LN1557">1557</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1558"><td class="num" id="LN1558">1558</td><td class="line"> debug_clients (manager);</td></tr> +<tr class="codeline" data-linenumber="1559"><td class="num" id="LN1559">1559</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: sending query-end-session to clients (logout mode: %s)"</span>,</td></tr> +<tr class="codeline" data-linenumber="1560"><td class="num" id="LN1560">1560</td><td class="line"> priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_NORMAL? <span class='string_literal'>"normal"</span> :</td></tr> +<tr class="codeline" data-linenumber="1561"><td class="num" id="LN1561">1561</td><td class="line"> priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_FORCE? <span class='string_literal'>"forceful"</span>:</td></tr> +<tr class="codeline" data-linenumber="1562"><td class="num" id="LN1562">1562</td><td class="line"> <span class='string_literal'>"no confirmation"</span>);</td></tr> +<tr class="codeline" data-linenumber="1563"><td class="num" id="LN1563">1563</td><td class="line"> gsm_store_foreach (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="1564"><td class="num" id="LN1564">1564</td><td class="line"> (GsmStoreFunc)_client_query_end_session,</td></tr> +<tr class="codeline" data-linenumber="1565"><td class="num" id="LN1565">1565</td><td class="line"> &data);</td></tr> +<tr class="codeline" data-linenumber="1566"><td class="num" id="LN1566">1566</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1567"><td class="num" id="LN1567">1567</td><td class="line"> <span class='comment'>/* This phase doesn't time out unless logout is forced. Typically, this</span></td></tr> +<tr class="codeline" data-linenumber="1568"><td class="num" id="LN1568">1568</td><td class="line"> <span class='comment'>* separate timer is only used to show UI. */</span></td></tr> +<tr class="codeline" data-linenumber="1569"><td class="num" id="LN1569">1569</td><td class="line"> priv->query_timeout_id = g_timeout_add_seconds (1, (GSourceFunc)_on_query_end_session_timeout, manager);</td></tr> +<tr class="codeline" data-linenumber="1570"><td class="num" id="LN1570">1570</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1571"><td class="num" id="LN1571">1571</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1572"><td class="num" id="LN1572">1572</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1573"><td class="num" id="LN1573">1573</td><td class="line">update_idle (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1574"><td class="num" id="LN1574">1574</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1575"><td class="num" id="LN1575">1575</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1576"><td class="num" id="LN1576">1576</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1577"><td class="num" id="LN1577">1577</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1578"><td class="num" id="LN1578">1578</td><td class="line"> <span class='keyword'>if</span> (gsm_manager_is_idle_inhibited (manager)) {</td></tr> +<tr class="codeline" data-linenumber="1579"><td class="num" id="LN1579">1579</td><td class="line"> gsm_presence_set_idle_enabled (priv->presence, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1580"><td class="num" id="LN1580">1580</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1581"><td class="num" id="LN1581">1581</td><td class="line"> gsm_presence_set_idle_enabled (priv->presence, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1582"><td class="num" id="LN1582">1582</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1583"><td class="num" id="LN1583">1583</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1584"><td class="num" id="LN1584">1584</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1585"><td class="num" id="LN1585">1585</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1586"><td class="num" id="LN1586">1586</td><td class="line">start_phase (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1587"><td class="num" id="LN1587">1587</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1588"><td class="num" id="LN1588">1588</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1589"><td class="num" id="LN1589">1589</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1590"><td class="num" id="LN1590">1590</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1591"><td class="num" id="LN1591">1591</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1592"><td class="num" id="LN1592">1592</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: starting phase %s\n"</span>,</td></tr> +<tr class="codeline" data-linenumber="1593"><td class="num" id="LN1593">1593</td><td class="line"> phase_num_to_name (priv->phase));</td></tr> +<tr class="codeline" data-linenumber="1594"><td class="num" id="LN1594">1594</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1595"><td class="num" id="LN1595">1595</td><td class="line"> <span class='comment'>/* reset state */</span></td></tr> +<tr class="codeline" data-linenumber="1596"><td class="num" id="LN1596">1596</td><td class="line"> g_slist_free (priv->pending_apps);</td></tr> +<tr class="codeline" data-linenumber="1597"><td class="num" id="LN1597">1597</td><td class="line"> priv->pending_apps = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1598"><td class="num" id="LN1598">1598</td><td class="line"> g_slist_free (priv->query_clients);</td></tr> +<tr class="codeline" data-linenumber="1599"><td class="num" id="LN1599">1599</td><td class="line"> priv->query_clients = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1600"><td class="num" id="LN1600">1600</td><td class="line"> g_slist_free (priv->next_query_clients);</td></tr> +<tr class="codeline" data-linenumber="1601"><td class="num" id="LN1601">1601</td><td class="line"> priv->next_query_clients = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1602"><td class="num" id="LN1602">1602</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1603"><td class="num" id="LN1603">1603</td><td class="line"> <span class='keyword'>if</span> (priv->query_timeout_id > 0) {</td></tr> +<tr class="codeline" data-linenumber="1604"><td class="num" id="LN1604">1604</td><td class="line"> g_source_remove (priv->query_timeout_id);</td></tr> +<tr class="codeline" data-linenumber="1605"><td class="num" id="LN1605">1605</td><td class="line"> priv->query_timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="1606"><td class="num" id="LN1606">1606</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1607"><td class="num" id="LN1607">1607</td><td class="line"> <span class='keyword'>if</span> (priv->phase_timeout_id > 0) {</td></tr> +<tr class="codeline" data-linenumber="1608"><td class="num" id="LN1608">1608</td><td class="line"> g_source_remove (priv->phase_timeout_id);</td></tr> +<tr class="codeline" data-linenumber="1609"><td class="num" id="LN1609">1609</td><td class="line"> priv->phase_timeout_id = 0;</td></tr> +<tr class="codeline" data-linenumber="1610"><td class="num" id="LN1610">1610</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1611"><td class="num" id="LN1611">1611</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1612"><td class="num" id="LN1612">1612</td><td class="line"> <span class='keyword'>switch</span> (priv->phase) {</td></tr> +<tr class="codeline" data-linenumber="1613"><td class="num" id="LN1613">1613</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_STARTUP:</td></tr> +<tr class="codeline" data-linenumber="1614"><td class="num" id="LN1614">1614</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_INITIALIZATION:</td></tr> +<tr class="codeline" data-linenumber="1615"><td class="num" id="LN1615">1615</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_WINDOW_MANAGER:</td></tr> +<tr class="codeline" data-linenumber="1616"><td class="num" id="LN1616">1616</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_PANEL:</td></tr> +<tr class="codeline" data-linenumber="1617"><td class="num" id="LN1617">1617</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_DESKTOP:</td></tr> +<tr class="codeline" data-linenumber="1618"><td class="num" id="LN1618">1618</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_APPLICATION:</td></tr> +<tr class="codeline" data-linenumber="1619"><td class="num" id="LN1619">1619</td><td class="line"> do_phase_startup (manager);</td></tr> +<tr class="codeline" data-linenumber="1620"><td class="num" id="LN1620">1620</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1621"><td class="num" id="LN1621">1621</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_RUNNING:</td></tr> +<tr class="codeline" data-linenumber="1622"><td class="num" id="LN1622">1622</td><td class="line"> g_signal_emit (manager, signals[SESSION_RUNNING], 0);</td></tr> +<tr class="codeline" data-linenumber="1623"><td class="num" id="LN1623">1623</td><td class="line"> update_idle (manager);</td></tr> +<tr class="codeline" data-linenumber="1624"><td class="num" id="LN1624">1624</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1625"><td class="num" id="LN1625">1625</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_QUERY_END_SESSION:</td></tr> +<tr class="codeline" data-linenumber="1626"><td class="num" id="LN1626">1626</td><td class="line"> do_phase_query_end_session (manager);</td></tr> +<tr class="codeline" data-linenumber="1627"><td class="num" id="LN1627">1627</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1628"><td class="num" id="LN1628">1628</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_END_SESSION:</td></tr> +<tr class="codeline" data-linenumber="1629"><td class="num" id="LN1629">1629</td><td class="line"> do_phase_end_session (manager);</td></tr> +<tr class="codeline" data-linenumber="1630"><td class="num" id="LN1630">1630</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1631"><td class="num" id="LN1631">1631</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_PHASE_EXIT:</td></tr> +<tr class="codeline" data-linenumber="1632"><td class="num" id="LN1632">1632</td><td class="line"> do_phase_exit (manager);</td></tr> +<tr class="codeline" data-linenumber="1633"><td class="num" id="LN1633">1633</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1634"><td class="num" id="LN1634">1634</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="1635"><td class="num" id="LN1635">1635</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-manager.c",<br> 1635, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1636"><td class="num" id="LN1636">1636</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="1637"><td class="num" id="LN1637">1637</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1638"><td class="num" id="LN1638">1638</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1639"><td class="num" id="LN1639">1639</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1640"><td class="num" id="LN1640">1640</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1641"><td class="num" id="LN1641">1641</td><td class="line">_debug_app_for_phase (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="1642"><td class="num" id="LN1642">1642</td><td class="line"> GsmApp *app,</td></tr> +<tr class="codeline" data-linenumber="1643"><td class="num" id="LN1643">1643</td><td class="line"> gpointer data)</td></tr> +<tr class="codeline" data-linenumber="1644"><td class="num" id="LN1644">1644</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1645"><td class="num" id="LN1645">1645</td><td class="line"> guint phase;</td></tr> +<tr class="codeline" data-linenumber="1646"><td class="num" id="LN1646">1646</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1647"><td class="num" id="LN1647">1647</td><td class="line"> phase = <span class='macro'>GPOINTER_TO_UINT (data)<span class='macro_popup'>((guint) (gulong) (data))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1648"><td class="num" id="LN1648">1648</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1649"><td class="num" id="LN1649">1649</td><td class="line"> <span class='keyword'>if</span> (gsm_app_peek_phase (app) != phase) {</td></tr> +<tr class="codeline" data-linenumber="1650"><td class="num" id="LN1650">1650</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1651"><td class="num" id="LN1651">1651</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1652"><td class="num" id="LN1652">1652</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1653"><td class="num" id="LN1653">1653</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager:\tID: %s\tapp-id:%s\tis-disabled:%d\tis-conditionally-disabled:%d\tis-delayed:%d"</span>,</td></tr> +<tr class="codeline" data-linenumber="1654"><td class="num" id="LN1654">1654</td><td class="line"> gsm_app_peek_id (app),</td></tr> +<tr class="codeline" data-linenumber="1655"><td class="num" id="LN1655">1655</td><td class="line"> gsm_app_peek_app_id (app),</td></tr> +<tr class="codeline" data-linenumber="1656"><td class="num" id="LN1656">1656</td><td class="line"> gsm_app_peek_is_disabled (app),</td></tr> +<tr class="codeline" data-linenumber="1657"><td class="num" id="LN1657">1657</td><td class="line"> gsm_app_peek_is_conditionally_disabled (app),</td></tr> +<tr class="codeline" data-linenumber="1658"><td class="num" id="LN1658">1658</td><td class="line"> (gsm_app_peek_autostart_delay (app) > 0));</td></tr> +<tr class="codeline" data-linenumber="1659"><td class="num" id="LN1659">1659</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1660"><td class="num" id="LN1660">1660</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1661"><td class="num" id="LN1661">1661</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1662"><td class="num" id="LN1662">1662</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1663"><td class="num" id="LN1663">1663</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1664"><td class="num" id="LN1664">1664</td><td class="line">debug_app_summary (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1665"><td class="num" id="LN1665">1665</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1666"><td class="num" id="LN1666">1666</td><td class="line"> guint phase;</td></tr> +<tr class="codeline" data-linenumber="1667"><td class="num" id="LN1667">1667</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1668"><td class="num" id="LN1668">1668</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1669"><td class="num" id="LN1669">1669</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1670"><td class="num" id="LN1670">1670</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1671"><td class="num" id="LN1671">1671</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: App startup summary"</span>);</td></tr> +<tr class="codeline" data-linenumber="1672"><td class="num" id="LN1672">1672</td><td class="line"> <span class='keyword'>for</span> (phase = GSM_MANAGER_PHASE_INITIALIZATION; phase < GSM_MANAGER_PHASE_RUNNING; phase++) {</td></tr> +<tr class="codeline" data-linenumber="1673"><td class="num" id="LN1673">1673</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Phase %s"</span>, phase_num_to_name (phase));</td></tr> +<tr class="codeline" data-linenumber="1674"><td class="num" id="LN1674">1674</td><td class="line"> gsm_store_foreach (priv->apps,</td></tr> +<tr class="codeline" data-linenumber="1675"><td class="num" id="LN1675">1675</td><td class="line"> (GsmStoreFunc)_debug_app_for_phase,</td></tr> +<tr class="codeline" data-linenumber="1676"><td class="num" id="LN1676">1676</td><td class="line"> <span class='macro'>GUINT_TO_POINTER (phase)<span class='macro_popup'>((gpointer) (gulong) (phase))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="1677"><td class="num" id="LN1677">1677</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1678"><td class="num" id="LN1678">1678</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1679"><td class="num" id="LN1679">1679</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1680"><td class="num" id="LN1680">1680</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1681"><td class="num" id="LN1681">1681</td><td class="line">gsm_manager_start (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="1682"><td class="num" id="LN1682">1682</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1683"><td class="num" id="LN1683">1683</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: GSM starting to manage"</span>);</td></tr> +<tr class="codeline" data-linenumber="1684"><td class="num" id="LN1684">1684</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1685"><td class="num" id="LN1685">1685</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_MANAGER (manager))<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1686"><td class="num" id="LN1686">1686</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1687"><td class="num" id="LN1687">1687</td><td class="line"> gsm_manager_set_phase (manager, GSM_MANAGER_PHASE_INITIALIZATION);</td></tr> +<tr class="codeline" data-linenumber="1688"><td class="num" id="LN1688">1688</td><td class="line"> debug_app_summary (manager);</td></tr> +<tr class="codeline" data-linenumber="1689"><td class="num" id="LN1689">1689</td><td class="line"> start_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="1690"><td class="num" id="LN1690">1690</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1691"><td class="num" id="LN1691">1691</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1692"><td class="num" id="LN1692">1692</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1693"><td class="num" id="LN1693">1693</td><td class="line">_gsm_manager_set_renderer (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="1694"><td class="num" id="LN1694">1694</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *renderer)</td></tr> +<tr class="codeline" data-linenumber="1695"><td class="num" id="LN1695">1695</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1696"><td class="num" id="LN1696">1696</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1697"><td class="num" id="LN1697">1697</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1698"><td class="num" id="LN1698">1698</td><td class="line"> g_free (priv->renderer);</td></tr> +<tr class="codeline" data-linenumber="1699"><td class="num" id="LN1699">1699</td><td class="line"> priv->renderer = <span class='macro'>g_strdup (renderer)<span class='macro_popup'>g_strdup_inline (renderer)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1700"><td class="num" id="LN1700">1700</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1701"><td class="num" id="LN1701">1701</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1702"><td class="num" id="LN1702">1702</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1703"><td class="num" id="LN1703">1703</td><td class="line">_app_has_app_id (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="1704"><td class="num" id="LN1704">1704</td><td class="line"> GsmApp *app,</td></tr> +<tr class="codeline" data-linenumber="1705"><td class="num" id="LN1705">1705</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *app_id_a)</td></tr> +<tr class="codeline" data-linenumber="1706"><td class="num" id="LN1706">1706</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1707"><td class="num" id="LN1707">1707</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *app_id_b;</td></tr> +<tr class="codeline" data-linenumber="1708"><td class="num" id="LN1708">1708</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1709"><td class="num" id="LN1709">1709</td><td class="line"> app_id_b = gsm_app_peek_app_id (app);</td></tr> +<tr class="codeline" data-linenumber="1710"><td class="num" id="LN1710">1710</td><td class="line"> <span class='keyword'>return</span> (app_id_b != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> && strcmp (app_id_a, app_id_b) == 0);</td></tr> +<tr class="codeline" data-linenumber="1711"><td class="num" id="LN1711">1711</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1712"><td class="num" id="LN1712">1712</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1713"><td class="num" id="LN1713">1713</td><td class="line"><span class='keyword'>static</span> GsmApp *</td></tr> +<tr class="codeline" data-linenumber="1714"><td class="num" id="LN1714">1714</td><td class="line">find_app_for_app_id (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="1715"><td class="num" id="LN1715">1715</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *app_id)</td></tr> +<tr class="codeline" data-linenumber="1716"><td class="num" id="LN1716">1716</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1717"><td class="num" id="LN1717">1717</td><td class="line"> GsmApp *app;</td></tr> +<tr class="codeline" data-linenumber="1718"><td class="num" id="LN1718">1718</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1719"><td class="num" id="LN1719">1719</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1720"><td class="num" id="LN1720">1720</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1721"><td class="num" id="LN1721">1721</td><td class="line"> app = (GsmApp *)gsm_store_find (priv->apps,</td></tr> +<tr class="codeline" data-linenumber="1722"><td class="num" id="LN1722">1722</td><td class="line"> (GsmStoreFunc)_app_has_app_id,</td></tr> +<tr class="codeline" data-linenumber="1723"><td class="num" id="LN1723">1723</td><td class="line"> (<span class='keyword'>char</span> *)app_id);</td></tr> +<tr class="codeline" data-linenumber="1724"><td class="num" id="LN1724">1724</td><td class="line"> <span class='keyword'>return</span> app;</td></tr> +<tr class="codeline" data-linenumber="1725"><td class="num" id="LN1725">1725</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1726"><td class="num" id="LN1726">1726</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1727"><td class="num" id="LN1727">1727</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1728"><td class="num" id="LN1728">1728</td><td class="line">inhibitor_has_client_id (gpointer key,</td></tr> +<tr class="codeline" data-linenumber="1729"><td class="num" id="LN1729">1729</td><td class="line"> GsmInhibitor *inhibitor,</td></tr> +<tr class="codeline" data-linenumber="1730"><td class="num" id="LN1730">1730</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *client_id_a)</td></tr> +<tr class="codeline" data-linenumber="1731"><td class="num" id="LN1731">1731</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1732"><td class="num" id="LN1732">1732</td><td class="line"> gboolean matches;</td></tr> +<tr class="codeline" data-linenumber="1733"><td class="num" id="LN1733">1733</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *client_id_b;</td></tr> +<tr class="codeline" data-linenumber="1734"><td class="num" id="LN1734">1734</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1735"><td class="num" id="LN1735">1735</td><td class="line"> client_id_b = gsm_inhibitor_peek_client_id (inhibitor);</td></tr> +<tr class="codeline" data-linenumber="1736"><td class="num" id="LN1736">1736</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1737"><td class="num" id="LN1737">1737</td><td class="line"> matches = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1738"><td class="num" id="LN1738">1738</td><td class="line"> <span class='keyword'>if</span> (! <span class='macro'>IS_STRING_EMPTY (client_id_a)<span class='macro_popup'>((client_id_a)==((void*)0)||(client_id_a)[0]=='\0')</span></span> && ! <span class='macro'>IS_STRING_EMPTY (client_id_b)<span class='macro_popup'>((client_id_b)==((void*)0)||(client_id_b)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1739"><td class="num" id="LN1739">1739</td><td class="line"> matches = (strcmp (client_id_a, client_id_b) == 0);</td></tr> +<tr class="codeline" data-linenumber="1740"><td class="num" id="LN1740">1740</td><td class="line"> <span class='keyword'>if</span> (matches) {</td></tr> +<tr class="codeline" data-linenumber="1741"><td class="num" id="LN1741">1741</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: removing JIT inhibitor for %s for reason '%s'"</span>,</td></tr> +<tr class="codeline" data-linenumber="1742"><td class="num" id="LN1742">1742</td><td class="line"> gsm_inhibitor_peek_client_id (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="1743"><td class="num" id="LN1743">1743</td><td class="line"> gsm_inhibitor_peek_reason (inhibitor));</td></tr> +<tr class="codeline" data-linenumber="1744"><td class="num" id="LN1744">1744</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1745"><td class="num" id="LN1745">1745</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1746"><td class="num" id="LN1746">1746</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1747"><td class="num" id="LN1747">1747</td><td class="line"> <span class='keyword'>return</span> matches;</td></tr> +<tr class="codeline" data-linenumber="1748"><td class="num" id="LN1748">1748</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1749"><td class="num" id="LN1749">1749</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1750"><td class="num" id="LN1750">1750</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1751"><td class="num" id="LN1751">1751</td><td class="line">_app_has_startup_id (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="1752"><td class="num" id="LN1752">1752</td><td class="line"> GsmApp *app,</td></tr> +<tr class="codeline" data-linenumber="1753"><td class="num" id="LN1753">1753</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id_a)</td></tr> +<tr class="codeline" data-linenumber="1754"><td class="num" id="LN1754">1754</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1755"><td class="num" id="LN1755">1755</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id_b;</td></tr> +<tr class="codeline" data-linenumber="1756"><td class="num" id="LN1756">1756</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1757"><td class="num" id="LN1757">1757</td><td class="line"> startup_id_b = gsm_app_peek_startup_id (app);</td></tr> +<tr class="codeline" data-linenumber="1758"><td class="num" id="LN1758">1758</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1759"><td class="num" id="LN1759">1759</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (startup_id_b)<span class='macro_popup'>((startup_id_b)==((void*)0)||(startup_id_b)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1760"><td class="num" id="LN1760">1760</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1761"><td class="num" id="LN1761">1761</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1762"><td class="num" id="LN1762">1762</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1763"><td class="num" id="LN1763">1763</td><td class="line"> <span class='keyword'>return</span> (strcmp (startup_id_a, startup_id_b) == 0);</td></tr> +<tr class="codeline" data-linenumber="1764"><td class="num" id="LN1764">1764</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1765"><td class="num" id="LN1765">1765</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1766"><td class="num" id="LN1766">1766</td><td class="line"><span class='keyword'>static</span> GsmApp *</td></tr> +<tr class="codeline" data-linenumber="1767"><td class="num" id="LN1767">1767</td><td class="line">find_app_for_startup_id (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="1768"><td class="num" id="LN1768">1768</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id)</td></tr> +<tr class="codeline" data-linenumber="1769"><td class="num" id="LN1769">1769</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1770"><td class="num" id="LN1770">1770</td><td class="line"> GsmApp *found_app;</td></tr> +<tr class="codeline" data-linenumber="1771"><td class="num" id="LN1771">1771</td><td class="line"> GSList *a;</td></tr> +<tr class="codeline" data-linenumber="1772"><td class="num" id="LN1772">1772</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1773"><td class="num" id="LN1773">1773</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1774"><td class="num" id="LN1774">1774</td><td class="line"> found_app = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1775"><td class="num" id="LN1775">1775</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1776"><td class="num" id="LN1776">1776</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1777"><td class="num" id="LN1777">1777</td><td class="line"> <span class='comment'>/* If we're starting up the session, try to match the new client</span></td></tr> +<tr class="codeline" data-linenumber="1778"><td class="num" id="LN1778">1778</td><td class="line"> <span class='comment'>* with one pending apps for the current phase. If not, try to match</span></td></tr> +<tr class="codeline" data-linenumber="1779"><td class="num" id="LN1779">1779</td><td class="line"> <span class='comment'>* with any of the autostarted apps. */</span></td></tr> +<tr class="codeline" data-linenumber="1780"><td class="num" id="LN1780">1780</td><td class="line"> <span class='keyword'>if</span> (priv->phase < GSM_MANAGER_PHASE_APPLICATION) {</td></tr> +<tr class="codeline" data-linenumber="1781"><td class="num" id="LN1781">1781</td><td class="line"> <span class='keyword'>for</span> (a = priv->pending_apps; a != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; a = a->next) {</td></tr> +<tr class="codeline" data-linenumber="1782"><td class="num" id="LN1782">1782</td><td class="line"> GsmApp *app = GSM_APP (a->data);</td></tr> +<tr class="codeline" data-linenumber="1783"><td class="num" id="LN1783">1783</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1784"><td class="num" id="LN1784">1784</td><td class="line"> <span class='keyword'>if</span> (strcmp (startup_id, gsm_app_peek_startup_id (app)) == 0) {</td></tr> +<tr class="codeline" data-linenumber="1785"><td class="num" id="LN1785">1785</td><td class="line"> found_app = app;</td></tr> +<tr class="codeline" data-linenumber="1786"><td class="num" id="LN1786">1786</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1787"><td class="num" id="LN1787">1787</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1788"><td class="num" id="LN1788">1788</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1789"><td class="num" id="LN1789">1789</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="1790"><td class="num" id="LN1790">1790</td><td class="line"> GsmApp *app;</td></tr> +<tr class="codeline" data-linenumber="1791"><td class="num" id="LN1791">1791</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1792"><td class="num" id="LN1792">1792</td><td class="line"> app = (GsmApp *)gsm_store_find (priv->apps,</td></tr> +<tr class="codeline" data-linenumber="1793"><td class="num" id="LN1793">1793</td><td class="line"> (GsmStoreFunc)_app_has_startup_id,</td></tr> +<tr class="codeline" data-linenumber="1794"><td class="num" id="LN1794">1794</td><td class="line"> (<span class='keyword'>char</span> *)startup_id);</td></tr> +<tr class="codeline" data-linenumber="1795"><td class="num" id="LN1795">1795</td><td class="line"> <span class='keyword'>if</span> (app != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1796"><td class="num" id="LN1796">1796</td><td class="line"> found_app = app;</td></tr> +<tr class="codeline" data-linenumber="1797"><td class="num" id="LN1797">1797</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1798"><td class="num" id="LN1798">1798</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1799"><td class="num" id="LN1799">1799</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1800"><td class="num" id="LN1800">1800</td><td class="line"> out:</td></tr> +<tr class="codeline" data-linenumber="1801"><td class="num" id="LN1801">1801</td><td class="line"> <span class='keyword'>return</span> found_app;</td></tr> +<tr class="codeline" data-linenumber="1802"><td class="num" id="LN1802">1802</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1803"><td class="num" id="LN1803">1803</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1804"><td class="num" id="LN1804">1804</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1805"><td class="num" id="LN1805">1805</td><td class="line">_disconnect_client (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="1806"><td class="num" id="LN1806">1806</td><td class="line"> GsmClient *client)</td></tr> +<tr class="codeline" data-linenumber="1807"><td class="num" id="LN1807">1807</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1808"><td class="num" id="LN1808">1808</td><td class="line"> gboolean is_condition_client;</td></tr> +<tr class="codeline" data-linenumber="1809"><td class="num" id="LN1809">1809</td><td class="line"> GsmApp *app;</td></tr> +<tr class="codeline" data-linenumber="1810"><td class="num" id="LN1810">1810</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="1811"><td class="num" id="LN1811">1811</td><td class="line"> gboolean <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> res;</td></tr> +<tr class="codeline" data-linenumber="1812"><td class="num" id="LN1812">1812</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *app_id;</td></tr> +<tr class="codeline" data-linenumber="1813"><td class="num" id="LN1813">1813</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id;</td></tr> +<tr class="codeline" data-linenumber="1814"><td class="num" id="LN1814">1814</td><td class="line"> gboolean app_restart;</td></tr> +<tr class="codeline" data-linenumber="1815"><td class="num" id="LN1815">1815</td><td class="line"> GsmClientRestartStyle client_restart_hint;</td></tr> +<tr class="codeline" data-linenumber="1816"><td class="num" id="LN1816">1816</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1817"><td class="num" id="LN1817">1817</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1818"><td class="num" id="LN1818">1818</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: disconnect client: %s"</span>, gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="1819"><td class="num" id="LN1819">1819</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1820"><td class="num" id="LN1820">1820</td><td class="line"> <span class='comment'>/* take a ref so it doesn't get finalized */</span></td></tr> +<tr class="codeline" data-linenumber="1821"><td class="num" id="LN1821">1821</td><td class="line"> <span class='macro'>g_object_ref (client)<span class='macro_popup'>((__typeof__ (client)) (g_object_ref) (client))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1822"><td class="num" id="LN1822">1822</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1823"><td class="num" id="LN1823">1823</td><td class="line"> gsm_client_set_status (client, GSM_CLIENT_FINISHED);</td></tr> +<tr class="codeline" data-linenumber="1824"><td class="num" id="LN1824">1824</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1825"><td class="num" id="LN1825">1825</td><td class="line"> is_condition_client = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1826"><td class="num" id="LN1826">1826</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1827"><td class="num" id="LN1827">1827</td><td class="line"> <span class='keyword'>if</span> (g_slist_find (priv->condition_clients, client)) {</td></tr> +<tr class="codeline" data-linenumber="1828"><td class="num" id="LN1828">1828</td><td class="line"> priv->condition_clients = g_slist_remove (priv->condition_clients, client);</td></tr> +<tr class="codeline" data-linenumber="1829"><td class="num" id="LN1829">1829</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1830"><td class="num" id="LN1830">1830</td><td class="line"> is_condition_client = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1831"><td class="num" id="LN1831">1831</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1832"><td class="num" id="LN1832">1832</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1833"><td class="num" id="LN1833">1833</td><td class="line"> <span class='comment'>/* remove any inhibitors for this client */</span></td></tr> +<tr class="codeline" data-linenumber="1834"><td class="num" id="LN1834">1834</td><td class="line"> gsm_store_foreach_remove (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="1835"><td class="num" id="LN1835">1835</td><td class="line"> (GsmStoreFunc)inhibitor_has_client_id,</td></tr> +<tr class="codeline" data-linenumber="1836"><td class="num" id="LN1836">1836</td><td class="line"> (gpointer)gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="1837"><td class="num" id="LN1837">1837</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1838"><td class="num" id="LN1838">1838</td><td class="line"> app = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1839"><td class="num" id="LN1839">1839</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1840"><td class="num" id="LN1840">1840</td><td class="line"> <span class='comment'>/* first try to match on startup ID */</span></td></tr> +<tr class="codeline" data-linenumber="1841"><td class="num" id="LN1841">1841</td><td class="line"> startup_id = gsm_client_peek_startup_id (client);</td></tr> +<tr class="codeline" data-linenumber="1842"><td class="num" id="LN1842">1842</td><td class="line"> <span class='keyword'>if</span> (! <span class='macro'>IS_STRING_EMPTY (startup_id)<span class='macro_popup'>((startup_id)==((void*)0)||(startup_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1843"><td class="num" id="LN1843">1843</td><td class="line"> app = find_app_for_startup_id (manager, startup_id);</td></tr> +<tr class="codeline" data-linenumber="1844"><td class="num" id="LN1844">1844</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1845"><td class="num" id="LN1845">1845</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1846"><td class="num" id="LN1846">1846</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1847"><td class="num" id="LN1847">1847</td><td class="line"> <span class='comment'>/* then try to find matching app-id */</span></td></tr> +<tr class="codeline" data-linenumber="1848"><td class="num" id="LN1848">1848</td><td class="line"> <span class='keyword'>if</span> (app == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1849"><td class="num" id="LN1849">1849</td><td class="line"> app_id = gsm_client_peek_app_id (client);</td></tr> +<tr class="codeline" data-linenumber="1850"><td class="num" id="LN1850">1850</td><td class="line"> <span class='keyword'>if</span> (! <span class='macro'>IS_STRING_EMPTY (app_id)<span class='macro_popup'>((app_id)==((void*)0)||(app_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1851"><td class="num" id="LN1851">1851</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: disconnect for app '%s'"</span>, app_id);</td></tr> +<tr class="codeline" data-linenumber="1852"><td class="num" id="LN1852">1852</td><td class="line"> app = find_app_for_app_id (manager, app_id);</td></tr> +<tr class="codeline" data-linenumber="1853"><td class="num" id="LN1853">1853</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1854"><td class="num" id="LN1854">1854</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1855"><td class="num" id="LN1855">1855</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1856"><td class="num" id="LN1856">1856</td><td class="line"> <span class='keyword'>if</span> (priv->phase == GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="1857"><td class="num" id="LN1857">1857</td><td class="line"> <span class='comment'>/* Instead of answering our end session query, the client just exited.</span></td></tr> +<tr class="codeline" data-linenumber="1858"><td class="num" id="LN1858">1858</td><td class="line"> <span class='comment'>* Treat that as an "okay, end the session" answer.</span></td></tr> +<tr class="codeline" data-linenumber="1859"><td class="num" id="LN1859">1859</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="1860"><td class="num" id="LN1860">1860</td><td class="line"> <span class='comment'>* This call implicitly removes any inhibitors for the client, along</span></td></tr> +<tr class="codeline" data-linenumber="1861"><td class="num" id="LN1861">1861</td><td class="line"> <span class='comment'>* with removing the client from the pending query list.</span></td></tr> +<tr class="codeline" data-linenumber="1862"><td class="num" id="LN1862">1862</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1863"><td class="num" id="LN1863">1863</td><td class="line"> _handle_client_end_session_response (manager,</td></tr> +<tr class="codeline" data-linenumber="1864"><td class="num" id="LN1864">1864</td><td class="line"> client,</td></tr> +<tr class="codeline" data-linenumber="1865"><td class="num" id="LN1865">1865</td><td class="line"> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1866"><td class="num" id="LN1866">1866</td><td class="line"> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1867"><td class="num" id="LN1867">1867</td><td class="line"> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="1868"><td class="num" id="LN1868">1868</td><td class="line"> <span class='string_literal'>"Client exited in "</span></td></tr> +<tr class="codeline" data-linenumber="1869"><td class="num" id="LN1869">1869</td><td class="line"> <span class='string_literal'>"query end session phase "</span></td></tr> +<tr class="codeline" data-linenumber="1870"><td class="num" id="LN1870">1870</td><td class="line"> <span class='string_literal'>"instead of end session "</span></td></tr> +<tr class="codeline" data-linenumber="1871"><td class="num" id="LN1871">1871</td><td class="line"> <span class='string_literal'>"phase"</span>);</td></tr> +<tr class="codeline" data-linenumber="1872"><td class="num" id="LN1872">1872</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1873"><td class="num" id="LN1873">1873</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1874"><td class="num" id="LN1874">1874</td><td class="line"> <span class='keyword'>if</span> (priv->dbus_disconnected && GSM_IS_DBUS_CLIENT (client)) {</td></tr> +<tr class="codeline" data-linenumber="1875"><td class="num" id="LN1875">1875</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: dbus disconnected, not restarting application"</span>);</td></tr> +<tr class="codeline" data-linenumber="1876"><td class="num" id="LN1876">1876</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1877"><td class="num" id="LN1877">1877</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1878"><td class="num" id="LN1878">1878</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1879"><td class="num" id="LN1879">1879</td><td class="line"> <span class='keyword'>if</span> (app == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1880"><td class="num" id="LN1880">1880</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: unable to find application for client - not restarting"</span>);</td></tr> +<tr class="codeline" data-linenumber="1881"><td class="num" id="LN1881">1881</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1882"><td class="num" id="LN1882">1882</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1883"><td class="num" id="LN1883">1883</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1884"><td class="num" id="LN1884">1884</td><td class="line"> <span class='keyword'>if</span> (priv->phase >= GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="1885"><td class="num" id="LN1885">1885</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: in shutdown, not restarting application"</span>);</td></tr> +<tr class="codeline" data-linenumber="1886"><td class="num" id="LN1886">1886</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1887"><td class="num" id="LN1887">1887</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1888"><td class="num" id="LN1888">1888</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1889"><td class="num" id="LN1889">1889</td><td class="line"> app_restart = gsm_app_peek_autorestart (app);</td></tr> +<tr class="codeline" data-linenumber="1890"><td class="num" id="LN1890">1890</td><td class="line"> client_restart_hint = gsm_client_peek_restart_style_hint (client);</td></tr> +<tr class="codeline" data-linenumber="1891"><td class="num" id="LN1891">1891</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1892"><td class="num" id="LN1892">1892</td><td class="line"> <span class='comment'>/* allow legacy clients to override the app info */</span></td></tr> +<tr class="codeline" data-linenumber="1893"><td class="num" id="LN1893">1893</td><td class="line"> <span class='keyword'>if</span> (! app_restart</td></tr> +<tr class="codeline" data-linenumber="1894"><td class="num" id="LN1894">1894</td><td class="line"> && client_restart_hint != GSM_CLIENT_RESTART_IMMEDIATELY) {</td></tr> +<tr class="codeline" data-linenumber="1895"><td class="num" id="LN1895">1895</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: autorestart not set, not restarting application"</span>);</td></tr> +<tr class="codeline" data-linenumber="1896"><td class="num" id="LN1896">1896</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1897"><td class="num" id="LN1897">1897</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1898"><td class="num" id="LN1898">1898</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1899"><td class="num" id="LN1899">1899</td><td class="line"> <span class='keyword'>if</span> (is_condition_client) {</td></tr> +<tr class="codeline" data-linenumber="1900"><td class="num" id="LN1900">1900</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: app conditionally disabled, not restarting application"</span>);</td></tr> +<tr class="codeline" data-linenumber="1901"><td class="num" id="LN1901">1901</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="1902"><td class="num" id="LN1902">1902</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1903"><td class="num" id="LN1903">1903</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1904"><td class="num" id="LN1904">1904</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: restarting app"</span>);</td></tr> +<tr class="codeline" data-linenumber="1905"><td class="num" id="LN1905">1905</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1906"><td class="num" id="LN1906">1906</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1907"><td class="num" id="LN1907">1907</td><td class="line"> res = gsm_app_restart (app, &error);</td></tr> +<tr class="codeline" data-linenumber="1908"><td class="num" id="LN1908">1908</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1909"><td class="num" id="LN1909">1909</td><td class="line"> g_warning (<span class='string_literal'>"Error on restarting session managed app: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="1910"><td class="num" id="LN1910">1910</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="1911"><td class="num" id="LN1911">1911</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1912"><td class="num" id="LN1912">1912</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1913"><td class="num" id="LN1913">1913</td><td class="line"> out:</td></tr> +<tr class="codeline" data-linenumber="1914"><td class="num" id="LN1914">1914</td><td class="line"> g_object_unref (client);</td></tr> +<tr class="codeline" data-linenumber="1915"><td class="num" id="LN1915">1915</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1916"><td class="num" id="LN1916">1916</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1917"><td class="num" id="LN1917">1917</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span> {</td></tr> +<tr class="codeline" data-linenumber="1918"><td class="num" id="LN1918">1918</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *service_name;</td></tr> +<tr class="codeline" data-linenumber="1919"><td class="num" id="LN1919">1919</td><td class="line"> GsmManager *manager;</td></tr> +<tr class="codeline" data-linenumber="1920"><td class="num" id="LN1920">1920</td><td class="line">} RemoveClientData;</td></tr> +<tr class="codeline" data-linenumber="1921"><td class="num" id="LN1921">1921</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1922"><td class="num" id="LN1922">1922</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1923"><td class="num" id="LN1923">1923</td><td class="line">_disconnect_dbus_client (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="1924"><td class="num" id="LN1924">1924</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="1925"><td class="num" id="LN1925">1925</td><td class="line"> RemoveClientData *data)</td></tr> +<tr class="codeline" data-linenumber="1926"><td class="num" id="LN1926">1926</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1927"><td class="num" id="LN1927">1927</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *name;</td></tr> +<tr class="codeline" data-linenumber="1928"><td class="num" id="LN1928">1928</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1929"><td class="num" id="LN1929">1929</td><td class="line"> <span class='keyword'>if</span> (! GSM_IS_DBUS_CLIENT (client)) {</td></tr> +<tr class="codeline" data-linenumber="1930"><td class="num" id="LN1930">1930</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1931"><td class="num" id="LN1931">1931</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1932"><td class="num" id="LN1932">1932</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1933"><td class="num" id="LN1933">1933</td><td class="line"> <span class='comment'>/* If no service name, then we simply disconnect all clients */</span></td></tr> +<tr class="codeline" data-linenumber="1934"><td class="num" id="LN1934">1934</td><td class="line"> <span class='keyword'>if</span> (!data->service_name) {</td></tr> +<tr class="codeline" data-linenumber="1935"><td class="num" id="LN1935">1935</td><td class="line"> _disconnect_client (data->manager, client);</td></tr> +<tr class="codeline" data-linenumber="1936"><td class="num" id="LN1936">1936</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1937"><td class="num" id="LN1937">1937</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1938"><td class="num" id="LN1938">1938</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1939"><td class="num" id="LN1939">1939</td><td class="line"> name = gsm_dbus_client_get_bus_name (GSM_DBUS_CLIENT (client));</td></tr> +<tr class="codeline" data-linenumber="1940"><td class="num" id="LN1940">1940</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (name)<span class='macro_popup'>((name)==((void*)0)||(name)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1941"><td class="num" id="LN1941">1941</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1942"><td class="num" id="LN1942">1942</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1943"><td class="num" id="LN1943">1943</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1944"><td class="num" id="LN1944">1944</td><td class="line"> <span class='keyword'>if</span> (strcmp (data->service_name, name) == 0) {</td></tr> +<tr class="codeline" data-linenumber="1945"><td class="num" id="LN1945">1945</td><td class="line"> _disconnect_client (data->manager, client);</td></tr> +<tr class="codeline" data-linenumber="1946"><td class="num" id="LN1946">1946</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1947"><td class="num" id="LN1947">1947</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1948"><td class="num" id="LN1948">1948</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1949"><td class="num" id="LN1949">1949</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1950"><td class="num" id="LN1950">1950</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1951"><td class="num" id="LN1951">1951</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1952"><td class="num" id="LN1952">1952</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="1953"><td class="num" id="LN1953">1953</td><td class="line"> <span class='comment'>* remove_clients_for_connection:</span></td></tr> +<tr class="codeline" data-linenumber="1954"><td class="num" id="LN1954">1954</td><td class="line"> <span class='comment'>* @manager: a #GsmManager</span></td></tr> +<tr class="codeline" data-linenumber="1955"><td class="num" id="LN1955">1955</td><td class="line"> <span class='comment'>* @service_name: a service name</span></td></tr> +<tr class="codeline" data-linenumber="1956"><td class="num" id="LN1956">1956</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="1957"><td class="num" id="LN1957">1957</td><td class="line"> <span class='comment'>* Disconnects clients that own @service_name.</span></td></tr> +<tr class="codeline" data-linenumber="1958"><td class="num" id="LN1958">1958</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="1959"><td class="num" id="LN1959">1959</td><td class="line"> <span class='comment'>* If @service_name is NULL, then disconnects all clients for the connection.</span></td></tr> +<tr class="codeline" data-linenumber="1960"><td class="num" id="LN1960">1960</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="1961"><td class="num" id="LN1961">1961</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="1962"><td class="num" id="LN1962">1962</td><td class="line">remove_clients_for_connection (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="1963"><td class="num" id="LN1963">1963</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *service_name)</td></tr> +<tr class="codeline" data-linenumber="1964"><td class="num" id="LN1964">1964</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1965"><td class="num" id="LN1965">1965</td><td class="line"> RemoveClientData data;</td></tr> +<tr class="codeline" data-linenumber="1966"><td class="num" id="LN1966">1966</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="1967"><td class="num" id="LN1967">1967</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1968"><td class="num" id="LN1968">1968</td><td class="line"> data.service_name = service_name;</td></tr> +<tr class="codeline" data-linenumber="1969"><td class="num" id="LN1969">1969</td><td class="line"> data.manager = manager;</td></tr> +<tr class="codeline" data-linenumber="1970"><td class="num" id="LN1970">1970</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="1971"><td class="num" id="LN1971">1971</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1972"><td class="num" id="LN1972">1972</td><td class="line"> <span class='comment'>/* disconnect dbus clients for name */</span></td></tr> +<tr class="codeline" data-linenumber="1973"><td class="num" id="LN1973">1973</td><td class="line"> gsm_store_foreach_remove (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="1974"><td class="num" id="LN1974">1974</td><td class="line"> (GsmStoreFunc)_disconnect_dbus_client,</td></tr> +<tr class="codeline" data-linenumber="1975"><td class="num" id="LN1975">1975</td><td class="line"> &data);</td></tr> +<tr class="codeline" data-linenumber="1976"><td class="num" id="LN1976">1976</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1977"><td class="num" id="LN1977">1977</td><td class="line"> <span class='keyword'>if</span> (priv->phase >= GSM_MANAGER_PHASE_QUERY_END_SESSION</td></tr> +<tr class="codeline" data-linenumber="1978"><td class="num" id="LN1978">1978</td><td class="line"> && gsm_store_size (priv->clients) == 0) {</td></tr> +<tr class="codeline" data-linenumber="1979"><td class="num" id="LN1979">1979</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: last client disconnected - exiting"</span>);</td></tr> +<tr class="codeline" data-linenumber="1980"><td class="num" id="LN1980">1980</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="1981"><td class="num" id="LN1981">1981</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="1982"><td class="num" id="LN1982">1982</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="1983"><td class="num" id="LN1983">1983</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1984"><td class="num" id="LN1984">1984</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="1985"><td class="num" id="LN1985">1985</td><td class="line">inhibitor_has_bus_name (gpointer key,</td></tr> +<tr class="codeline" data-linenumber="1986"><td class="num" id="LN1986">1986</td><td class="line"> GsmInhibitor *inhibitor,</td></tr> +<tr class="codeline" data-linenumber="1987"><td class="num" id="LN1987">1987</td><td class="line"> RemoveClientData *data)</td></tr> +<tr class="codeline" data-linenumber="1988"><td class="num" id="LN1988">1988</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="1989"><td class="num" id="LN1989">1989</td><td class="line"> gboolean matches;</td></tr> +<tr class="codeline" data-linenumber="1990"><td class="num" id="LN1990">1990</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *bus_name_b;</td></tr> +<tr class="codeline" data-linenumber="1991"><td class="num" id="LN1991">1991</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1992"><td class="num" id="LN1992">1992</td><td class="line"> bus_name_b = gsm_inhibitor_peek_bus_name (inhibitor);</td></tr> +<tr class="codeline" data-linenumber="1993"><td class="num" id="LN1993">1993</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="1994"><td class="num" id="LN1994">1994</td><td class="line"> matches = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="1995"><td class="num" id="LN1995">1995</td><td class="line"> <span class='keyword'>if</span> (! <span class='macro'>IS_STRING_EMPTY (data->service_name)<span class='macro_popup'>((data->service_name)==((void*)0)||(data->service_name)<br>[0]=='\0')</span></span> && ! <span class='macro'>IS_STRING_EMPTY (bus_name_b)<span class='macro_popup'>((bus_name_b)==((void*)0)||(bus_name_b)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="1996"><td class="num" id="LN1996">1996</td><td class="line"> matches = (strcmp (data->service_name, bus_name_b) == 0);</td></tr> +<tr class="codeline" data-linenumber="1997"><td class="num" id="LN1997">1997</td><td class="line"> <span class='keyword'>if</span> (matches) {</td></tr> +<tr class="codeline" data-linenumber="1998"><td class="num" id="LN1998">1998</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: removing inhibitor from %s for reason '%s' on connection %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="1999"><td class="num" id="LN1999">1999</td><td class="line"> gsm_inhibitor_peek_app_id (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="2000"><td class="num" id="LN2000">2000</td><td class="line"> gsm_inhibitor_peek_reason (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="2001"><td class="num" id="LN2001">2001</td><td class="line"> gsm_inhibitor_peek_bus_name (inhibitor));</td></tr> +<tr class="codeline" data-linenumber="2002"><td class="num" id="LN2002">2002</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2003"><td class="num" id="LN2003">2003</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2004"><td class="num" id="LN2004">2004</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2005"><td class="num" id="LN2005">2005</td><td class="line"> <span class='keyword'>return</span> matches;</td></tr> +<tr class="codeline" data-linenumber="2006"><td class="num" id="LN2006">2006</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2007"><td class="num" id="LN2007">2007</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2008"><td class="num" id="LN2008">2008</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2009"><td class="num" id="LN2009">2009</td><td class="line">remove_inhibitors_for_connection (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="2010"><td class="num" id="LN2010">2010</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *service_name)</td></tr> +<tr class="codeline" data-linenumber="2011"><td class="num" id="LN2011">2011</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2012"><td class="num" id="LN2012">2012</td><td class="line"> guint <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> n_removed;</td></tr> +<tr class="codeline" data-linenumber="2013"><td class="num" id="LN2013">2013</td><td class="line"> RemoveClientData data;</td></tr> +<tr class="codeline" data-linenumber="2014"><td class="num" id="LN2014">2014</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2015"><td class="num" id="LN2015">2015</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2016"><td class="num" id="LN2016">2016</td><td class="line"> data.service_name = service_name;</td></tr> +<tr class="codeline" data-linenumber="2017"><td class="num" id="LN2017">2017</td><td class="line"> data.manager = manager;</td></tr> +<tr class="codeline" data-linenumber="2018"><td class="num" id="LN2018">2018</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2019"><td class="num" id="LN2019">2019</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2020"><td class="num" id="LN2020">2020</td><td class="line"> debug_inhibitors (manager);</td></tr> +<tr class="codeline" data-linenumber="2021"><td class="num" id="LN2021">2021</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2022"><td class="num" id="LN2022">2022</td><td class="line"> n_removed = gsm_store_foreach_remove (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="2023"><td class="num" id="LN2023">2023</td><td class="line"> (GsmStoreFunc)inhibitor_has_bus_name,</td></tr> +<tr class="codeline" data-linenumber="2024"><td class="num" id="LN2024">2024</td><td class="line"> &data);</td></tr> +<tr class="codeline" data-linenumber="2025"><td class="num" id="LN2025">2025</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2026"><td class="num" id="LN2026">2026</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2027"><td class="num" id="LN2027">2027</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2028"><td class="num" id="LN2028">2028</td><td class="line">bus_name_owner_changed (DBusGProxy *bus_proxy,</td></tr> +<tr class="codeline" data-linenumber="2029"><td class="num" id="LN2029">2029</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *service_name,</td></tr> +<tr class="codeline" data-linenumber="2030"><td class="num" id="LN2030">2030</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *old_service_name,</td></tr> +<tr class="codeline" data-linenumber="2031"><td class="num" id="LN2031">2031</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *new_service_name,</td></tr> +<tr class="codeline" data-linenumber="2032"><td class="num" id="LN2032">2032</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2033"><td class="num" id="LN2033">2033</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2034"><td class="num" id="LN2034">2034</td><td class="line"> <span class='keyword'>if</span> (strlen (new_service_name) == 0</td></tr> +<tr class="codeline" data-linenumber="2035"><td class="num" id="LN2035">2035</td><td class="line"> && strlen (old_service_name) > 0) {</td></tr> +<tr class="codeline" data-linenumber="2036"><td class="num" id="LN2036">2036</td><td class="line"> <span class='comment'>/* service removed */</span></td></tr> +<tr class="codeline" data-linenumber="2037"><td class="num" id="LN2037">2037</td><td class="line"> remove_inhibitors_for_connection (manager, old_service_name);</td></tr> +<tr class="codeline" data-linenumber="2038"><td class="num" id="LN2038">2038</td><td class="line"> remove_clients_for_connection (manager, old_service_name);</td></tr> +<tr class="codeline" data-linenumber="2039"><td class="num" id="LN2039">2039</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (strlen (old_service_name) == 0</td></tr> +<tr class="codeline" data-linenumber="2040"><td class="num" id="LN2040">2040</td><td class="line"> && strlen (new_service_name) > 0) {</td></tr> +<tr class="codeline" data-linenumber="2041"><td class="num" id="LN2041">2041</td><td class="line"> <span class='comment'>/* service added */</span></td></tr> +<tr class="codeline" data-linenumber="2042"><td class="num" id="LN2042">2042</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2043"><td class="num" id="LN2043">2043</td><td class="line"> <span class='comment'>/* use this if we support automatically registering</span></td></tr> +<tr class="codeline" data-linenumber="2044"><td class="num" id="LN2044">2044</td><td class="line"> <span class='comment'>* well known bus names */</span></td></tr> +<tr class="codeline" data-linenumber="2045"><td class="num" id="LN2045">2045</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2046"><td class="num" id="LN2046">2046</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2047"><td class="num" id="LN2047">2047</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2048"><td class="num" id="LN2048">2048</td><td class="line"><span class='keyword'>static</span> DBusHandlerResult</td></tr> +<tr class="codeline" data-linenumber="2049"><td class="num" id="LN2049">2049</td><td class="line">gsm_manager_bus_filter (DBusConnection *connection,</td></tr> +<tr class="codeline" data-linenumber="2050"><td class="num" id="LN2050">2050</td><td class="line"> DBusMessage *message,</td></tr> +<tr class="codeline" data-linenumber="2051"><td class="num" id="LN2051">2051</td><td class="line"> <span class='keyword'>void</span> *user_data)</td></tr> +<tr class="codeline" data-linenumber="2052"><td class="num" id="LN2052">2052</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2053"><td class="num" id="LN2053">2053</td><td class="line"> GsmManager *manager;</td></tr> +<tr class="codeline" data-linenumber="2054"><td class="num" id="LN2054">2054</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2055"><td class="num" id="LN2055">2055</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2056"><td class="num" id="LN2056">2056</td><td class="line"> manager = GSM_MANAGER (user_data);</td></tr> +<tr class="codeline" data-linenumber="2057"><td class="num" id="LN2057">2057</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2058"><td class="num" id="LN2058">2058</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2059"><td class="num" id="LN2059">2059</td><td class="line"> <span class='keyword'>if</span> (dbus_message_is_signal (message,</td></tr> +<tr class="codeline" data-linenumber="2060"><td class="num" id="LN2060">2060</td><td class="line"> <span class='macro'>DBUS_INTERFACE_LOCAL<span class='macro_popup'>"org.freedesktop.DBus.Local"</span></span>, <span class='string_literal'>"Disconnected"</span>) &&</td></tr> +<tr class="codeline" data-linenumber="2061"><td class="num" id="LN2061">2061</td><td class="line"> strcmp (dbus_message_get_path (message), <span class='macro'>DBUS_PATH_LOCAL<span class='macro_popup'>"/org/freedesktop/DBus/Local"</span></span>) == 0) {</td></tr> +<tr class="codeline" data-linenumber="2062"><td class="num" id="LN2062">2062</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: dbus disconnected; disconnecting dbus clients..."</span>);</td></tr> +<tr class="codeline" data-linenumber="2063"><td class="num" id="LN2063">2063</td><td class="line"> priv->dbus_disconnected = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2064"><td class="num" id="LN2064">2064</td><td class="line"> remove_clients_for_connection (manager, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2065"><td class="num" id="LN2065">2065</td><td class="line"> <span class='comment'>/* let other filters get this disconnected signal, so that they</span></td></tr> +<tr class="codeline" data-linenumber="2066"><td class="num" id="LN2066">2066</td><td class="line"> <span class='comment'>* can handle it too */</span></td></tr> +<tr class="codeline" data-linenumber="2067"><td class="num" id="LN2067">2067</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2068"><td class="num" id="LN2068">2068</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2069"><td class="num" id="LN2069">2069</td><td class="line"> <span class='keyword'>return</span> DBUS_HANDLER_RESULT_NOT_YET_HANDLED;</td></tr> +<tr class="codeline" data-linenumber="2070"><td class="num" id="LN2070">2070</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2071"><td class="num" id="LN2071">2071</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2072"><td class="num" id="LN2072">2072</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="2073"><td class="num" id="LN2073">2073</td><td class="line">register_manager (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2074"><td class="num" id="LN2074">2074</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2075"><td class="num" id="LN2075">2075</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2076"><td class="num" id="LN2076">2076</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2077"><td class="num" id="LN2077">2077</td><td class="line"> DBusConnection *connection;</td></tr> +<tr class="codeline" data-linenumber="2078"><td class="num" id="LN2078">2078</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2079"><td class="num" id="LN2079">2079</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2080"><td class="num" id="LN2080">2080</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2081"><td class="num" id="LN2081">2081</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2082"><td class="num" id="LN2082">2082</td><td class="line"> priv->connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);</td></tr> +<tr class="codeline" data-linenumber="2083"><td class="num" id="LN2083">2083</td><td class="line"> <span class='keyword'>if</span> (priv->connection == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2084"><td class="num" id="LN2084">2084</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2085"><td class="num" id="LN2085">2085</td><td class="line"> g_critical (<span class='string_literal'>"error getting session bus: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="2086"><td class="num" id="LN2086">2086</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="2087"><td class="num" id="LN2087">2087</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2088"><td class="num" id="LN2088">2088</td><td class="line"> exit (1);</td></tr> +<tr class="codeline" data-linenumber="2089"><td class="num" id="LN2089">2089</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2090"><td class="num" id="LN2090">2090</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2091"><td class="num" id="LN2091">2091</td><td class="line"> connection = dbus_g_connection_get_connection (priv->connection);</td></tr> +<tr class="codeline" data-linenumber="2092"><td class="num" id="LN2092">2092</td><td class="line"> dbus_connection_add_filter (connection,</td></tr> +<tr class="codeline" data-linenumber="2093"><td class="num" id="LN2093">2093</td><td class="line"> gsm_manager_bus_filter,</td></tr> +<tr class="codeline" data-linenumber="2094"><td class="num" id="LN2094">2094</td><td class="line"> manager, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2095"><td class="num" id="LN2095">2095</td><td class="line"> priv->dbus_disconnected = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2096"><td class="num" id="LN2096">2096</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2097"><td class="num" id="LN2097">2097</td><td class="line"> priv->bus_proxy = dbus_g_proxy_new_for_name (priv->connection,</td></tr> +<tr class="codeline" data-linenumber="2098"><td class="num" id="LN2098">2098</td><td class="line"> <span class='macro'>DBUS_SERVICE_DBUS<span class='macro_popup'>"org.freedesktop.DBus"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2099"><td class="num" id="LN2099">2099</td><td class="line"> <span class='macro'>DBUS_PATH_DBUS<span class='macro_popup'>"/org/freedesktop/DBus"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2100"><td class="num" id="LN2100">2100</td><td class="line"> <span class='macro'>DBUS_INTERFACE_DBUS<span class='macro_popup'>"org.freedesktop.DBus"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2101"><td class="num" id="LN2101">2101</td><td class="line"> dbus_g_proxy_add_signal (priv->bus_proxy,</td></tr> +<tr class="codeline" data-linenumber="2102"><td class="num" id="LN2102">2102</td><td class="line"> <span class='string_literal'>"NameOwnerChanged"</span>,</td></tr> +<tr class="codeline" data-linenumber="2103"><td class="num" id="LN2103">2103</td><td class="line"> <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2104"><td class="num" id="LN2104">2104</td><td class="line"> <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2105"><td class="num" id="LN2105">2105</td><td class="line"> <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2106"><td class="num" id="LN2106">2106</td><td class="line"> <span class='macro'>G_TYPE_INVALID<span class='macro_popup'>((GType) ((0) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2107"><td class="num" id="LN2107">2107</td><td class="line"> dbus_g_proxy_connect_signal (priv->bus_proxy,</td></tr> +<tr class="codeline" data-linenumber="2108"><td class="num" id="LN2108">2108</td><td class="line"> <span class='string_literal'>"NameOwnerChanged"</span>,</td></tr> +<tr class="codeline" data-linenumber="2109"><td class="num" id="LN2109">2109</td><td class="line"> <span class='macro'>G_CALLBACK (bus_name_owner_changed)<span class='macro_popup'>((GCallback) (bus_name_owner_changed))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2110"><td class="num" id="LN2110">2110</td><td class="line"> manager,</td></tr> +<tr class="codeline" data-linenumber="2111"><td class="num" id="LN2111">2111</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2112"><td class="num" id="LN2112">2112</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2113"><td class="num" id="LN2113">2113</td><td class="line"> dbus_g_connection_register_g_object (priv->connection, <span class='macro'>GSM_MANAGER_DBUS_PATH<span class='macro_popup'>"/org/gnome/SessionManager"</span></span>, <span class='macro'>G_OBJECT (manager)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((manager)), (((GType) ((20) << (2))))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2114"><td class="num" id="LN2114">2114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2115"><td class="num" id="LN2115">2115</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2116"><td class="num" id="LN2116">2116</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2117"><td class="num" id="LN2117">2117</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2118"><td class="num" id="LN2118">2118</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2119"><td class="num" id="LN2119">2119</td><td class="line">gsm_manager_set_failsafe (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="2120"><td class="num" id="LN2120">2120</td><td class="line"> gboolean enabled)</td></tr> +<tr class="codeline" data-linenumber="2121"><td class="num" id="LN2121">2121</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2122"><td class="num" id="LN2122">2122</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2123"><td class="num" id="LN2123">2123</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2124"><td class="num" id="LN2124">2124</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_MANAGER (manager))<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2125"><td class="num" id="LN2125">2125</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2126"><td class="num" id="LN2126">2126</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2127"><td class="num" id="LN2127">2127</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2128"><td class="num" id="LN2128">2128</td><td class="line"> priv->failsafe = enabled;</td></tr> +<tr class="codeline" data-linenumber="2129"><td class="num" id="LN2129">2129</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2130"><td class="num" id="LN2130">2130</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2131"><td class="num" id="LN2131">2131</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="2132"><td class="num" id="LN2132">2132</td><td class="line">_client_has_startup_id (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="2133"><td class="num" id="LN2133">2133</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="2134"><td class="num" id="LN2134">2134</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id_a)</td></tr> +<tr class="codeline" data-linenumber="2135"><td class="num" id="LN2135">2135</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2136"><td class="num" id="LN2136">2136</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id_b;</td></tr> +<tr class="codeline" data-linenumber="2137"><td class="num" id="LN2137">2137</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2138"><td class="num" id="LN2138">2138</td><td class="line"> startup_id_b = gsm_client_peek_startup_id (client);</td></tr> +<tr class="codeline" data-linenumber="2139"><td class="num" id="LN2139">2139</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2140"><td class="num" id="LN2140">2140</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (startup_id_b)<span class='macro_popup'>((startup_id_b)==((void*)0)||(startup_id_b)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2141"><td class="num" id="LN2141">2141</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2142"><td class="num" id="LN2142">2142</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2143"><td class="num" id="LN2143">2143</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2144"><td class="num" id="LN2144">2144</td><td class="line"> <span class='keyword'>return</span> (strcmp (startup_id_a, startup_id_b) == 0);</td></tr> +<tr class="codeline" data-linenumber="2145"><td class="num" id="LN2145">2145</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2146"><td class="num" id="LN2146">2146</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2147"><td class="num" id="LN2147">2147</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2148"><td class="num" id="LN2148">2148</td><td class="line">on_client_disconnected (GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="2149"><td class="num" id="LN2149">2149</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2150"><td class="num" id="LN2150">2150</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2151"><td class="num" id="LN2151">2151</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2152"><td class="num" id="LN2152">2152</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2153"><td class="num" id="LN2153">2153</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: disconnect client"</span>);</td></tr> +<tr class="codeline" data-linenumber="2154"><td class="num" id="LN2154">2154</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2155"><td class="num" id="LN2155">2155</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2156"><td class="num" id="LN2156">2156</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2157"><td class="num" id="LN2157">2157</td><td class="line"> _disconnect_client (manager, client);</td></tr> +<tr class="codeline" data-linenumber="2158"><td class="num" id="LN2158">2158</td><td class="line"> gsm_store_remove (priv->clients, gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="2159"><td class="num" id="LN2159">2159</td><td class="line"> <span class='keyword'>if</span> (priv->phase >= GSM_MANAGER_PHASE_QUERY_END_SESSION</td></tr> +<tr class="codeline" data-linenumber="2160"><td class="num" id="LN2160">2160</td><td class="line"> && gsm_store_size (priv->clients) == 0) {</td></tr> +<tr class="codeline" data-linenumber="2161"><td class="num" id="LN2161">2161</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: last client disconnected - exiting"</span>);</td></tr> +<tr class="codeline" data-linenumber="2162"><td class="num" id="LN2162">2162</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="2163"><td class="num" id="LN2163">2163</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2164"><td class="num" id="LN2164">2164</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2165"><td class="num" id="LN2165">2165</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2166"><td class="num" id="LN2166">2166</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="2167"><td class="num" id="LN2167">2167</td><td class="line">on_xsmp_client_register_request (GsmXSMPClient *client,</td></tr> +<tr class="codeline" data-linenumber="2168"><td class="num" id="LN2168">2168</td><td class="line"> <span class='keyword'>char</span> **id,</td></tr> +<tr class="codeline" data-linenumber="2169"><td class="num" id="LN2169">2169</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2170"><td class="num" id="LN2170">2170</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2171"><td class="num" id="LN2171">2171</td><td class="line"> gboolean handled;</td></tr> +<tr class="codeline" data-linenumber="2172"><td class="num" id="LN2172">2172</td><td class="line"> <span class='keyword'>char</span> *new_id;</td></tr> +<tr class="codeline" data-linenumber="2173"><td class="num" id="LN2173">2173</td><td class="line"> GsmApp *app;</td></tr> +<tr class="codeline" data-linenumber="2174"><td class="num" id="LN2174">2174</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2175"><td class="num" id="LN2175">2175</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2176"><td class="num" id="LN2176">2176</td><td class="line"> handled = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2177"><td class="num" id="LN2177">2177</td><td class="line"> new_id = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2178"><td class="num" id="LN2178">2178</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2179"><td class="num" id="LN2179">2179</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2180"><td class="num" id="LN2180">2180</td><td class="line"> <span class='keyword'>if</span> (priv->phase >= GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="2181"><td class="num" id="LN2181">2181</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="2182"><td class="num" id="LN2182">2182</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2183"><td class="num" id="LN2183">2183</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2184"><td class="num" id="LN2184">2184</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (*id)<span class='macro_popup'>((*id)==((void*)0)||(*id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2185"><td class="num" id="LN2185">2185</td><td class="line"> new_id = gsm_util_generate_startup_id ();</td></tr> +<tr class="codeline" data-linenumber="2186"><td class="num" id="LN2186">2186</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2187"><td class="num" id="LN2187">2187</td><td class="line"> GsmClient *sm_client;</td></tr> +<tr class="codeline" data-linenumber="2188"><td class="num" id="LN2188">2188</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2189"><td class="num" id="LN2189">2189</td><td class="line"> sm_client = (GsmClient *)gsm_store_find (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="2190"><td class="num" id="LN2190">2190</td><td class="line"> (GsmStoreFunc)_client_has_startup_id,</td></tr> +<tr class="codeline" data-linenumber="2191"><td class="num" id="LN2191">2191</td><td class="line"> *id);</td></tr> +<tr class="codeline" data-linenumber="2192"><td class="num" id="LN2192">2192</td><td class="line"> <span class='comment'>/* We can't have two clients with the same id. */</span></td></tr> +<tr class="codeline" data-linenumber="2193"><td class="num" id="LN2193">2193</td><td class="line"> <span class='keyword'>if</span> (sm_client != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2194"><td class="num" id="LN2194">2194</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="2195"><td class="num" id="LN2195">2195</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2196"><td class="num" id="LN2196">2196</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2197"><td class="num" id="LN2197">2197</td><td class="line"> new_id = <span class='macro'>g_strdup (*id)<span class='macro_popup'>g_strdup_inline (*id)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2198"><td class="num" id="LN2198">2198</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2199"><td class="num" id="LN2199">2199</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2200"><td class="num" id="LN2200">2200</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Adding new client %s to session"</span>, new_id);</td></tr> +<tr class="codeline" data-linenumber="2201"><td class="num" id="LN2201">2201</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2202"><td class="num" id="LN2202">2202</td><td class="line"> <span class='macro'>g_signal_connect (client,<span class='macro_popup'>g_signal_connect_data ((client), ("disconnected"), (((GCallback<br>) (on_client_disconnected))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2203"><td class="num" id="LN2203">2203</td><td class="line"> <span class='string_literal'><span class='macro'>"disconnected"</span>,<span class='macro_popup'>g_signal_connect_data ((client), ("disconnected"), (((GCallback<br>) (on_client_disconnected))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2204"><td class="num" id="LN2204">2204</td><td class="line"> <span class='macro'>G_CALLBACK (on_client_disconnected),<span class='macro_popup'>g_signal_connect_data ((client), ("disconnected"), (((GCallback<br>) (on_client_disconnected))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2205"><td class="num" id="LN2205">2205</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((client), ("disconnected"), (((GCallback<br>) (on_client_disconnected))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2206"><td class="num" id="LN2206">2206</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2207"><td class="num" id="LN2207">2207</td><td class="line"> <span class='comment'>/* If it's a brand new client id, we just accept the client*/</span></td></tr> +<tr class="codeline" data-linenumber="2208"><td class="num" id="LN2208">2208</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (*id)<span class='macro_popup'>((*id)==((void*)0)||(*id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2209"><td class="num" id="LN2209">2209</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="2210"><td class="num" id="LN2210">2210</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2211"><td class="num" id="LN2211">2211</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2212"><td class="num" id="LN2212">2212</td><td class="line"> app = find_app_for_startup_id (manager, new_id);</td></tr> +<tr class="codeline" data-linenumber="2213"><td class="num" id="LN2213">2213</td><td class="line"> <span class='keyword'>if</span> (app != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2214"><td class="num" id="LN2214">2214</td><td class="line"> gsm_client_set_app_id (GSM_CLIENT (client), gsm_app_peek_app_id (app));</td></tr> +<tr class="codeline" data-linenumber="2215"><td class="num" id="LN2215">2215</td><td class="line"> gsm_app_registered (app);</td></tr> +<tr class="codeline" data-linenumber="2216"><td class="num" id="LN2216">2216</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="2217"><td class="num" id="LN2217">2217</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2218"><td class="num" id="LN2218">2218</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2219"><td class="num" id="LN2219">2219</td><td class="line"> <span class='comment'>/* app not found */</span></td></tr> +<tr class="codeline" data-linenumber="2220"><td class="num" id="LN2220">2220</td><td class="line"> g_free (new_id);</td></tr> +<tr class="codeline" data-linenumber="2221"><td class="num" id="LN2221">2221</td><td class="line"> new_id = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2222"><td class="num" id="LN2222">2222</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2223"><td class="num" id="LN2223">2223</td><td class="line"> out:</td></tr> +<tr class="codeline" data-linenumber="2224"><td class="num" id="LN2224">2224</td><td class="line"> g_free (*id);</td></tr> +<tr class="codeline" data-linenumber="2225"><td class="num" id="LN2225">2225</td><td class="line"> *id = new_id;</td></tr> +<tr class="codeline" data-linenumber="2226"><td class="num" id="LN2226">2226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2227"><td class="num" id="LN2227">2227</td><td class="line"> <span class='keyword'>return</span> handled;</td></tr> +<tr class="codeline" data-linenumber="2228"><td class="num" id="LN2228">2228</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2229"><td class="num" id="LN2229">2229</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2230"><td class="num" id="LN2230">2230</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="2231"><td class="num" id="LN2231">2231</td><td class="line">auto_save_is_enabled (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2232"><td class="num" id="LN2232">2232</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2233"><td class="num" id="LN2233">2233</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2234"><td class="num" id="LN2234">2234</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2235"><td class="num" id="LN2235">2235</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2236"><td class="num" id="LN2236">2236</td><td class="line"> <span class='keyword'>return</span> g_settings_get_boolean (priv->settings_session,</td></tr> +<tr class="codeline" data-linenumber="2237"><td class="num" id="LN2237">2237</td><td class="line"> <span class='macro'>KEY_AUTOSAVE<span class='macro_popup'>"auto-save-session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2238"><td class="num" id="LN2238">2238</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2239"><td class="num" id="LN2239">2239</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2240"><td class="num" id="LN2240">2240</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2241"><td class="num" id="LN2241">2241</td><td class="line">maybe_save_session (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2242"><td class="num" id="LN2242">2242</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2243"><td class="num" id="LN2243">2243</td><td class="line"> GsmConsolekit *consolekit = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2244"><td class="num" id="LN2244">2244</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="2245"><td class="num" id="LN2245">2245</td><td class="line"> GsmSystemd *systemd = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2246"><td class="num" id="LN2246">2246</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="2247"><td class="num" id="LN2247">2247</td><td class="line"> <span class='keyword'>char</span> *session_type;</td></tr> +<tr class="codeline" data-linenumber="2248"><td class="num" id="LN2248">2248</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="2249"><td class="num" id="LN2249">2249</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2250"><td class="num" id="LN2250">2250</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2251"><td class="num" id="LN2251">2251</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="2252"><td class="num" id="LN2252">2252</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2253"><td class="num" id="LN2253">2253</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="2254"><td class="num" id="LN2254">2254</td><td class="line"> session_type = gsm_systemd_get_current_session_type (systemd);</td></tr> +<tr class="codeline" data-linenumber="2255"><td class="num" id="LN2255">2255</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2256"><td class="num" id="LN2256">2256</td><td class="line"> <span class='keyword'>if</span> (g_strcmp0 (session_type, <span class='macro'>GSM_SYSTEMD_SESSION_TYPE_LOGIN_WINDOW<span class='macro_popup'>"greeter"</span></span>) == 0) {</td></tr> +<tr class="codeline" data-linenumber="2257"><td class="num" id="LN2257">2257</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="2258"><td class="num" id="LN2258">2258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2259"><td class="num" id="LN2259">2259</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2260"><td class="num" id="LN2260">2260</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2261"><td class="num" id="LN2261">2261</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="2262"><td class="num" id="LN2262">2262</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="2263"><td class="num" id="LN2263">2263</td><td class="line"> session_type = gsm_consolekit_get_current_session_type (consolekit);</td></tr> +<tr class="codeline" data-linenumber="2264"><td class="num" id="LN2264">2264</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2265"><td class="num" id="LN2265">2265</td><td class="line"> <span class='keyword'>if</span> (g_strcmp0 (session_type, <span class='macro'>GSM_CONSOLEKIT_SESSION_TYPE_LOGIN_WINDOW<span class='macro_popup'>"LoginWindow"</span></span>) == 0) {</td></tr> +<tr class="codeline" data-linenumber="2266"><td class="num" id="LN2266">2266</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="2267"><td class="num" id="LN2267">2267</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2268"><td class="num" id="LN2268">2268</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="2269"><td class="num" id="LN2269">2269</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2270"><td class="num" id="LN2270">2270</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="2271"><td class="num" id="LN2271">2271</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2272"><td class="num" id="LN2272">2272</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2273"><td class="num" id="LN2273">2273</td><td class="line"> <span class='comment'>/* We only allow session saving when session is running or when</span></td></tr> +<tr class="codeline" data-linenumber="2274"><td class="num" id="LN2274">2274</td><td class="line"> <span class='comment'>* logging out */</span></td></tr> +<tr class="codeline" data-linenumber="2275"><td class="num" id="LN2275">2275</td><td class="line"> <span class='keyword'>if</span> (priv->phase != GSM_MANAGER_PHASE_RUNNING &&</td></tr> +<tr class="codeline" data-linenumber="2276"><td class="num" id="LN2276">2276</td><td class="line"> priv->phase != GSM_MANAGER_PHASE_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="2277"><td class="num" id="LN2277">2277</td><td class="line"> <span class='keyword'>goto</span> out;</td></tr> +<tr class="codeline" data-linenumber="2278"><td class="num" id="LN2278">2278</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2279"><td class="num" id="LN2279">2279</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2280"><td class="num" id="LN2280">2280</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2281"><td class="num" id="LN2281">2281</td><td class="line"> gsm_session_save (priv->clients, &error);</td></tr> +<tr class="codeline" data-linenumber="2282"><td class="num" id="LN2282">2282</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2283"><td class="num" id="LN2283">2283</td><td class="line"> <span class='keyword'>if</span> (error) {</td></tr> +<tr class="codeline" data-linenumber="2284"><td class="num" id="LN2284">2284</td><td class="line"> g_warning (<span class='string_literal'>"Error saving session: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="2285"><td class="num" id="LN2285">2285</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="2286"><td class="num" id="LN2286">2286</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2287"><td class="num" id="LN2287">2287</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2288"><td class="num" id="LN2288">2288</td><td class="line">out:</td></tr> +<tr class="codeline" data-linenumber="2289"><td class="num" id="LN2289">2289</td><td class="line"> <span class='keyword'>if</span> (consolekit != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="2290"><td class="num" id="LN2290">2290</td><td class="line"> g_object_unref (consolekit);</td></tr> +<tr class="codeline" data-linenumber="2291"><td class="num" id="LN2291">2291</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="2292"><td class="num" id="LN2292">2292</td><td class="line"> <span class='keyword'>if</span> (systemd != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="2293"><td class="num" id="LN2293">2293</td><td class="line"> g_object_unref (systemd);</td></tr> +<tr class="codeline" data-linenumber="2294"><td class="num" id="LN2294">2294</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="2295"><td class="num" id="LN2295">2295</td><td class="line"> g_free (session_type);</td></tr> +<tr class="codeline" data-linenumber="2296"><td class="num" id="LN2296">2296</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2297"><td class="num" id="LN2297">2297</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2298"><td class="num" id="LN2298">2298</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2299"><td class="num" id="LN2299">2299</td><td class="line">_handle_client_end_session_response (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="2300"><td class="num" id="LN2300">2300</td><td class="line"> GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="2301"><td class="num" id="LN2301">2301</td><td class="line"> gboolean is_ok,</td></tr> +<tr class="codeline" data-linenumber="2302"><td class="num" id="LN2302">2302</td><td class="line"> gboolean do_last,</td></tr> +<tr class="codeline" data-linenumber="2303"><td class="num" id="LN2303">2303</td><td class="line"> gboolean cancel,</td></tr> +<tr class="codeline" data-linenumber="2304"><td class="num" id="LN2304">2304</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *reason)</td></tr> +<tr class="codeline" data-linenumber="2305"><td class="num" id="LN2305">2305</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2306"><td class="num" id="LN2306">2306</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2307"><td class="num" id="LN2307">2307</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2308"><td class="num" id="LN2308">2308</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2309"><td class="num" id="LN2309">2309</td><td class="line"> <span class='comment'>/* just ignore if received outside of shutdown */</span></td></tr> +<tr class="codeline" data-linenumber="2310"><td class="num" id="LN2310">2310</td><td class="line"> <span class='keyword'>if</span> (priv->phase < GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="2311"><td class="num" id="LN2311">2311</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="2312"><td class="num" id="LN2312">2312</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2313"><td class="num" id="LN2313">2313</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2314"><td class="num" id="LN2314">2314</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Response from end session request: is-ok=%d do-last=%d cancel=%d reason=%s"</span>, is_ok, do_last, cancel, reason ? reason :<span class='string_literal'>""</span>);</td></tr> +<tr class="codeline" data-linenumber="2315"><td class="num" id="LN2315">2315</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2316"><td class="num" id="LN2316">2316</td><td class="line"> <span class='keyword'>if</span> (cancel) {</td></tr> +<tr class="codeline" data-linenumber="2317"><td class="num" id="LN2317">2317</td><td class="line"> cancel_end_session (manager);</td></tr> +<tr class="codeline" data-linenumber="2318"><td class="num" id="LN2318">2318</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="2319"><td class="num" id="LN2319">2319</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2320"><td class="num" id="LN2320">2320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2321"><td class="num" id="LN2321">2321</td><td class="line"> priv->query_clients = g_slist_remove (priv->query_clients, client);</td></tr> +<tr class="codeline" data-linenumber="2322"><td class="num" id="LN2322">2322</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2323"><td class="num" id="LN2323">2323</td><td class="line"> <span class='keyword'>if</span> (! is_ok && priv->logout_mode != GSM_MANAGER_LOGOUT_MODE_FORCE) {</td></tr> +<tr class="codeline" data-linenumber="2324"><td class="num" id="LN2324">2324</td><td class="line"> guint cookie;</td></tr> +<tr class="codeline" data-linenumber="2325"><td class="num" id="LN2325">2325</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="2326"><td class="num" id="LN2326">2326</td><td class="line"> <span class='keyword'>char</span> *app_id;</td></tr> +<tr class="codeline" data-linenumber="2327"><td class="num" id="LN2327">2327</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *bus_name;</td></tr> +<tr class="codeline" data-linenumber="2328"><td class="num" id="LN2328">2328</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2329"><td class="num" id="LN2329">2329</td><td class="line"> <span class='comment'>/* FIXME: do we support updating the reason? */</span></td></tr> +<tr class="codeline" data-linenumber="2330"><td class="num" id="LN2330">2330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2331"><td class="num" id="LN2331">2331</td><td class="line"> <span class='comment'>/* Create JIT inhibit */</span></td></tr> +<tr class="codeline" data-linenumber="2332"><td class="num" id="LN2332">2332</td><td class="line"> <span class='keyword'>if</span> (GSM_IS_DBUS_CLIENT (client)) {</td></tr> +<tr class="codeline" data-linenumber="2333"><td class="num" id="LN2333">2333</td><td class="line"> bus_name = gsm_dbus_client_get_bus_name (GSM_DBUS_CLIENT (client));</td></tr> +<tr class="codeline" data-linenumber="2334"><td class="num" id="LN2334">2334</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2335"><td class="num" id="LN2335">2335</td><td class="line"> bus_name = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2336"><td class="num" id="LN2336">2336</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2337"><td class="num" id="LN2337">2337</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2338"><td class="num" id="LN2338">2338</td><td class="line"> app_id = <span class='macro'>g_strdup (gsm_client_peek_app_id (client))<span class='macro_popup'>g_strdup_inline (gsm_client_peek_app_id (client))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2339"><td class="num" id="LN2339">2339</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (app_id)<span class='macro_popup'>((app_id)==((void*)0)||(app_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2340"><td class="num" id="LN2340">2340</td><td class="line"> <span class='comment'>/* XSMP clients don't give us an app id unless we start them */</span></td></tr> +<tr class="codeline" data-linenumber="2341"><td class="num" id="LN2341">2341</td><td class="line"> g_free (app_id);</td></tr> +<tr class="codeline" data-linenumber="2342"><td class="num" id="LN2342">2342</td><td class="line"> app_id = gsm_client_get_app_name (client);</td></tr> +<tr class="codeline" data-linenumber="2343"><td class="num" id="LN2343">2343</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2344"><td class="num" id="LN2344">2344</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2345"><td class="num" id="LN2345">2345</td><td class="line"> cookie = _generate_unique_cookie (manager);</td></tr> +<tr class="codeline" data-linenumber="2346"><td class="num" id="LN2346">2346</td><td class="line"> inhibitor = gsm_inhibitor_new_for_client (gsm_client_peek_id (client),</td></tr> +<tr class="codeline" data-linenumber="2347"><td class="num" id="LN2347">2347</td><td class="line"> app_id,</td></tr> +<tr class="codeline" data-linenumber="2348"><td class="num" id="LN2348">2348</td><td class="line"> GSM_INHIBITOR_FLAG_LOGOUT,</td></tr> +<tr class="codeline" data-linenumber="2349"><td class="num" id="LN2349">2349</td><td class="line"> reason != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> ? reason : <span class='macro'>_(<span class='string_literal'>"Not responding"</span>)<span class='macro_popup'>gettext ("Not responding")</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2350"><td class="num" id="LN2350">2350</td><td class="line"> bus_name,</td></tr> +<tr class="codeline" data-linenumber="2351"><td class="num" id="LN2351">2351</td><td class="line"> cookie);</td></tr> +<tr class="codeline" data-linenumber="2352"><td class="num" id="LN2352">2352</td><td class="line"> g_free (app_id);</td></tr> +<tr class="codeline" data-linenumber="2353"><td class="num" id="LN2353">2353</td><td class="line"> gsm_store_add (priv->inhibitors, gsm_inhibitor_peek_id (inhibitor), <span class='macro'>G_OBJECT (inhibitor)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((inhibitor)), (((GType) ((20) << (2))))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2354"><td class="num" id="LN2354">2354</td><td class="line"> g_object_unref (inhibitor);</td></tr> +<tr class="codeline" data-linenumber="2355"><td class="num" id="LN2355">2355</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2356"><td class="num" id="LN2356">2356</td><td class="line"> gsm_store_foreach_remove (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="2357"><td class="num" id="LN2357">2357</td><td class="line"> (GsmStoreFunc)inhibitor_has_client_id,</td></tr> +<tr class="codeline" data-linenumber="2358"><td class="num" id="LN2358">2358</td><td class="line"> (gpointer)gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="2359"><td class="num" id="LN2359">2359</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2360"><td class="num" id="LN2360">2360</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2361"><td class="num" id="LN2361">2361</td><td class="line"> <span class='keyword'>if</span> (priv->phase == GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="2362"><td class="num" id="LN2362">2362</td><td class="line"> <span class='keyword'>if</span> (priv->query_clients == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2363"><td class="num" id="LN2363">2363</td><td class="line"> query_end_session_complete (manager);</td></tr> +<tr class="codeline" data-linenumber="2364"><td class="num" id="LN2364">2364</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2365"><td class="num" id="LN2365">2365</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (priv->phase == GSM_MANAGER_PHASE_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="2366"><td class="num" id="LN2366">2366</td><td class="line"> <span class='keyword'>if</span> (do_last) {</td></tr> +<tr class="codeline" data-linenumber="2367"><td class="num" id="LN2367">2367</td><td class="line"> <span class='comment'>/* This only makes sense if we're in part 1 of</span></td></tr> +<tr class="codeline" data-linenumber="2368"><td class="num" id="LN2368">2368</td><td class="line"> <span class='comment'>* GSM_MANAGER_PHASE_END_SESSION. Doing this in part 2</span></td></tr> +<tr class="codeline" data-linenumber="2369"><td class="num" id="LN2369">2369</td><td class="line"> <span class='comment'>* can only happen because of a buggy client that loops</span></td></tr> +<tr class="codeline" data-linenumber="2370"><td class="num" id="LN2370">2370</td><td class="line"> <span class='comment'>* wanting to be last again and again. The phase</span></td></tr> +<tr class="codeline" data-linenumber="2371"><td class="num" id="LN2371">2371</td><td class="line"> <span class='comment'>* timeout will take care of this issue. */</span></td></tr> +<tr class="codeline" data-linenumber="2372"><td class="num" id="LN2372">2372</td><td class="line"> priv->next_query_clients = g_slist_prepend (priv->next_query_clients,</td></tr> +<tr class="codeline" data-linenumber="2373"><td class="num" id="LN2373">2373</td><td class="line"> client);</td></tr> +<tr class="codeline" data-linenumber="2374"><td class="num" id="LN2374">2374</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2375"><td class="num" id="LN2375">2375</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2376"><td class="num" id="LN2376">2376</td><td class="line"> <span class='comment'>/* we can continue to the next step if all clients have replied</span></td></tr> +<tr class="codeline" data-linenumber="2377"><td class="num" id="LN2377">2377</td><td class="line"> <span class='comment'>* and if there's no inhibitor */</span></td></tr> +<tr class="codeline" data-linenumber="2378"><td class="num" id="LN2378">2378</td><td class="line"> <span class='keyword'>if</span> (priv->query_clients != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2379"><td class="num" id="LN2379">2379</td><td class="line"> || gsm_manager_is_logout_inhibited (manager)) {</td></tr> +<tr class="codeline" data-linenumber="2380"><td class="num" id="LN2380">2380</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="2381"><td class="num" id="LN2381">2381</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2382"><td class="num" id="LN2382">2382</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2383"><td class="num" id="LN2383">2383</td><td class="line"> <span class='keyword'>if</span> (priv->next_query_clients != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2384"><td class="num" id="LN2384">2384</td><td class="line"> do_phase_end_session_part_2 (manager);</td></tr> +<tr class="codeline" data-linenumber="2385"><td class="num" id="LN2385">2385</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2386"><td class="num" id="LN2386">2386</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="2387"><td class="num" id="LN2387">2387</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2388"><td class="num" id="LN2388">2388</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2389"><td class="num" id="LN2389">2389</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2390"><td class="num" id="LN2390">2390</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2391"><td class="num" id="LN2391">2391</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2392"><td class="num" id="LN2392">2392</td><td class="line">on_client_end_session_response (GsmClient *client,</td></tr> +<tr class="codeline" data-linenumber="2393"><td class="num" id="LN2393">2393</td><td class="line"> gboolean is_ok,</td></tr> +<tr class="codeline" data-linenumber="2394"><td class="num" id="LN2394">2394</td><td class="line"> gboolean do_last,</td></tr> +<tr class="codeline" data-linenumber="2395"><td class="num" id="LN2395">2395</td><td class="line"> gboolean cancel,</td></tr> +<tr class="codeline" data-linenumber="2396"><td class="num" id="LN2396">2396</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *reason,</td></tr> +<tr class="codeline" data-linenumber="2397"><td class="num" id="LN2397">2397</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2398"><td class="num" id="LN2398">2398</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2399"><td class="num" id="LN2399">2399</td><td class="line"> _handle_client_end_session_response (manager,</td></tr> +<tr class="codeline" data-linenumber="2400"><td class="num" id="LN2400">2400</td><td class="line"> client,</td></tr> +<tr class="codeline" data-linenumber="2401"><td class="num" id="LN2401">2401</td><td class="line"> is_ok,</td></tr> +<tr class="codeline" data-linenumber="2402"><td class="num" id="LN2402">2402</td><td class="line"> do_last,</td></tr> +<tr class="codeline" data-linenumber="2403"><td class="num" id="LN2403">2403</td><td class="line"> cancel,</td></tr> +<tr class="codeline" data-linenumber="2404"><td class="num" id="LN2404">2404</td><td class="line"> reason);</td></tr> +<tr class="codeline" data-linenumber="2405"><td class="num" id="LN2405">2405</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2406"><td class="num" id="LN2406">2406</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2407"><td class="num" id="LN2407">2407</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2408"><td class="num" id="LN2408">2408</td><td class="line">on_xsmp_client_logout_request (GsmXSMPClient *client,</td></tr> +<tr class="codeline" data-linenumber="2409"><td class="num" id="LN2409">2409</td><td class="line"> gboolean show_dialog,</td></tr> +<tr class="codeline" data-linenumber="2410"><td class="num" id="LN2410">2410</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2411"><td class="num" id="LN2411">2411</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2412"><td class="num" id="LN2412">2412</td><td class="line"> GError *error;</td></tr> +<tr class="codeline" data-linenumber="2413"><td class="num" id="LN2413">2413</td><td class="line"> <span class='keyword'>int</span> logout_mode;</td></tr> +<tr class="codeline" data-linenumber="2414"><td class="num" id="LN2414">2414</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2415"><td class="num" id="LN2415">2415</td><td class="line"> <span class='keyword'>if</span> (show_dialog) {</td></tr> +<tr class="codeline" data-linenumber="2416"><td class="num" id="LN2416">2416</td><td class="line"> logout_mode = GSM_MANAGER_LOGOUT_MODE_NORMAL;</td></tr> +<tr class="codeline" data-linenumber="2417"><td class="num" id="LN2417">2417</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2418"><td class="num" id="LN2418">2418</td><td class="line"> logout_mode = GSM_MANAGER_LOGOUT_MODE_NO_CONFIRMATION;</td></tr> +<tr class="codeline" data-linenumber="2419"><td class="num" id="LN2419">2419</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2420"><td class="num" id="LN2420">2420</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2421"><td class="num" id="LN2421">2421</td><td class="line"> error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2422"><td class="num" id="LN2422">2422</td><td class="line"> gsm_manager_logout (manager, logout_mode, &error);</td></tr> +<tr class="codeline" data-linenumber="2423"><td class="num" id="LN2423">2423</td><td class="line"> <span class='keyword'>if</span> (error != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2424"><td class="num" id="LN2424">2424</td><td class="line"> g_warning (<span class='string_literal'>"Unable to logout: %s"</span>, error->message);</td></tr> +<tr class="codeline" data-linenumber="2425"><td class="num" id="LN2425">2425</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="2426"><td class="num" id="LN2426">2426</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2427"><td class="num" id="LN2427">2427</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2428"><td class="num" id="LN2428">2428</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2429"><td class="num" id="LN2429">2429</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2430"><td class="num" id="LN2430">2430</td><td class="line">on_store_client_added (GsmStore *store,</td></tr> +<tr class="codeline" data-linenumber="2431"><td class="num" id="LN2431">2431</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="2432"><td class="num" id="LN2432">2432</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2433"><td class="num" id="LN2433">2433</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2434"><td class="num" id="LN2434">2434</td><td class="line"> GsmClient *client;</td></tr> +<tr class="codeline" data-linenumber="2435"><td class="num" id="LN2435">2435</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2436"><td class="num" id="LN2436">2436</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Client added: %s"</span>, id);</td></tr> +<tr class="codeline" data-linenumber="2437"><td class="num" id="LN2437">2437</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2438"><td class="num" id="LN2438">2438</td><td class="line"> client = (GsmClient *)gsm_store_lookup (store, id);</td></tr> +<tr class="codeline" data-linenumber="2439"><td class="num" id="LN2439">2439</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2440"><td class="num" id="LN2440">2440</td><td class="line"> <span class='comment'>/* a bit hacky */</span></td></tr> +<tr class="codeline" data-linenumber="2441"><td class="num" id="LN2441">2441</td><td class="line"> <span class='keyword'>if</span> (GSM_IS_XSMP_CLIENT (client)) {</td></tr> +<tr class="codeline" data-linenumber="2442"><td class="num" id="LN2442">2442</td><td class="line"> <span class='macro'>g_signal_connect (client,<span class='macro_popup'>g_signal_connect_data ((client), ("register-request"), (((GCallback<br>) (on_xsmp_client_register_request))), (manager), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2443"><td class="num" id="LN2443">2443</td><td class="line"> <span class='string_literal'><span class='macro'>"register-request"</span>,<span class='macro_popup'>g_signal_connect_data ((client), ("register-request"), (((GCallback<br>) (on_xsmp_client_register_request))), (manager), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2444"><td class="num" id="LN2444">2444</td><td class="line"> <span class='macro'>G_CALLBACK (on_xsmp_client_register_request),<span class='macro_popup'>g_signal_connect_data ((client), ("register-request"), (((GCallback<br>) (on_xsmp_client_register_request))), (manager), ((void*)0),<br> (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2445"><td class="num" id="LN2445">2445</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((client), ("register-request"), (((GCallback<br>) (on_xsmp_client_register_request))), (manager), ((void*)0),<br> (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2446"><td class="num" id="LN2446">2446</td><td class="line"> <span class='macro'>g_signal_connect (client,<span class='macro_popup'>g_signal_connect_data ((client), ("logout-request"), (((GCallback<br>) (on_xsmp_client_logout_request))), (manager), ((void*)0), (<br>GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2447"><td class="num" id="LN2447">2447</td><td class="line"> <span class='string_literal'><span class='macro'>"logout-request"</span>,<span class='macro_popup'>g_signal_connect_data ((client), ("logout-request"), (((GCallback<br>) (on_xsmp_client_logout_request))), (manager), ((void*)0), (<br>GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2448"><td class="num" id="LN2448">2448</td><td class="line"> <span class='macro'>G_CALLBACK (on_xsmp_client_logout_request),<span class='macro_popup'>g_signal_connect_data ((client), ("logout-request"), (((GCallback<br>) (on_xsmp_client_logout_request))), (manager), ((void*)0), (<br>GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2449"><td class="num" id="LN2449">2449</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((client), ("logout-request"), (((GCallback<br>) (on_xsmp_client_logout_request))), (manager), ((void*)0), (<br>GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2450"><td class="num" id="LN2450">2450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2451"><td class="num" id="LN2451">2451</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2452"><td class="num" id="LN2452">2452</td><td class="line"> <span class='macro'>g_signal_connect (client,<span class='macro_popup'>g_signal_connect_data ((client), ("end-session-response"), ((<br>(GCallback) (on_client_end_session_response))), (manager), ((<br>void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2453"><td class="num" id="LN2453">2453</td><td class="line"> <span class='string_literal'><span class='macro'>"end-session-response"</span>,<span class='macro_popup'>g_signal_connect_data ((client), ("end-session-response"), ((<br>(GCallback) (on_client_end_session_response))), (manager), ((<br>void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2454"><td class="num" id="LN2454">2454</td><td class="line"> <span class='macro'>G_CALLBACK (on_client_end_session_response),<span class='macro_popup'>g_signal_connect_data ((client), ("end-session-response"), ((<br>(GCallback) (on_client_end_session_response))), (manager), ((<br>void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2455"><td class="num" id="LN2455">2455</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((client), ("end-session-response"), ((<br>(GCallback) (on_client_end_session_response))), (manager), ((<br>void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2456"><td class="num" id="LN2456">2456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2457"><td class="num" id="LN2457">2457</td><td class="line"> g_signal_emit (manager, signals [CLIENT_ADDED], 0, id);</td></tr> +<tr class="codeline" data-linenumber="2458"><td class="num" id="LN2458">2458</td><td class="line"> <span class='comment'>/* FIXME: disconnect signal handler */</span></td></tr> +<tr class="codeline" data-linenumber="2459"><td class="num" id="LN2459">2459</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2460"><td class="num" id="LN2460">2460</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2461"><td class="num" id="LN2461">2461</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2462"><td class="num" id="LN2462">2462</td><td class="line">on_store_client_removed (GsmStore *store,</td></tr> +<tr class="codeline" data-linenumber="2463"><td class="num" id="LN2463">2463</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="2464"><td class="num" id="LN2464">2464</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2465"><td class="num" id="LN2465">2465</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2466"><td class="num" id="LN2466">2466</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Client removed: %s"</span>, id);</td></tr> +<tr class="codeline" data-linenumber="2467"><td class="num" id="LN2467">2467</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2468"><td class="num" id="LN2468">2468</td><td class="line"> g_signal_emit (manager, signals [CLIENT_REMOVED], 0, id);</td></tr> +<tr class="codeline" data-linenumber="2469"><td class="num" id="LN2469">2469</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2470"><td class="num" id="LN2470">2470</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2471"><td class="num" id="LN2471">2471</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2472"><td class="num" id="LN2472">2472</td><td class="line">gsm_manager_set_client_store (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="2473"><td class="num" id="LN2473">2473</td><td class="line"> GsmStore *store)</td></tr> +<tr class="codeline" data-linenumber="2474"><td class="num" id="LN2474">2474</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2475"><td class="num" id="LN2475">2475</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2476"><td class="num" id="LN2476">2476</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2477"><td class="num" id="LN2477">2477</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_MANAGER (manager))<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2478"><td class="num" id="LN2478">2478</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2479"><td class="num" id="LN2479">2479</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2480"><td class="num" id="LN2480">2480</td><td class="line"> <span class='keyword'>if</span> (store != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2481"><td class="num" id="LN2481">2481</td><td class="line"> <span class='macro'>g_object_ref (store)<span class='macro_popup'>((__typeof__ (store)) (g_object_ref) (store))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2482"><td class="num" id="LN2482">2482</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2483"><td class="num" id="LN2483">2483</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2484"><td class="num" id="LN2484">2484</td><td class="line"> <span class='keyword'>if</span> (priv->clients != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2485"><td class="num" id="LN2485">2485</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (priv->clients,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_added), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2486"><td class="num" id="LN2486">2486</td><td class="line"> <span class='macro'>on_store_client_added,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_added), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2487"><td class="num" id="LN2487">2487</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_added), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2488"><td class="num" id="LN2488">2488</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (priv->clients,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_removed), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2489"><td class="num" id="LN2489">2489</td><td class="line"> <span class='macro'>on_store_client_removed,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_removed), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2490"><td class="num" id="LN2490">2490</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_removed), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2491"><td class="num" id="LN2491">2491</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2492"><td class="num" id="LN2492">2492</td><td class="line"> g_object_unref (priv->clients);</td></tr> +<tr class="codeline" data-linenumber="2493"><td class="num" id="LN2493">2493</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2494"><td class="num" id="LN2494">2494</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2495"><td class="num" id="LN2495">2495</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: setting client store %p"</span>, store);</td></tr> +<tr class="codeline" data-linenumber="2496"><td class="num" id="LN2496">2496</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2497"><td class="num" id="LN2497">2497</td><td class="line"> priv->clients = store;</td></tr> +<tr class="codeline" data-linenumber="2498"><td class="num" id="LN2498">2498</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2499"><td class="num" id="LN2499">2499</td><td class="line"> <span class='keyword'>if</span> (priv->clients != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2500"><td class="num" id="LN2500">2500</td><td class="line"> <span class='macro'>g_signal_connect (priv->clients,<span class='macro_popup'>g_signal_connect_data ((priv->clients), ("added"), (((GCallback<br>) (on_store_client_added))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2501"><td class="num" id="LN2501">2501</td><td class="line"> <span class='string_literal'><span class='macro'>"added"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->clients), ("added"), (((GCallback<br>) (on_store_client_added))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2502"><td class="num" id="LN2502">2502</td><td class="line"> <span class='macro'>G_CALLBACK (on_store_client_added),<span class='macro_popup'>g_signal_connect_data ((priv->clients), ("added"), (((GCallback<br>) (on_store_client_added))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2503"><td class="num" id="LN2503">2503</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->clients), ("added"), (((GCallback<br>) (on_store_client_added))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2504"><td class="num" id="LN2504">2504</td><td class="line"> <span class='macro'>g_signal_connect (priv->clients,<span class='macro_popup'>g_signal_connect_data ((priv->clients), ("removed"), (((GCallback<br>) (on_store_client_removed))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2505"><td class="num" id="LN2505">2505</td><td class="line"> <span class='string_literal'><span class='macro'>"removed"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->clients), ("removed"), (((GCallback<br>) (on_store_client_removed))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2506"><td class="num" id="LN2506">2506</td><td class="line"> <span class='macro'>G_CALLBACK (on_store_client_removed),<span class='macro_popup'>g_signal_connect_data ((priv->clients), ("removed"), (((GCallback<br>) (on_store_client_removed))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2507"><td class="num" id="LN2507">2507</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->clients), ("removed"), (((GCallback<br>) (on_store_client_removed))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2508"><td class="num" id="LN2508">2508</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2509"><td class="num" id="LN2509">2509</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2510"><td class="num" id="LN2510">2510</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2511"><td class="num" id="LN2511">2511</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2512"><td class="num" id="LN2512">2512</td><td class="line">gsm_manager_set_property (GObject *object,</td></tr> +<tr class="codeline" data-linenumber="2513"><td class="num" id="LN2513">2513</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="2514"><td class="num" id="LN2514">2514</td><td class="line"> <span class='keyword'>const</span> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="2515"><td class="num" id="LN2515">2515</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="2516"><td class="num" id="LN2516">2516</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2517"><td class="num" id="LN2517">2517</td><td class="line"> GsmManager *self;</td></tr> +<tr class="codeline" data-linenumber="2518"><td class="num" id="LN2518">2518</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2519"><td class="num" id="LN2519">2519</td><td class="line"> self = GSM_MANAGER (object);</td></tr> +<tr class="codeline" data-linenumber="2520"><td class="num" id="LN2520">2520</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2521"><td class="num" id="LN2521">2521</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="2522"><td class="num" id="LN2522">2522</td><td class="line"> <span class='keyword'>case</span> PROP_FAILSAFE:</td></tr> +<tr class="codeline" data-linenumber="2523"><td class="num" id="LN2523">2523</td><td class="line"> gsm_manager_set_failsafe (self, g_value_get_boolean (value));</td></tr> +<tr class="codeline" data-linenumber="2524"><td class="num" id="LN2524">2524</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="2525"><td class="num" id="LN2525">2525</td><td class="line"> <span class='keyword'>case</span> PROP_CLIENT_STORE:</td></tr> +<tr class="codeline" data-linenumber="2526"><td class="num" id="LN2526">2526</td><td class="line"> gsm_manager_set_client_store (self, g_value_get_object (value));</td></tr> +<tr class="codeline" data-linenumber="2527"><td class="num" id="LN2527">2527</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="2528"><td class="num" id="LN2528">2528</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="2529"><td class="num" id="LN2529">2529</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "gsm-manager.c", 2529, ("property"), _glib__property_id, _glib__pspec<br>->name, g_type_name ((((((GTypeClass*) (((GTypeInstance*) (<br>_glib__pspec))->g_class))->g_type)))), (g_type_name (((<br>(((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2530"><td class="num" id="LN2530">2530</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="2531"><td class="num" id="LN2531">2531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2532"><td class="num" id="LN2532">2532</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2533"><td class="num" id="LN2533">2533</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2534"><td class="num" id="LN2534">2534</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2535"><td class="num" id="LN2535">2535</td><td class="line">gsm_manager_get_property (GObject *object,</td></tr> +<tr class="codeline" data-linenumber="2536"><td class="num" id="LN2536">2536</td><td class="line"> guint prop_id,</td></tr> +<tr class="codeline" data-linenumber="2537"><td class="num" id="LN2537">2537</td><td class="line"> GValue *value,</td></tr> +<tr class="codeline" data-linenumber="2538"><td class="num" id="LN2538">2538</td><td class="line"> GParamSpec *pspec)</td></tr> +<tr class="codeline" data-linenumber="2539"><td class="num" id="LN2539">2539</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2540"><td class="num" id="LN2540">2540</td><td class="line"> GsmManager *self;</td></tr> +<tr class="codeline" data-linenumber="2541"><td class="num" id="LN2541">2541</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2542"><td class="num" id="LN2542">2542</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2543"><td class="num" id="LN2543">2543</td><td class="line"> self = GSM_MANAGER (object);</td></tr> +<tr class="codeline" data-linenumber="2544"><td class="num" id="LN2544">2544</td><td class="line"> priv = gsm_manager_get_instance_private (self);</td></tr> +<tr class="codeline" data-linenumber="2545"><td class="num" id="LN2545">2545</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2546"><td class="num" id="LN2546">2546</td><td class="line"> <span class='keyword'>switch</span> (prop_id) {</td></tr> +<tr class="codeline" data-linenumber="2547"><td class="num" id="LN2547">2547</td><td class="line"> <span class='keyword'>case</span> PROP_FAILSAFE:</td></tr> +<tr class="codeline" data-linenumber="2548"><td class="num" id="LN2548">2548</td><td class="line"> g_value_set_boolean (value, priv->failsafe);</td></tr> +<tr class="codeline" data-linenumber="2549"><td class="num" id="LN2549">2549</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="2550"><td class="num" id="LN2550">2550</td><td class="line"> <span class='keyword'>case</span> PROP_CLIENT_STORE:</td></tr> +<tr class="codeline" data-linenumber="2551"><td class="num" id="LN2551">2551</td><td class="line"> g_value_set_object (value, priv->clients);</td></tr> +<tr class="codeline" data-linenumber="2552"><td class="num" id="LN2552">2552</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="2553"><td class="num" id="LN2553">2553</td><td class="line"> <span class='keyword'>case</span> PROP_RENDERER:</td></tr> +<tr class="codeline" data-linenumber="2554"><td class="num" id="LN2554">2554</td><td class="line"> g_value_set_string (value, priv->renderer);</td></tr> +<tr class="codeline" data-linenumber="2555"><td class="num" id="LN2555">2555</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="2556"><td class="num" id="LN2556">2556</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="2557"><td class="num" id="LN2557">2557</td><td class="line"> <span class='macro'>G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec)<span class='macro_popup'>do { GObject *_glib__object = (GObject*) ((object)); GParamSpec<br> *_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id<br> = ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"<br>, "gsm-manager.c", 2557, ("property"), _glib__property_id, _glib__pspec<br>->name, g_type_name ((((((GTypeClass*) (((GTypeInstance*) (<br>_glib__pspec))->g_class))->g_type)))), (g_type_name (((<br>(((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class<br>))->g_type)))))); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2558"><td class="num" id="LN2558">2558</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="2559"><td class="num" id="LN2559">2559</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2560"><td class="num" id="LN2560">2560</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2561"><td class="num" id="LN2561">2561</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2562"><td class="num" id="LN2562">2562</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="2563"><td class="num" id="LN2563">2563</td><td class="line">_find_app_provides (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="2564"><td class="num" id="LN2564">2564</td><td class="line"> GsmApp *app,</td></tr> +<tr class="codeline" data-linenumber="2565"><td class="num" id="LN2565">2565</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *service)</td></tr> +<tr class="codeline" data-linenumber="2566"><td class="num" id="LN2566">2566</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2567"><td class="num" id="LN2567">2567</td><td class="line"> <span class='keyword'>return</span> gsm_app_provides (app, service);</td></tr> +<tr class="codeline" data-linenumber="2568"><td class="num" id="LN2568">2568</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2569"><td class="num" id="LN2569">2569</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2570"><td class="num" id="LN2570">2570</td><td class="line"><span class='keyword'>static</span> GObject *</td></tr> +<tr class="codeline" data-linenumber="2571"><td class="num" id="LN2571">2571</td><td class="line">gsm_manager_constructor (GType type,</td></tr> +<tr class="codeline" data-linenumber="2572"><td class="num" id="LN2572">2572</td><td class="line"> guint n_construct_properties,</td></tr> +<tr class="codeline" data-linenumber="2573"><td class="num" id="LN2573">2573</td><td class="line"> GObjectConstructParam *construct_properties)</td></tr> +<tr class="codeline" data-linenumber="2574"><td class="num" id="LN2574">2574</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2575"><td class="num" id="LN2575">2575</td><td class="line"> GsmManager *manager;</td></tr> +<tr class="codeline" data-linenumber="2576"><td class="num" id="LN2576">2576</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2577"><td class="num" id="LN2577">2577</td><td class="line"> manager = GSM_MANAGER (<span class='macro'>G_OBJECT_CLASS (gsm_manager_parent_class)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((gsm_manager_parent_class)), (((GType) ((20) << (2)<br>)))))))</span></span>->constructor (type,</td></tr> +<tr class="codeline" data-linenumber="2578"><td class="num" id="LN2578">2578</td><td class="line"> n_construct_properties,</td></tr> +<tr class="codeline" data-linenumber="2579"><td class="num" id="LN2579">2579</td><td class="line"> construct_properties));</td></tr> +<tr class="codeline" data-linenumber="2580"><td class="num" id="LN2580">2580</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>G_OBJECT (manager)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((manager)), (((GType) ((20) << (2))))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2581"><td class="num" id="LN2581">2581</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2582"><td class="num" id="LN2582">2582</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2583"><td class="num" id="LN2583">2583</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2584"><td class="num" id="LN2584">2584</td><td class="line">on_store_inhibitor_added (GsmStore *store,</td></tr> +<tr class="codeline" data-linenumber="2585"><td class="num" id="LN2585">2585</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="2586"><td class="num" id="LN2586">2586</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2587"><td class="num" id="LN2587">2587</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2588"><td class="num" id="LN2588">2588</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Inhibitor added: %s"</span>, id);</td></tr> +<tr class="codeline" data-linenumber="2589"><td class="num" id="LN2589">2589</td><td class="line"> g_signal_emit (manager, signals [INHIBITOR_ADDED], 0, id);</td></tr> +<tr class="codeline" data-linenumber="2590"><td class="num" id="LN2590">2590</td><td class="line"> update_idle (manager);</td></tr> +<tr class="codeline" data-linenumber="2591"><td class="num" id="LN2591">2591</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2592"><td class="num" id="LN2592">2592</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2593"><td class="num" id="LN2593">2593</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2594"><td class="num" id="LN2594">2594</td><td class="line">on_store_inhibitor_removed (GsmStore *store,</td></tr> +<tr class="codeline" data-linenumber="2595"><td class="num" id="LN2595">2595</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="2596"><td class="num" id="LN2596">2596</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2597"><td class="num" id="LN2597">2597</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2598"><td class="num" id="LN2598">2598</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Inhibitor removed: %s"</span>, id);</td></tr> +<tr class="codeline" data-linenumber="2599"><td class="num" id="LN2599">2599</td><td class="line"> g_signal_emit (manager, signals [INHIBITOR_REMOVED], 0, id);</td></tr> +<tr class="codeline" data-linenumber="2600"><td class="num" id="LN2600">2600</td><td class="line"> update_idle (manager);</td></tr> +<tr class="codeline" data-linenumber="2601"><td class="num" id="LN2601">2601</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2602"><td class="num" id="LN2602">2602</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2603"><td class="num" id="LN2603">2603</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2604"><td class="num" id="LN2604">2604</td><td class="line">gsm_manager_dispose (GObject *object)</td></tr> +<tr class="codeline" data-linenumber="2605"><td class="num" id="LN2605">2605</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2606"><td class="num" id="LN2606">2606</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2607"><td class="num" id="LN2607">2607</td><td class="line"> GsmManager *manager = GSM_MANAGER (object);</td></tr> +<tr class="codeline" data-linenumber="2608"><td class="num" id="LN2608">2608</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2609"><td class="num" id="LN2609">2609</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: disposing manager"</span>);</td></tr> +<tr class="codeline" data-linenumber="2610"><td class="num" id="LN2610">2610</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2611"><td class="num" id="LN2611">2611</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2612"><td class="num" id="LN2612">2612</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2613"><td class="num" id="LN2613">2613</td><td class="line"> <span class='keyword'>if</span> (priv->clients != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2614"><td class="num" id="LN2614">2614</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (priv->clients,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_added), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2615"><td class="num" id="LN2615">2615</td><td class="line"> <span class='macro'>on_store_client_added,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_added), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2616"><td class="num" id="LN2616">2616</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_added), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2617"><td class="num" id="LN2617">2617</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (priv->clients,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_removed), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2618"><td class="num" id="LN2618">2618</td><td class="line"> <span class='macro'>on_store_client_removed,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_removed), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2619"><td class="num" id="LN2619">2619</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->clients), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (on_store_client_removed), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2620"><td class="num" id="LN2620">2620</td><td class="line"> g_object_unref (priv->clients);</td></tr> +<tr class="codeline" data-linenumber="2621"><td class="num" id="LN2621">2621</td><td class="line"> priv->clients = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2622"><td class="num" id="LN2622">2622</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2623"><td class="num" id="LN2623">2623</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2624"><td class="num" id="LN2624">2624</td><td class="line"> <span class='keyword'>if</span> (priv->apps != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2625"><td class="num" id="LN2625">2625</td><td class="line"> g_object_unref (priv->apps);</td></tr> +<tr class="codeline" data-linenumber="2626"><td class="num" id="LN2626">2626</td><td class="line"> priv->apps = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2627"><td class="num" id="LN2627">2627</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2628"><td class="num" id="LN2628">2628</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2629"><td class="num" id="LN2629">2629</td><td class="line"> <span class='keyword'>if</span> (priv->inhibitors != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2630"><td class="num" id="LN2630">2630</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (priv->inhibitors,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->inhibitors), (<br>GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA)<br>, 0, 0, ((void*)0), (on_store_inhibitor_added), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2631"><td class="num" id="LN2631">2631</td><td class="line"> <span class='macro'>on_store_inhibitor_added,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->inhibitors), (<br>GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA)<br>, 0, 0, ((void*)0), (on_store_inhibitor_added), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2632"><td class="num" id="LN2632">2632</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->inhibitors), (<br>GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA)<br>, 0, 0, ((void*)0), (on_store_inhibitor_added), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2633"><td class="num" id="LN2633">2633</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (priv->inhibitors,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->inhibitors), (<br>GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA)<br>, 0, 0, ((void*)0), (on_store_inhibitor_removed), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2634"><td class="num" id="LN2634">2634</td><td class="line"> <span class='macro'>on_store_inhibitor_removed,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->inhibitors), (<br>GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA)<br>, 0, 0, ((void*)0), (on_store_inhibitor_removed), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="2635"><td class="num" id="LN2635">2635</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((priv->inhibitors), (<br>GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA)<br>, 0, 0, ((void*)0), (on_store_inhibitor_removed), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2636"><td class="num" id="LN2636">2636</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2637"><td class="num" id="LN2637">2637</td><td class="line"> g_object_unref (priv->inhibitors);</td></tr> +<tr class="codeline" data-linenumber="2638"><td class="num" id="LN2638">2638</td><td class="line"> priv->inhibitors = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2639"><td class="num" id="LN2639">2639</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2640"><td class="num" id="LN2640">2640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2641"><td class="num" id="LN2641">2641</td><td class="line"> <span class='keyword'>if</span> (priv->presence != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2642"><td class="num" id="LN2642">2642</td><td class="line"> g_object_unref (priv->presence);</td></tr> +<tr class="codeline" data-linenumber="2643"><td class="num" id="LN2643">2643</td><td class="line"> priv->presence = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2644"><td class="num" id="LN2644">2644</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2645"><td class="num" id="LN2645">2645</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2646"><td class="num" id="LN2646">2646</td><td class="line"> <span class='keyword'>if</span> (priv->settings_session) {</td></tr> +<tr class="codeline" data-linenumber="2647"><td class="num" id="LN2647">2647</td><td class="line"> g_object_unref (priv->settings_session);</td></tr> +<tr class="codeline" data-linenumber="2648"><td class="num" id="LN2648">2648</td><td class="line"> priv->settings_session = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2649"><td class="num" id="LN2649">2649</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2650"><td class="num" id="LN2650">2650</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2651"><td class="num" id="LN2651">2651</td><td class="line"> <span class='keyword'>if</span> (priv->settings_lockdown) {</td></tr> +<tr class="codeline" data-linenumber="2652"><td class="num" id="LN2652">2652</td><td class="line"> g_object_unref (priv->settings_lockdown);</td></tr> +<tr class="codeline" data-linenumber="2653"><td class="num" id="LN2653">2653</td><td class="line"> priv->settings_lockdown = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2654"><td class="num" id="LN2654">2654</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2655"><td class="num" id="LN2655">2655</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2656"><td class="num" id="LN2656">2656</td><td class="line"> <span class='keyword'>if</span> (priv->settings_screensaver) {</td></tr> +<tr class="codeline" data-linenumber="2657"><td class="num" id="LN2657">2657</td><td class="line"> g_object_unref (priv->settings_screensaver);</td></tr> +<tr class="codeline" data-linenumber="2658"><td class="num" id="LN2658">2658</td><td class="line"> priv->settings_screensaver = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2659"><td class="num" id="LN2659">2659</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2660"><td class="num" id="LN2660">2660</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2661"><td class="num" id="LN2661">2661</td><td class="line"> <span class='macro'>g_clear_pointer (&priv->renderer, g_free)<span class='macro_popup'>do { _Static_assert (sizeof *(&priv->renderer) == sizeof<br> (gpointer), "Expression evaluates to false"); __typeof__ ((&<br>priv->renderer)) _pp = (&priv->renderer); __typeof__<br> (*(&priv->renderer)) _ptr = *_pp; *_pp = ((void*)0); if<br> (_ptr) (g_free) (_ptr); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2662"><td class="num" id="LN2662">2662</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2663"><td class="num" id="LN2663">2663</td><td class="line"> <span class='macro'>G_OBJECT_CLASS (gsm_manager_parent_class)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((gsm_manager_parent_class)), (((GType) ((20) << (2)<br>)))))))</span></span>->dispose (object);</td></tr> +<tr class="codeline" data-linenumber="2664"><td class="num" id="LN2664">2664</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2665"><td class="num" id="LN2665">2665</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2666"><td class="num" id="LN2666">2666</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2667"><td class="num" id="LN2667">2667</td><td class="line">gsm_manager_class_init (GsmManagerClass *klass)</td></tr> +<tr class="codeline" data-linenumber="2668"><td class="num" id="LN2668">2668</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2669"><td class="num" id="LN2669">2669</td><td class="line"> GObjectClass *object_class = <span class='macro'>G_OBJECT_CLASS (klass)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((klass)), (((GType) ((20) << (2))))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2670"><td class="num" id="LN2670">2670</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2671"><td class="num" id="LN2671">2671</td><td class="line"> object_class->get_property = gsm_manager_get_property;</td></tr> +<tr class="codeline" data-linenumber="2672"><td class="num" id="LN2672">2672</td><td class="line"> object_class->set_property = gsm_manager_set_property;</td></tr> +<tr class="codeline" data-linenumber="2673"><td class="num" id="LN2673">2673</td><td class="line"> object_class->constructor = gsm_manager_constructor;</td></tr> +<tr class="codeline" data-linenumber="2674"><td class="num" id="LN2674">2674</td><td class="line"> object_class->finalize = gsm_manager_finalize;</td></tr> +<tr class="codeline" data-linenumber="2675"><td class="num" id="LN2675">2675</td><td class="line"> object_class->dispose = gsm_manager_dispose;</td></tr> +<tr class="codeline" data-linenumber="2676"><td class="num" id="LN2676">2676</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2677"><td class="num" id="LN2677">2677</td><td class="line"> signals [PHASE_CHANGED] =</td></tr> +<tr class="codeline" data-linenumber="2678"><td class="num" id="LN2678">2678</td><td class="line"> g_signal_new (<span class='string_literal'>"phase-changed"</span>,</td></tr> +<tr class="codeline" data-linenumber="2679"><td class="num" id="LN2679">2679</td><td class="line"> <span class='macro'>G_TYPE_FROM_CLASS (object_class)<span class='macro_popup'>(((GTypeClass*) (object_class))->g_type)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2680"><td class="num" id="LN2680">2680</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="2681"><td class="num" id="LN2681">2681</td><td class="line"> <span class='macro'>G_STRUCT_OFFSET (GsmManagerClass, phase_changed)<span class='macro_popup'>((glong) __builtin_offsetof(GsmManagerClass, phase_changed))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2682"><td class="num" id="LN2682">2682</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2683"><td class="num" id="LN2683">2683</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2684"><td class="num" id="LN2684">2684</td><td class="line"> g_cclosure_marshal_VOID__STRING,</td></tr> +<tr class="codeline" data-linenumber="2685"><td class="num" id="LN2685">2685</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2686"><td class="num" id="LN2686">2686</td><td class="line"> 1, <span class='macro'>G_TYPE_STRING<span class='macro_popup'>((GType) ((16) << (2)))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2687"><td class="num" id="LN2687">2687</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2688"><td class="num" id="LN2688">2688</td><td class="line"> signals [SESSION_RUNNING] =</td></tr> +<tr class="codeline" data-linenumber="2689"><td class="num" id="LN2689">2689</td><td class="line"> g_signal_new (<span class='string_literal'>"session-running"</span>,</td></tr> +<tr class="codeline" data-linenumber="2690"><td class="num" id="LN2690">2690</td><td class="line"> <span class='macro'>G_OBJECT_CLASS_TYPE (object_class)<span class='macro_popup'>((((GTypeClass*) (object_class))->g_type))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2691"><td class="num" id="LN2691">2691</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="2692"><td class="num" id="LN2692">2692</td><td class="line"> <span class='macro'>G_STRUCT_OFFSET (GsmManagerClass, session_running)<span class='macro_popup'>((glong) __builtin_offsetof(GsmManagerClass, session_running)<br>)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2693"><td class="num" id="LN2693">2693</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2694"><td class="num" id="LN2694">2694</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2695"><td class="num" id="LN2695">2695</td><td class="line"> g_cclosure_marshal_VOID__VOID,</td></tr> +<tr class="codeline" data-linenumber="2696"><td class="num" id="LN2696">2696</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2697"><td class="num" id="LN2697">2697</td><td class="line"> 0);</td></tr> +<tr class="codeline" data-linenumber="2698"><td class="num" id="LN2698">2698</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2699"><td class="num" id="LN2699">2699</td><td class="line"> signals [SESSION_OVER] =</td></tr> +<tr class="codeline" data-linenumber="2700"><td class="num" id="LN2700">2700</td><td class="line"> g_signal_new (<span class='string_literal'>"session-over"</span>,</td></tr> +<tr class="codeline" data-linenumber="2701"><td class="num" id="LN2701">2701</td><td class="line"> <span class='macro'>G_OBJECT_CLASS_TYPE (object_class)<span class='macro_popup'>((((GTypeClass*) (object_class))->g_type))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2702"><td class="num" id="LN2702">2702</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="2703"><td class="num" id="LN2703">2703</td><td class="line"> <span class='macro'>G_STRUCT_OFFSET (GsmManagerClass, session_over)<span class='macro_popup'>((glong) __builtin_offsetof(GsmManagerClass, session_over))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2704"><td class="num" id="LN2704">2704</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2705"><td class="num" id="LN2705">2705</td><td class="line"> g_cclosure_marshal_VOID__VOID,</td></tr> +<tr class="codeline" data-linenumber="2706"><td class="num" id="LN2706">2706</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2707"><td class="num" id="LN2707">2707</td><td class="line"> 0);</td></tr> +<tr class="codeline" data-linenumber="2708"><td class="num" id="LN2708">2708</td><td class="line"> signals [CLIENT_ADDED] =</td></tr> +<tr class="codeline" data-linenumber="2709"><td class="num" id="LN2709">2709</td><td class="line"> g_signal_new (<span class='string_literal'>"client-added"</span>,</td></tr> +<tr class="codeline" data-linenumber="2710"><td class="num" id="LN2710">2710</td><td class="line"> <span class='macro'>G_TYPE_FROM_CLASS (object_class)<span class='macro_popup'>(((GTypeClass*) (object_class))->g_type)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2711"><td class="num" id="LN2711">2711</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="2712"><td class="num" id="LN2712">2712</td><td class="line"> <span class='macro'>G_STRUCT_OFFSET (GsmManagerClass, client_added)<span class='macro_popup'>((glong) __builtin_offsetof(GsmManagerClass, client_added))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2713"><td class="num" id="LN2713">2713</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2714"><td class="num" id="LN2714">2714</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2715"><td class="num" id="LN2715">2715</td><td class="line"> g_cclosure_marshal_VOID__BOXED,</td></tr> +<tr class="codeline" data-linenumber="2716"><td class="num" id="LN2716">2716</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2717"><td class="num" id="LN2717">2717</td><td class="line"> 1, <span class='macro'>DBUS_TYPE_G_OBJECT_PATH<span class='macro_popup'>(dbus_g_object_path_get_g_type ())</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2718"><td class="num" id="LN2718">2718</td><td class="line"> signals [CLIENT_REMOVED] =</td></tr> +<tr class="codeline" data-linenumber="2719"><td class="num" id="LN2719">2719</td><td class="line"> g_signal_new (<span class='string_literal'>"client-removed"</span>,</td></tr> +<tr class="codeline" data-linenumber="2720"><td class="num" id="LN2720">2720</td><td class="line"> <span class='macro'>G_TYPE_FROM_CLASS (object_class)<span class='macro_popup'>(((GTypeClass*) (object_class))->g_type)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2721"><td class="num" id="LN2721">2721</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="2722"><td class="num" id="LN2722">2722</td><td class="line"> <span class='macro'>G_STRUCT_OFFSET (GsmManagerClass, client_removed)<span class='macro_popup'>((glong) __builtin_offsetof(GsmManagerClass, client_removed))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2723"><td class="num" id="LN2723">2723</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2724"><td class="num" id="LN2724">2724</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2725"><td class="num" id="LN2725">2725</td><td class="line"> g_cclosure_marshal_VOID__BOXED,</td></tr> +<tr class="codeline" data-linenumber="2726"><td class="num" id="LN2726">2726</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2727"><td class="num" id="LN2727">2727</td><td class="line"> 1, <span class='macro'>DBUS_TYPE_G_OBJECT_PATH<span class='macro_popup'>(dbus_g_object_path_get_g_type ())</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2728"><td class="num" id="LN2728">2728</td><td class="line"> signals [INHIBITOR_ADDED] =</td></tr> +<tr class="codeline" data-linenumber="2729"><td class="num" id="LN2729">2729</td><td class="line"> g_signal_new (<span class='string_literal'>"inhibitor-added"</span>,</td></tr> +<tr class="codeline" data-linenumber="2730"><td class="num" id="LN2730">2730</td><td class="line"> <span class='macro'>G_TYPE_FROM_CLASS (object_class)<span class='macro_popup'>(((GTypeClass*) (object_class))->g_type)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2731"><td class="num" id="LN2731">2731</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="2732"><td class="num" id="LN2732">2732</td><td class="line"> <span class='macro'>G_STRUCT_OFFSET (GsmManagerClass, inhibitor_added)<span class='macro_popup'>((glong) __builtin_offsetof(GsmManagerClass, inhibitor_added)<br>)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2733"><td class="num" id="LN2733">2733</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2734"><td class="num" id="LN2734">2734</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2735"><td class="num" id="LN2735">2735</td><td class="line"> g_cclosure_marshal_VOID__BOXED,</td></tr> +<tr class="codeline" data-linenumber="2736"><td class="num" id="LN2736">2736</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2737"><td class="num" id="LN2737">2737</td><td class="line"> 1, <span class='macro'>DBUS_TYPE_G_OBJECT_PATH<span class='macro_popup'>(dbus_g_object_path_get_g_type ())</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2738"><td class="num" id="LN2738">2738</td><td class="line"> signals [INHIBITOR_REMOVED] =</td></tr> +<tr class="codeline" data-linenumber="2739"><td class="num" id="LN2739">2739</td><td class="line"> g_signal_new (<span class='string_literal'>"inhibitor-removed"</span>,</td></tr> +<tr class="codeline" data-linenumber="2740"><td class="num" id="LN2740">2740</td><td class="line"> <span class='macro'>G_TYPE_FROM_CLASS (object_class)<span class='macro_popup'>(((GTypeClass*) (object_class))->g_type)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2741"><td class="num" id="LN2741">2741</td><td class="line"> G_SIGNAL_RUN_LAST,</td></tr> +<tr class="codeline" data-linenumber="2742"><td class="num" id="LN2742">2742</td><td class="line"> <span class='macro'>G_STRUCT_OFFSET (GsmManagerClass, inhibitor_removed)<span class='macro_popup'>((glong) __builtin_offsetof(GsmManagerClass, inhibitor_removed<br>))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2743"><td class="num" id="LN2743">2743</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2744"><td class="num" id="LN2744">2744</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2745"><td class="num" id="LN2745">2745</td><td class="line"> g_cclosure_marshal_VOID__BOXED,</td></tr> +<tr class="codeline" data-linenumber="2746"><td class="num" id="LN2746">2746</td><td class="line"> <span class='macro'>G_TYPE_NONE<span class='macro_popup'>((GType) ((1) << (2)))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2747"><td class="num" id="LN2747">2747</td><td class="line"> 1, <span class='macro'>DBUS_TYPE_G_OBJECT_PATH<span class='macro_popup'>(dbus_g_object_path_get_g_type ())</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2748"><td class="num" id="LN2748">2748</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2749"><td class="num" id="LN2749">2749</td><td class="line"> g_object_class_install_property (object_class,</td></tr> +<tr class="codeline" data-linenumber="2750"><td class="num" id="LN2750">2750</td><td class="line"> PROP_FAILSAFE,</td></tr> +<tr class="codeline" data-linenumber="2751"><td class="num" id="LN2751">2751</td><td class="line"> g_param_spec_boolean (<span class='string_literal'>"failsafe"</span>,</td></tr> +<tr class="codeline" data-linenumber="2752"><td class="num" id="LN2752">2752</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2753"><td class="num" id="LN2753">2753</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2754"><td class="num" id="LN2754">2754</td><td class="line"> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2755"><td class="num" id="LN2755">2755</td><td class="line"> G_PARAM_READWRITE | G_PARAM_CONSTRUCT));</td></tr> +<tr class="codeline" data-linenumber="2756"><td class="num" id="LN2756">2756</td><td class="line"> g_object_class_install_property (object_class,</td></tr> +<tr class="codeline" data-linenumber="2757"><td class="num" id="LN2757">2757</td><td class="line"> PROP_CLIENT_STORE,</td></tr> +<tr class="codeline" data-linenumber="2758"><td class="num" id="LN2758">2758</td><td class="line"> g_param_spec_object (<span class='string_literal'>"client-store"</span>,</td></tr> +<tr class="codeline" data-linenumber="2759"><td class="num" id="LN2759">2759</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2760"><td class="num" id="LN2760">2760</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2761"><td class="num" id="LN2761">2761</td><td class="line"> <span class='macro'>GSM_TYPE_STORE<span class='macro_popup'>(gsm_store_get_type ())</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2762"><td class="num" id="LN2762">2762</td><td class="line"> G_PARAM_READWRITE | G_PARAM_CONSTRUCT));</td></tr> +<tr class="codeline" data-linenumber="2763"><td class="num" id="LN2763">2763</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2764"><td class="num" id="LN2764">2764</td><td class="line"> g_object_class_install_property (object_class,</td></tr> +<tr class="codeline" data-linenumber="2765"><td class="num" id="LN2765">2765</td><td class="line"> PROP_RENDERER,</td></tr> +<tr class="codeline" data-linenumber="2766"><td class="num" id="LN2766">2766</td><td class="line"> g_param_spec_string (<span class='string_literal'>"renderer"</span>,</td></tr> +<tr class="codeline" data-linenumber="2767"><td class="num" id="LN2767">2767</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2768"><td class="num" id="LN2768">2768</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2769"><td class="num" id="LN2769">2769</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2770"><td class="num" id="LN2770">2770</td><td class="line"> G_PARAM_READABLE));</td></tr> +<tr class="codeline" data-linenumber="2771"><td class="num" id="LN2771">2771</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2772"><td class="num" id="LN2772">2772</td><td class="line"> dbus_g_object_type_install_info (<span class='macro'>GSM_TYPE_MANAGER<span class='macro_popup'>(gsm_manager_get_type ())</span></span>, &dbus_glib_gsm_manager_object_info);</td></tr> +<tr class="codeline" data-linenumber="2773"><td class="num" id="LN2773">2773</td><td class="line"> dbus_g_error_domain_register (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>, <span class='macro'>GSM_MANAGER_TYPE_ERROR<span class='macro_popup'>(gsm_manager_error_get_type ())</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2774"><td class="num" id="LN2774">2774</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2775"><td class="num" id="LN2775">2775</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2776"><td class="num" id="LN2776">2776</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2777"><td class="num" id="LN2777">2777</td><td class="line">load_idle_delay_from_gsettings (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2778"><td class="num" id="LN2778">2778</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2779"><td class="num" id="LN2779">2779</td><td class="line"> glong value;</td></tr> +<tr class="codeline" data-linenumber="2780"><td class="num" id="LN2780">2780</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2781"><td class="num" id="LN2781">2781</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2782"><td class="num" id="LN2782">2782</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2783"><td class="num" id="LN2783">2783</td><td class="line"> value = g_settings_get_int (priv->settings_session,</td></tr> +<tr class="codeline" data-linenumber="2784"><td class="num" id="LN2784">2784</td><td class="line"> <span class='macro'>KEY_IDLE_DELAY<span class='macro_popup'>"idle-delay"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2785"><td class="num" id="LN2785">2785</td><td class="line"> gsm_presence_set_idle_timeout (priv->presence, value * 60000);</td></tr> +<tr class="codeline" data-linenumber="2786"><td class="num" id="LN2786">2786</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2787"><td class="num" id="LN2787">2787</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2788"><td class="num" id="LN2788">2788</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2789"><td class="num" id="LN2789">2789</td><td class="line">on_gsettings_key_changed (GSettings *settings,</td></tr> +<tr class="codeline" data-linenumber="2790"><td class="num" id="LN2790">2790</td><td class="line"> gchar *key,</td></tr> +<tr class="codeline" data-linenumber="2791"><td class="num" id="LN2791">2791</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2792"><td class="num" id="LN2792">2792</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2793"><td class="num" id="LN2793">2793</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2794"><td class="num" id="LN2794">2794</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2795"><td class="num" id="LN2795">2795</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2796"><td class="num" id="LN2796">2796</td><td class="line"> <span class='keyword'>if</span> (g_strcmp0 (key, <span class='macro'>KEY_IDLE_DELAY<span class='macro_popup'>"idle-delay"</span></span>) == 0) {</td></tr> +<tr class="codeline" data-linenumber="2797"><td class="num" id="LN2797">2797</td><td class="line"> <span class='keyword'>int</span> delay;</td></tr> +<tr class="codeline" data-linenumber="2798"><td class="num" id="LN2798">2798</td><td class="line"> delay = g_settings_get_int (settings, key);</td></tr> +<tr class="codeline" data-linenumber="2799"><td class="num" id="LN2799">2799</td><td class="line"> gsm_presence_set_idle_timeout (priv->presence, delay * 60000);</td></tr> +<tr class="codeline" data-linenumber="2800"><td class="num" id="LN2800">2800</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (g_strcmp0 (key, <span class='macro'>KEY_LOCK_DISABLE<span class='macro_popup'>"disable-lock-screen"</span></span>) == 0) {</td></tr> +<tr class="codeline" data-linenumber="2801"><td class="num" id="LN2801">2801</td><td class="line"> <span class='comment'>/* ??? */</span></td></tr> +<tr class="codeline" data-linenumber="2802"><td class="num" id="LN2802">2802</td><td class="line"> gboolean <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> disabled;</td></tr> +<tr class="codeline" data-linenumber="2803"><td class="num" id="LN2803">2803</td><td class="line"> disabled = g_settings_get_boolean (settings, key);</td></tr> +<tr class="codeline" data-linenumber="2804"><td class="num" id="LN2804">2804</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (g_strcmp0 (key, <span class='macro'>KEY_USER_SWITCH_DISABLE<span class='macro_popup'>"disable-user-switching"</span></span>) == 0) {</td></tr> +<tr class="codeline" data-linenumber="2805"><td class="num" id="LN2805">2805</td><td class="line"> <span class='comment'>/* ??? */</span></td></tr> +<tr class="codeline" data-linenumber="2806"><td class="num" id="LN2806">2806</td><td class="line"> gboolean <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> disabled;</td></tr> +<tr class="codeline" data-linenumber="2807"><td class="num" id="LN2807">2807</td><td class="line"> disabled = g_settings_get_boolean (settings, key);</td></tr> +<tr class="codeline" data-linenumber="2808"><td class="num" id="LN2808">2808</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2809"><td class="num" id="LN2809">2809</td><td class="line"> g_debug (<span class='string_literal'>"Config key not handled: %s"</span>, key);</td></tr> +<tr class="codeline" data-linenumber="2810"><td class="num" id="LN2810">2810</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2811"><td class="num" id="LN2811">2811</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2812"><td class="num" id="LN2812">2812</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2813"><td class="num" id="LN2813">2813</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2814"><td class="num" id="LN2814">2814</td><td class="line">on_presence_status_changed (GsmPresence *presence,</td></tr> +<tr class="codeline" data-linenumber="2815"><td class="num" id="LN2815">2815</td><td class="line"> guint status,</td></tr> +<tr class="codeline" data-linenumber="2816"><td class="num" id="LN2816">2816</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2817"><td class="num" id="LN2817">2817</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2818"><td class="num" id="LN2818">2818</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="2819"><td class="num" id="LN2819">2819</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2820"><td class="num" id="LN2820">2820</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="2821"><td class="num" id="LN2821">2821</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2822"><td class="num" id="LN2822">2822</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="2823"><td class="num" id="LN2823">2823</td><td class="line"> gsm_systemd_set_session_idle (systemd,</td></tr> +<tr class="codeline" data-linenumber="2824"><td class="num" id="LN2824">2824</td><td class="line"> (status == GSM_PRESENCE_STATUS_IDLE));</td></tr> +<tr class="codeline" data-linenumber="2825"><td class="num" id="LN2825">2825</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2826"><td class="num" id="LN2826">2826</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2827"><td class="num" id="LN2827">2827</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="2828"><td class="num" id="LN2828">2828</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="2829"><td class="num" id="LN2829">2829</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2830"><td class="num" id="LN2830">2830</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="2831"><td class="num" id="LN2831">2831</td><td class="line"> gsm_consolekit_set_session_idle (consolekit,</td></tr> +<tr class="codeline" data-linenumber="2832"><td class="num" id="LN2832">2832</td><td class="line"> (status == GSM_PRESENCE_STATUS_IDLE));</td></tr> +<tr class="codeline" data-linenumber="2833"><td class="num" id="LN2833">2833</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="2834"><td class="num" id="LN2834">2834</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2835"><td class="num" id="LN2835">2835</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="2836"><td class="num" id="LN2836">2836</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2837"><td class="num" id="LN2837">2837</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2838"><td class="num" id="LN2838">2838</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2839"><td class="num" id="LN2839">2839</td><td class="line">gsm_manager_init (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2840"><td class="num" id="LN2840">2840</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2841"><td class="num" id="LN2841">2841</td><td class="line"> gchar **schemas = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2842"><td class="num" id="LN2842">2842</td><td class="line"> gboolean schema_exists;</td></tr> +<tr class="codeline" data-linenumber="2843"><td class="num" id="LN2843">2843</td><td class="line"> guint i;</td></tr> +<tr class="codeline" data-linenumber="2844"><td class="num" id="LN2844">2844</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2845"><td class="num" id="LN2845">2845</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2846"><td class="num" id="LN2846">2846</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2847"><td class="num" id="LN2847">2847</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2848"><td class="num" id="LN2848">2848</td><td class="line"> priv->settings_session = g_settings_new (<span class='macro'>SESSION_SCHEMA<span class='macro_popup'>"org.mate.session"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2849"><td class="num" id="LN2849">2849</td><td class="line"> priv->settings_lockdown = g_settings_new (<span class='macro'>LOCKDOWN_SCHEMA<span class='macro_popup'>"org.mate.lockdown"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2850"><td class="num" id="LN2850">2850</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2851"><td class="num" id="LN2851">2851</td><td class="line"> <span class='comment'>/* check if mate-screensaver is installed */</span></td></tr> +<tr class="codeline" data-linenumber="2852"><td class="num" id="LN2852">2852</td><td class="line"> g_settings_schema_source_list_schemas (g_settings_schema_source_get_default (), <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>, &schemas, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2853"><td class="num" id="LN2853">2853</td><td class="line"> schema_exists = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2854"><td class="num" id="LN2854">2854</td><td class="line"> <span class='keyword'>for</span> (i = 0; schemas[i] != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; i++) {</td></tr> +<tr class="codeline" data-linenumber="2855"><td class="num" id="LN2855">2855</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>g_str_equal (schemas[i], SCREENSAVER_SCHEMA)<span class='macro_popup'>(strcmp ((const char *) (schemas[i]), (const char *) ("org.mate.screensaver"<br>)) == 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2856"><td class="num" id="LN2856">2856</td><td class="line"> schema_exists = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2857"><td class="num" id="LN2857">2857</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="2858"><td class="num" id="LN2858">2858</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2859"><td class="num" id="LN2859">2859</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2860"><td class="num" id="LN2860">2860</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2861"><td class="num" id="LN2861">2861</td><td class="line"> g_strfreev (schemas);</td></tr> +<tr class="codeline" data-linenumber="2862"><td class="num" id="LN2862">2862</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2863"><td class="num" id="LN2863">2863</td><td class="line"> <span class='keyword'>if</span> (schema_exists == <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>)</td></tr> +<tr class="codeline" data-linenumber="2864"><td class="num" id="LN2864">2864</td><td class="line"> priv->settings_screensaver = g_settings_new (<span class='macro'>SCREENSAVER_SCHEMA<span class='macro_popup'>"org.mate.screensaver"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2865"><td class="num" id="LN2865">2865</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="2866"><td class="num" id="LN2866">2866</td><td class="line"> priv->settings_screensaver = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2867"><td class="num" id="LN2867">2867</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2868"><td class="num" id="LN2868">2868</td><td class="line"> priv->inhibitors = gsm_store_new ();</td></tr> +<tr class="codeline" data-linenumber="2869"><td class="num" id="LN2869">2869</td><td class="line"> <span class='macro'>g_signal_connect (priv->inhibitors,<span class='macro_popup'>g_signal_connect_data ((priv->inhibitors), ("added"), (((GCallback<br>) (on_store_inhibitor_added))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2870"><td class="num" id="LN2870">2870</td><td class="line"> <span class='string_literal'><span class='macro'>"added"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->inhibitors), ("added"), (((GCallback<br>) (on_store_inhibitor_added))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2871"><td class="num" id="LN2871">2871</td><td class="line"> <span class='macro'>G_CALLBACK (on_store_inhibitor_added),<span class='macro_popup'>g_signal_connect_data ((priv->inhibitors), ("added"), (((GCallback<br>) (on_store_inhibitor_added))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2872"><td class="num" id="LN2872">2872</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->inhibitors), ("added"), (((GCallback<br>) (on_store_inhibitor_added))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2873"><td class="num" id="LN2873">2873</td><td class="line"> <span class='macro'>g_signal_connect (priv->inhibitors,<span class='macro_popup'>g_signal_connect_data ((priv->inhibitors), ("removed"), ((<br>(GCallback) (on_store_inhibitor_removed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2874"><td class="num" id="LN2874">2874</td><td class="line"> <span class='string_literal'><span class='macro'>"removed"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->inhibitors), ("removed"), ((<br>(GCallback) (on_store_inhibitor_removed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2875"><td class="num" id="LN2875">2875</td><td class="line"> <span class='macro'>G_CALLBACK (on_store_inhibitor_removed),<span class='macro_popup'>g_signal_connect_data ((priv->inhibitors), ("removed"), ((<br>(GCallback) (on_store_inhibitor_removed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2876"><td class="num" id="LN2876">2876</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->inhibitors), ("removed"), ((<br>(GCallback) (on_store_inhibitor_removed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2877"><td class="num" id="LN2877">2877</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2878"><td class="num" id="LN2878">2878</td><td class="line"> priv->apps = gsm_store_new ();</td></tr> +<tr class="codeline" data-linenumber="2879"><td class="num" id="LN2879">2879</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2880"><td class="num" id="LN2880">2880</td><td class="line"> priv->presence = gsm_presence_new ();</td></tr> +<tr class="codeline" data-linenumber="2881"><td class="num" id="LN2881">2881</td><td class="line"> <span class='macro'>g_signal_connect (priv->presence,<span class='macro_popup'>g_signal_connect_data ((priv->presence), ("status-changed"<br>), (((GCallback) (on_presence_status_changed))), (manager), (<br>(void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2882"><td class="num" id="LN2882">2882</td><td class="line"> <span class='string_literal'><span class='macro'>"status-changed"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->presence), ("status-changed"<br>), (((GCallback) (on_presence_status_changed))), (manager), (<br>(void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2883"><td class="num" id="LN2883">2883</td><td class="line"> <span class='macro'>G_CALLBACK (on_presence_status_changed),<span class='macro_popup'>g_signal_connect_data ((priv->presence), ("status-changed"<br>), (((GCallback) (on_presence_status_changed))), (manager), (<br>(void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2884"><td class="num" id="LN2884">2884</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->presence), ("status-changed"<br>), (((GCallback) (on_presence_status_changed))), (manager), (<br>(void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2885"><td class="num" id="LN2885">2885</td><td class="line"> <span class='macro'>g_signal_connect (priv->settings_session,<span class='macro_popup'>g_signal_connect_data ((priv->settings_session), ("changed"<br>), (((GCallback) (on_gsettings_key_changed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2886"><td class="num" id="LN2886">2886</td><td class="line"> <span class='string_literal'><span class='macro'>"changed"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->settings_session), ("changed"<br>), (((GCallback) (on_gsettings_key_changed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2887"><td class="num" id="LN2887">2887</td><td class="line"> <span class='macro'>G_CALLBACK (on_gsettings_key_changed),<span class='macro_popup'>g_signal_connect_data ((priv->settings_session), ("changed"<br>), (((GCallback) (on_gsettings_key_changed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2888"><td class="num" id="LN2888">2888</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->settings_session), ("changed"<br>), (((GCallback) (on_gsettings_key_changed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2889"><td class="num" id="LN2889">2889</td><td class="line"> <span class='macro'>g_signal_connect (priv->settings_lockdown,<span class='macro_popup'>g_signal_connect_data ((priv->settings_lockdown), ("changed"<br>), (((GCallback) (on_gsettings_key_changed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2890"><td class="num" id="LN2890">2890</td><td class="line"> <span class='string_literal'><span class='macro'>"changed"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->settings_lockdown), ("changed"<br>), (((GCallback) (on_gsettings_key_changed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2891"><td class="num" id="LN2891">2891</td><td class="line"> <span class='macro'>G_CALLBACK (on_gsettings_key_changed),<span class='macro_popup'>g_signal_connect_data ((priv->settings_lockdown), ("changed"<br>), (((GCallback) (on_gsettings_key_changed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="2892"><td class="num" id="LN2892">2892</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->settings_lockdown), ("changed"<br>), (((GCallback) (on_gsettings_key_changed))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2893"><td class="num" id="LN2893">2893</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2894"><td class="num" id="LN2894">2894</td><td class="line"> load_idle_delay_from_gsettings (manager);</td></tr> +<tr class="codeline" data-linenumber="2895"><td class="num" id="LN2895">2895</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2896"><td class="num" id="LN2896">2896</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2897"><td class="num" id="LN2897">2897</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="2898"><td class="num" id="LN2898">2898</td><td class="line">gsm_manager_finalize (GObject *object)</td></tr> +<tr class="codeline" data-linenumber="2899"><td class="num" id="LN2899">2899</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2900"><td class="num" id="LN2900">2900</td><td class="line"> GsmManager *manager;</td></tr> +<tr class="codeline" data-linenumber="2901"><td class="num" id="LN2901">2901</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2902"><td class="num" id="LN2902">2902</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2903"><td class="num" id="LN2903">2903</td><td class="line"> <span class='macro'>g_return_if_fail (object != NULL)<span class='macro_popup'>do { if ((object != ((void*)0))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "object != NULL")<br>; return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2904"><td class="num" id="LN2904">2904</td><td class="line"> <span class='macro'>g_return_if_fail (GSM_IS_MANAGER (object))<span class='macro_popup'>do { if ((GSM_IS_MANAGER (object))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (object)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2905"><td class="num" id="LN2905">2905</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2906"><td class="num" id="LN2906">2906</td><td class="line"> manager = GSM_MANAGER (object);</td></tr> +<tr class="codeline" data-linenumber="2907"><td class="num" id="LN2907">2907</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2908"><td class="num" id="LN2908">2908</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2909"><td class="num" id="LN2909">2909</td><td class="line"> <span class='macro'>g_return_if_fail (priv != NULL)<span class='macro_popup'>do { if ((priv != ((void*)0))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "priv != NULL"); return<br>; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2910"><td class="num" id="LN2910">2910</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2911"><td class="num" id="LN2911">2911</td><td class="line"> <span class='macro'>G_OBJECT_CLASS (gsm_manager_parent_class)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((gsm_manager_parent_class)), (((GType) ((20) << (2)<br>)))))))</span></span>->finalize (object);</td></tr> +<tr class="codeline" data-linenumber="2912"><td class="num" id="LN2912">2912</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2913"><td class="num" id="LN2913">2913</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2914"><td class="num" id="LN2914">2914</td><td class="line">GsmManager *</td></tr> +<tr class="codeline" data-linenumber="2915"><td class="num" id="LN2915">2915</td><td class="line">gsm_manager_new (GsmStore *client_store,</td></tr> +<tr class="codeline" data-linenumber="2916"><td class="num" id="LN2916">2916</td><td class="line"> gboolean failsafe)</td></tr> +<tr class="codeline" data-linenumber="2917"><td class="num" id="LN2917">2917</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2918"><td class="num" id="LN2918">2918</td><td class="line"> <span class='keyword'>if</span> (manager_object != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2919"><td class="num" id="LN2919">2919</td><td class="line"> <span class='macro'>g_object_ref (manager_object)<span class='macro_popup'>((__typeof__ (manager_object)) (g_object_ref) (manager_object<br>))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2920"><td class="num" id="LN2920">2920</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="2921"><td class="num" id="LN2921">2921</td><td class="line"> gboolean res;</td></tr> +<tr class="codeline" data-linenumber="2922"><td class="num" id="LN2922">2922</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2923"><td class="num" id="LN2923">2923</td><td class="line"> manager_object = g_object_new (<span class='macro'>GSM_TYPE_MANAGER<span class='macro_popup'>(gsm_manager_get_type ())</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2924"><td class="num" id="LN2924">2924</td><td class="line"> <span class='string_literal'>"client-store"</span>, client_store,</td></tr> +<tr class="codeline" data-linenumber="2925"><td class="num" id="LN2925">2925</td><td class="line"> <span class='string_literal'>"failsafe"</span>, failsafe,</td></tr> +<tr class="codeline" data-linenumber="2926"><td class="num" id="LN2926">2926</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="2927"><td class="num" id="LN2927">2927</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2928"><td class="num" id="LN2928">2928</td><td class="line"> g_object_add_weak_pointer (manager_object,</td></tr> +<tr class="codeline" data-linenumber="2929"><td class="num" id="LN2929">2929</td><td class="line"> (gpointer *) &manager_object);</td></tr> +<tr class="codeline" data-linenumber="2930"><td class="num" id="LN2930">2930</td><td class="line"> res = register_manager (manager_object);</td></tr> +<tr class="codeline" data-linenumber="2931"><td class="num" id="LN2931">2931</td><td class="line"> <span class='keyword'>if</span> (! res) {</td></tr> +<tr class="codeline" data-linenumber="2932"><td class="num" id="LN2932">2932</td><td class="line"> g_object_unref (manager_object);</td></tr> +<tr class="codeline" data-linenumber="2933"><td class="num" id="LN2933">2933</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2934"><td class="num" id="LN2934">2934</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2935"><td class="num" id="LN2935">2935</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2936"><td class="num" id="LN2936">2936</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2937"><td class="num" id="LN2937">2937</td><td class="line"> <span class='keyword'>return</span> GSM_MANAGER (manager_object);</td></tr> +<tr class="codeline" data-linenumber="2938"><td class="num" id="LN2938">2938</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2939"><td class="num" id="LN2939">2939</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2940"><td class="num" id="LN2940">2940</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="2941"><td class="num" id="LN2941">2941</td><td class="line">gsm_manager_setenv (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="2942"><td class="num" id="LN2942">2942</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *variable,</td></tr> +<tr class="codeline" data-linenumber="2943"><td class="num" id="LN2943">2943</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *value,</td></tr> +<tr class="codeline" data-linenumber="2944"><td class="num" id="LN2944">2944</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="2945"><td class="num" id="LN2945">2945</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2946"><td class="num" id="LN2946">2946</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2947"><td class="num" id="LN2947">2947</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2948"><td class="num" id="LN2948">2948</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2949"><td class="num" id="LN2949">2949</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2950"><td class="num" id="LN2950">2950</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2951"><td class="num" id="LN2951">2951</td><td class="line"> <span class='keyword'>if</span> (priv->phase > GSM_MANAGER_PHASE_INITIALIZATION) {</td></tr> +<tr class="codeline" data-linenumber="2952"><td class="num" id="LN2952">2952</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="2953"><td class="num" id="LN2953">2953</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2954"><td class="num" id="LN2954">2954</td><td class="line"> GSM_MANAGER_ERROR_NOT_IN_INITIALIZATION,</td></tr> +<tr class="codeline" data-linenumber="2955"><td class="num" id="LN2955">2955</td><td class="line"> <span class='string_literal'>"Setenv interface is only available during the Initialization phase"</span>);</td></tr> +<tr class="codeline" data-linenumber="2956"><td class="num" id="LN2956">2956</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2957"><td class="num" id="LN2957">2957</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2958"><td class="num" id="LN2958">2958</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2959"><td class="num" id="LN2959">2959</td><td class="line"> gsm_util_setenv (variable, value);</td></tr> +<tr class="codeline" data-linenumber="2960"><td class="num" id="LN2960">2960</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2961"><td class="num" id="LN2961">2961</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2962"><td class="num" id="LN2962">2962</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2963"><td class="num" id="LN2963">2963</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2964"><td class="num" id="LN2964">2964</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="2965"><td class="num" id="LN2965">2965</td><td class="line">gsm_manager_initialization_error (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="2966"><td class="num" id="LN2966">2966</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *message,</td></tr> +<tr class="codeline" data-linenumber="2967"><td class="num" id="LN2967">2967</td><td class="line"> gboolean fatal,</td></tr> +<tr class="codeline" data-linenumber="2968"><td class="num" id="LN2968">2968</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="2969"><td class="num" id="LN2969">2969</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2970"><td class="num" id="LN2970">2970</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2971"><td class="num" id="LN2971">2971</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2972"><td class="num" id="LN2972">2972</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2973"><td class="num" id="LN2973">2973</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2974"><td class="num" id="LN2974">2974</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2975"><td class="num" id="LN2975">2975</td><td class="line"> <span class='keyword'>if</span> (priv->phase > GSM_MANAGER_PHASE_INITIALIZATION) {</td></tr> +<tr class="codeline" data-linenumber="2976"><td class="num" id="LN2976">2976</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="2977"><td class="num" id="LN2977">2977</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="2978"><td class="num" id="LN2978">2978</td><td class="line"> GSM_MANAGER_ERROR_NOT_IN_INITIALIZATION,</td></tr> +<tr class="codeline" data-linenumber="2979"><td class="num" id="LN2979">2979</td><td class="line"> <span class='string_literal'>"InitializationError interface is only available during the Initialization phase"</span>);</td></tr> +<tr class="codeline" data-linenumber="2980"><td class="num" id="LN2980">2980</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2981"><td class="num" id="LN2981">2981</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2982"><td class="num" id="LN2982">2982</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2983"><td class="num" id="LN2983">2983</td><td class="line"> gsm_util_init_error (fatal, <span class='string_literal'>"%s"</span>, message);</td></tr> +<tr class="codeline" data-linenumber="2984"><td class="num" id="LN2984">2984</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2985"><td class="num" id="LN2985">2985</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2986"><td class="num" id="LN2986">2986</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="2987"><td class="num" id="LN2987">2987</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2988"><td class="num" id="LN2988">2988</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="2989"><td class="num" id="LN2989">2989</td><td class="line">gsm_manager_is_switch_user_inhibited (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="2990"><td class="num" id="LN2990">2990</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="2991"><td class="num" id="LN2991">2991</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="2992"><td class="num" id="LN2992">2992</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="2993"><td class="num" id="LN2993">2993</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2994"><td class="num" id="LN2994">2994</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="2995"><td class="num" id="LN2995">2995</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="2996"><td class="num" id="LN2996">2996</td><td class="line"> <span class='keyword'>if</span> (priv->inhibitors == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="2997"><td class="num" id="LN2997">2997</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="2998"><td class="num" id="LN2998">2998</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="2999"><td class="num" id="LN2999">2999</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3000"><td class="num" id="LN3000">3000</td><td class="line"> inhibitor = (GsmInhibitor *)gsm_store_find (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="3001"><td class="num" id="LN3001">3001</td><td class="line"> (GsmStoreFunc)inhibitor_has_flag,</td></tr> +<tr class="codeline" data-linenumber="3002"><td class="num" id="LN3002">3002</td><td class="line"> <span class='macro'>GUINT_TO_POINTER (GSM_INHIBITOR_FLAG_SWITCH_USER)<span class='macro_popup'>((gpointer) (gulong) (GSM_INHIBITOR_FLAG_SWITCH_USER))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3003"><td class="num" id="LN3003">3003</td><td class="line"> <span class='keyword'>if</span> (inhibitor == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3004"><td class="num" id="LN3004">3004</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3005"><td class="num" id="LN3005">3005</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3006"><td class="num" id="LN3006">3006</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3007"><td class="num" id="LN3007">3007</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3008"><td class="num" id="LN3008">3008</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3009"><td class="num" id="LN3009">3009</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="3010"><td class="num" id="LN3010">3010</td><td class="line">gsm_manager_is_suspend_inhibited (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3011"><td class="num" id="LN3011">3011</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3012"><td class="num" id="LN3012">3012</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="3013"><td class="num" id="LN3013">3013</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3014"><td class="num" id="LN3014">3014</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3015"><td class="num" id="LN3015">3015</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3016"><td class="num" id="LN3016">3016</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3017"><td class="num" id="LN3017">3017</td><td class="line"> <span class='keyword'>if</span> (priv->inhibitors == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3018"><td class="num" id="LN3018">3018</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3019"><td class="num" id="LN3019">3019</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3020"><td class="num" id="LN3020">3020</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3021"><td class="num" id="LN3021">3021</td><td class="line"> inhibitor = (GsmInhibitor *)gsm_store_find (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="3022"><td class="num" id="LN3022">3022</td><td class="line"> (GsmStoreFunc)inhibitor_has_flag,</td></tr> +<tr class="codeline" data-linenumber="3023"><td class="num" id="LN3023">3023</td><td class="line"> <span class='macro'>GUINT_TO_POINTER (GSM_INHIBITOR_FLAG_SUSPEND)<span class='macro_popup'>((gpointer) (gulong) (GSM_INHIBITOR_FLAG_SUSPEND))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3024"><td class="num" id="LN3024">3024</td><td class="line"> <span class='keyword'>if</span> (inhibitor == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3025"><td class="num" id="LN3025">3025</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3026"><td class="num" id="LN3026">3026</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3027"><td class="num" id="LN3027">3027</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3028"><td class="num" id="LN3028">3028</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3029"><td class="num" id="LN3029">3029</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3030"><td class="num" id="LN3030">3030</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3031"><td class="num" id="LN3031">3031</td><td class="line">request_reboot_privileges_completed_consolekit (GsmConsolekit *consolekit,</td></tr> +<tr class="codeline" data-linenumber="3032"><td class="num" id="LN3032">3032</td><td class="line"> gboolean success,</td></tr> +<tr class="codeline" data-linenumber="3033"><td class="num" id="LN3033">3033</td><td class="line"> gboolean ask_later,</td></tr> +<tr class="codeline" data-linenumber="3034"><td class="num" id="LN3034">3034</td><td class="line"> GError *error,</td></tr> +<tr class="codeline" data-linenumber="3035"><td class="num" id="LN3035">3035</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3036"><td class="num" id="LN3036">3036</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3037"><td class="num" id="LN3037">3037</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3038"><td class="num" id="LN3038">3038</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3039"><td class="num" id="LN3039">3039</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3040"><td class="num" id="LN3040">3040</td><td class="line"> <span class='comment'>/* make sure we disconnect the signal handler so that it's not called</span></td></tr> +<tr class="codeline" data-linenumber="3041"><td class="num" id="LN3041">3041</td><td class="line"> <span class='comment'>* again next time the event is fired -- this can happen if the reboot</span></td></tr> +<tr class="codeline" data-linenumber="3042"><td class="num" id="LN3042">3042</td><td class="line"> <span class='comment'>* is cancelled. */</span></td></tr> +<tr class="codeline" data-linenumber="3043"><td class="num" id="LN3043">3043</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (consolekit,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_consolekit), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3044"><td class="num" id="LN3044">3044</td><td class="line"> <span class='macro'>request_reboot_privileges_completed_consolekit,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_consolekit), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3045"><td class="num" id="LN3045">3045</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_consolekit), (manager<br>))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3046"><td class="num" id="LN3046">3046</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3047"><td class="num" id="LN3047">3047</td><td class="line"> g_object_unref (consolekit);</td></tr> +<tr class="codeline" data-linenumber="3048"><td class="num" id="LN3048">3048</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3049"><td class="num" id="LN3049">3049</td><td class="line"> <span class='keyword'>if</span> (success) {</td></tr> +<tr class="codeline" data-linenumber="3050"><td class="num" id="LN3050">3050</td><td class="line"> <span class='keyword'>if</span> (ask_later) {</td></tr> +<tr class="codeline" data-linenumber="3051"><td class="num" id="LN3051">3051</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_REBOOT_INTERACT;</td></tr> +<tr class="codeline" data-linenumber="3052"><td class="num" id="LN3052">3052</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3053"><td class="num" id="LN3053">3053</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_REBOOT;</td></tr> +<tr class="codeline" data-linenumber="3054"><td class="num" id="LN3054">3054</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3055"><td class="num" id="LN3055">3055</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3056"><td class="num" id="LN3056">3056</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3057"><td class="num" id="LN3057">3057</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3058"><td class="num" id="LN3058">3058</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3059"><td class="num" id="LN3059">3059</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3060"><td class="num" id="LN3060">3060</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3061"><td class="num" id="LN3061">3061</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3062"><td class="num" id="LN3062">3062</td><td class="line">request_reboot_privileges_completed_systemd (GsmSystemd *systemd,</td></tr> +<tr class="codeline" data-linenumber="3063"><td class="num" id="LN3063">3063</td><td class="line"> gboolean success,</td></tr> +<tr class="codeline" data-linenumber="3064"><td class="num" id="LN3064">3064</td><td class="line"> gboolean ask_later,</td></tr> +<tr class="codeline" data-linenumber="3065"><td class="num" id="LN3065">3065</td><td class="line"> GError *error,</td></tr> +<tr class="codeline" data-linenumber="3066"><td class="num" id="LN3066">3066</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3067"><td class="num" id="LN3067">3067</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3068"><td class="num" id="LN3068">3068</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3069"><td class="num" id="LN3069">3069</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3070"><td class="num" id="LN3070">3070</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3071"><td class="num" id="LN3071">3071</td><td class="line"> <span class='comment'>/* make sure we disconnect the signal handler so that it's not called</span></td></tr> +<tr class="codeline" data-linenumber="3072"><td class="num" id="LN3072">3072</td><td class="line"> <span class='comment'>* again next time the event is fired -- this can happen if the reboot</span></td></tr> +<tr class="codeline" data-linenumber="3073"><td class="num" id="LN3073">3073</td><td class="line"> <span class='comment'>* is cancelled. */</span></td></tr> +<tr class="codeline" data-linenumber="3074"><td class="num" id="LN3074">3074</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (systemd,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_systemd), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="3075"><td class="num" id="LN3075">3075</td><td class="line"> <span class='macro'>request_reboot_privileges_completed_systemd,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_systemd), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="3076"><td class="num" id="LN3076">3076</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_systemd), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3077"><td class="num" id="LN3077">3077</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3078"><td class="num" id="LN3078">3078</td><td class="line"> g_object_unref (systemd);</td></tr> +<tr class="codeline" data-linenumber="3079"><td class="num" id="LN3079">3079</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3080"><td class="num" id="LN3080">3080</td><td class="line"> <span class='keyword'>if</span> (success) {</td></tr> +<tr class="codeline" data-linenumber="3081"><td class="num" id="LN3081">3081</td><td class="line"> <span class='keyword'>if</span> (ask_later) {</td></tr> +<tr class="codeline" data-linenumber="3082"><td class="num" id="LN3082">3082</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_REBOOT_INTERACT;</td></tr> +<tr class="codeline" data-linenumber="3083"><td class="num" id="LN3083">3083</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3084"><td class="num" id="LN3084">3084</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_REBOOT;</td></tr> +<tr class="codeline" data-linenumber="3085"><td class="num" id="LN3085">3085</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3086"><td class="num" id="LN3086">3086</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3087"><td class="num" id="LN3087">3087</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3088"><td class="num" id="LN3088">3088</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3089"><td class="num" id="LN3089">3089</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3090"><td class="num" id="LN3090">3090</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3091"><td class="num" id="LN3091">3091</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3092"><td class="num" id="LN3092">3092</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3093"><td class="num" id="LN3093">3093</td><td class="line">request_reboot (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3094"><td class="num" id="LN3094">3094</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3095"><td class="num" id="LN3095">3095</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="3096"><td class="num" id="LN3096">3096</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3097"><td class="num" id="LN3097">3097</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="3098"><td class="num" id="LN3098">3098</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3099"><td class="num" id="LN3099">3099</td><td class="line"> gboolean success;</td></tr> +<tr class="codeline" data-linenumber="3100"><td class="num" id="LN3100">3100</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3101"><td class="num" id="LN3101">3101</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3102"><td class="num" id="LN3102">3102</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: requesting reboot"</span>);</td></tr> +<tr class="codeline" data-linenumber="3103"><td class="num" id="LN3103">3103</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3104"><td class="num" id="LN3104">3104</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3105"><td class="num" id="LN3105">3105</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3106"><td class="num" id="LN3106">3106</td><td class="line"> <span class='comment'>/* We request the privileges before doing anything. There are a few</span></td></tr> +<tr class="codeline" data-linenumber="3107"><td class="num" id="LN3107">3107</td><td class="line"> <span class='comment'>* different cases here:</span></td></tr> +<tr class="codeline" data-linenumber="3108"><td class="num" id="LN3108">3108</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="3109"><td class="num" id="LN3109">3109</td><td class="line"> <span class='comment'>* - no systemd: we fallback on ConsoleKit</span></td></tr> +<tr class="codeline" data-linenumber="3110"><td class="num" id="LN3110">3110</td><td class="line"> <span class='comment'>* - no ConsoleKit: we fallback on MDM</span></td></tr> +<tr class="codeline" data-linenumber="3111"><td class="num" id="LN3111">3111</td><td class="line"> <span class='comment'>* - no password required: everything is fine</span></td></tr> +<tr class="codeline" data-linenumber="3112"><td class="num" id="LN3112">3112</td><td class="line"> <span class='comment'>* - password asked once: we ask for it now. If the user enters it</span></td></tr> +<tr class="codeline" data-linenumber="3113"><td class="num" id="LN3113">3113</td><td class="line"> <span class='comment'>* fine, then all is great. If the user doesn't enter it fine, we</span></td></tr> +<tr class="codeline" data-linenumber="3114"><td class="num" id="LN3114">3114</td><td class="line"> <span class='comment'>* don't do anything (so no logout).</span></td></tr> +<tr class="codeline" data-linenumber="3115"><td class="num" id="LN3115">3115</td><td class="line"> <span class='comment'>* - password asked each time: we don't ask it for now since we don't</span></td></tr> +<tr class="codeline" data-linenumber="3116"><td class="num" id="LN3116">3116</td><td class="line"> <span class='comment'>* want to ask for it twice. Instead we'll ask for it at the very</span></td></tr> +<tr class="codeline" data-linenumber="3117"><td class="num" id="LN3117">3117</td><td class="line"> <span class='comment'>* end. If the user will enter it fine, then all is great again. If</span></td></tr> +<tr class="codeline" data-linenumber="3118"><td class="num" id="LN3118">3118</td><td class="line"> <span class='comment'>* the user doesn't enter it fine, then we'll just fallback to MDM.</span></td></tr> +<tr class="codeline" data-linenumber="3119"><td class="num" id="LN3119">3119</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="3120"><td class="num" id="LN3120">3120</td><td class="line"> <span class='comment'>* The last case (password asked each time) is a bit broken, but</span></td></tr> +<tr class="codeline" data-linenumber="3121"><td class="num" id="LN3121">3121</td><td class="line"> <span class='comment'>* there's really nothing we can do about it. Generally speaking,</span></td></tr> +<tr class="codeline" data-linenumber="3122"><td class="num" id="LN3122">3122</td><td class="line"> <span class='comment'>* though, the password will only be asked once (unless the system is</span></td></tr> +<tr class="codeline" data-linenumber="3123"><td class="num" id="LN3123">3123</td><td class="line"> <span class='comment'>* configured in paranoid mode), and most probably only if there are</span></td></tr> +<tr class="codeline" data-linenumber="3124"><td class="num" id="LN3124">3124</td><td class="line"> <span class='comment'>* more than one user connected. So the general case is that it will</span></td></tr> +<tr class="codeline" data-linenumber="3125"><td class="num" id="LN3125">3125</td><td class="line"> <span class='comment'>* just work fine.</span></td></tr> +<tr class="codeline" data-linenumber="3126"><td class="num" id="LN3126">3126</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="3127"><td class="num" id="LN3127">3127</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3128"><td class="num" id="LN3128">3128</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3129"><td class="num" id="LN3129">3129</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3130"><td class="num" id="LN3130">3130</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="3131"><td class="num" id="LN3131">3131</td><td class="line"> <span class='macro'>g_signal_connect (systemd,<span class='macro_popup'>g_signal_connect_data ((systemd), ("privileges-completed"), (<br>((GCallback) (request_reboot_privileges_completed_systemd))),<br> (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3132"><td class="num" id="LN3132">3132</td><td class="line"> <span class='string_literal'><span class='macro'>"privileges-completed"</span>,<span class='macro_popup'>g_signal_connect_data ((systemd), ("privileges-completed"), (<br>((GCallback) (request_reboot_privileges_completed_systemd))),<br> (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3133"><td class="num" id="LN3133">3133</td><td class="line"> <span class='macro'>G_CALLBACK (request_reboot_privileges_completed_systemd),<span class='macro_popup'>g_signal_connect_data ((systemd), ("privileges-completed"), (<br>((GCallback) (request_reboot_privileges_completed_systemd))),<br> (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3134"><td class="num" id="LN3134">3134</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((systemd), ("privileges-completed"), (<br>((GCallback) (request_reboot_privileges_completed_systemd))),<br> (manager), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3135"><td class="num" id="LN3135">3135</td><td class="line"> success = gsm_systemd_get_restart_privileges (systemd);</td></tr> +<tr class="codeline" data-linenumber="3136"><td class="num" id="LN3136">3136</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3137"><td class="num" id="LN3137">3137</td><td class="line"> <span class='keyword'>if</span> (!success) {</td></tr> +<tr class="codeline" data-linenumber="3138"><td class="num" id="LN3138">3138</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (systemd,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_systemd), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="3139"><td class="num" id="LN3139">3139</td><td class="line"> <span class='macro'>request_reboot_privileges_completed_systemd,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_systemd), (manager))</span></span></td></tr> +<tr class="codeline" data-linenumber="3140"><td class="num" id="LN3140">3140</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_systemd), (manager))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3141"><td class="num" id="LN3141">3141</td><td class="line"> g_object_unref (systemd);</td></tr> +<tr class="codeline" data-linenumber="3142"><td class="num" id="LN3142">3142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3143"><td class="num" id="LN3143">3143</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_REBOOT_MDM;</td></tr> +<tr class="codeline" data-linenumber="3144"><td class="num" id="LN3144">3144</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3145"><td class="num" id="LN3145">3145</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3146"><td class="num" id="LN3146">3146</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3147"><td class="num" id="LN3147">3147</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3148"><td class="num" id="LN3148">3148</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3149"><td class="num" id="LN3149">3149</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="3150"><td class="num" id="LN3150">3150</td><td class="line"> <span class='macro'>g_signal_connect (consolekit,<span class='macro_popup'>g_signal_connect_data ((consolekit), ("privileges-completed")<br>, (((GCallback) (request_reboot_privileges_completed_consolekit<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3151"><td class="num" id="LN3151">3151</td><td class="line"> <span class='string_literal'><span class='macro'>"privileges-completed"</span>,<span class='macro_popup'>g_signal_connect_data ((consolekit), ("privileges-completed")<br>, (((GCallback) (request_reboot_privileges_completed_consolekit<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3152"><td class="num" id="LN3152">3152</td><td class="line"> <span class='macro'>G_CALLBACK (request_reboot_privileges_completed_consolekit),<span class='macro_popup'>g_signal_connect_data ((consolekit), ("privileges-completed")<br>, (((GCallback) (request_reboot_privileges_completed_consolekit<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3153"><td class="num" id="LN3153">3153</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((consolekit), ("privileges-completed")<br>, (((GCallback) (request_reboot_privileges_completed_consolekit<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3154"><td class="num" id="LN3154">3154</td><td class="line"> success = gsm_consolekit_get_restart_privileges (consolekit);</td></tr> +<tr class="codeline" data-linenumber="3155"><td class="num" id="LN3155">3155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3156"><td class="num" id="LN3156">3156</td><td class="line"> <span class='keyword'>if</span> (!success) {</td></tr> +<tr class="codeline" data-linenumber="3157"><td class="num" id="LN3157">3157</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (consolekit,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_consolekit), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3158"><td class="num" id="LN3158">3158</td><td class="line"> <span class='macro'>request_reboot_privileges_completed_consolekit,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_consolekit), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3159"><td class="num" id="LN3159">3159</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_reboot_privileges_completed_consolekit), (manager<br>))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3160"><td class="num" id="LN3160">3160</td><td class="line"> g_object_unref (consolekit);</td></tr> +<tr class="codeline" data-linenumber="3161"><td class="num" id="LN3161">3161</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3162"><td class="num" id="LN3162">3162</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_REBOOT_MDM;</td></tr> +<tr class="codeline" data-linenumber="3163"><td class="num" id="LN3163">3163</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3164"><td class="num" id="LN3164">3164</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3165"><td class="num" id="LN3165">3165</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3166"><td class="num" id="LN3166">3166</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3167"><td class="num" id="LN3167">3167</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3168"><td class="num" id="LN3168">3168</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3169"><td class="num" id="LN3169">3169</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3170"><td class="num" id="LN3170">3170</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3171"><td class="num" id="LN3171">3171</td><td class="line">request_shutdown_privileges_completed_consolekit (GsmConsolekit *consolekit,</td></tr> +<tr class="codeline" data-linenumber="3172"><td class="num" id="LN3172">3172</td><td class="line"> gboolean success,</td></tr> +<tr class="codeline" data-linenumber="3173"><td class="num" id="LN3173">3173</td><td class="line"> gboolean ask_later,</td></tr> +<tr class="codeline" data-linenumber="3174"><td class="num" id="LN3174">3174</td><td class="line"> GError *error,</td></tr> +<tr class="codeline" data-linenumber="3175"><td class="num" id="LN3175">3175</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3176"><td class="num" id="LN3176">3176</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3177"><td class="num" id="LN3177">3177</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3178"><td class="num" id="LN3178">3178</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3179"><td class="num" id="LN3179">3179</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3180"><td class="num" id="LN3180">3180</td><td class="line"> <span class='comment'>/* make sure we disconnect the signal handler so that it's not called</span></td></tr> +<tr class="codeline" data-linenumber="3181"><td class="num" id="LN3181">3181</td><td class="line"> <span class='comment'>* again next time the event is fired -- this can happen if the reboot</span></td></tr> +<tr class="codeline" data-linenumber="3182"><td class="num" id="LN3182">3182</td><td class="line"> <span class='comment'>* is cancelled. */</span></td></tr> +<tr class="codeline" data-linenumber="3183"><td class="num" id="LN3183">3183</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (consolekit,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_consolekit), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3184"><td class="num" id="LN3184">3184</td><td class="line"> <span class='macro'>request_shutdown_privileges_completed_consolekit,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_consolekit), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3185"><td class="num" id="LN3185">3185</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_consolekit), (manager<br>))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3186"><td class="num" id="LN3186">3186</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3187"><td class="num" id="LN3187">3187</td><td class="line"> g_object_unref (consolekit);</td></tr> +<tr class="codeline" data-linenumber="3188"><td class="num" id="LN3188">3188</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3189"><td class="num" id="LN3189">3189</td><td class="line"> <span class='keyword'>if</span> (success) {</td></tr> +<tr class="codeline" data-linenumber="3190"><td class="num" id="LN3190">3190</td><td class="line"> <span class='keyword'>if</span> (ask_later) {</td></tr> +<tr class="codeline" data-linenumber="3191"><td class="num" id="LN3191">3191</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_SHUTDOWN_INTERACT;</td></tr> +<tr class="codeline" data-linenumber="3192"><td class="num" id="LN3192">3192</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3193"><td class="num" id="LN3193">3193</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_SHUTDOWN;</td></tr> +<tr class="codeline" data-linenumber="3194"><td class="num" id="LN3194">3194</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3195"><td class="num" id="LN3195">3195</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3196"><td class="num" id="LN3196">3196</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3197"><td class="num" id="LN3197">3197</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3198"><td class="num" id="LN3198">3198</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3199"><td class="num" id="LN3199">3199</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3200"><td class="num" id="LN3200">3200</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3201"><td class="num" id="LN3201">3201</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3202"><td class="num" id="LN3202">3202</td><td class="line">request_shutdown_privileges_completed_systemd (GsmSystemd *systemd,</td></tr> +<tr class="codeline" data-linenumber="3203"><td class="num" id="LN3203">3203</td><td class="line"> gboolean success,</td></tr> +<tr class="codeline" data-linenumber="3204"><td class="num" id="LN3204">3204</td><td class="line"> gboolean ask_later,</td></tr> +<tr class="codeline" data-linenumber="3205"><td class="num" id="LN3205">3205</td><td class="line"> GError *error,</td></tr> +<tr class="codeline" data-linenumber="3206"><td class="num" id="LN3206">3206</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3207"><td class="num" id="LN3207">3207</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3208"><td class="num" id="LN3208">3208</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3209"><td class="num" id="LN3209">3209</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3210"><td class="num" id="LN3210">3210</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3211"><td class="num" id="LN3211">3211</td><td class="line"> <span class='comment'>/* make sure we disconnect the signal handler so that it's not called</span></td></tr> +<tr class="codeline" data-linenumber="3212"><td class="num" id="LN3212">3212</td><td class="line"> <span class='comment'>* again next time the event is fired -- this can happen if the reboot</span></td></tr> +<tr class="codeline" data-linenumber="3213"><td class="num" id="LN3213">3213</td><td class="line"> <span class='comment'>* is cancelled. */</span></td></tr> +<tr class="codeline" data-linenumber="3214"><td class="num" id="LN3214">3214</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (systemd,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_systemd), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3215"><td class="num" id="LN3215">3215</td><td class="line"> <span class='macro'>request_shutdown_privileges_completed_systemd,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_systemd), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3216"><td class="num" id="LN3216">3216</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_systemd), (manager<br>))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3217"><td class="num" id="LN3217">3217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3218"><td class="num" id="LN3218">3218</td><td class="line"> g_object_unref (systemd);</td></tr> +<tr class="codeline" data-linenumber="3219"><td class="num" id="LN3219">3219</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3220"><td class="num" id="LN3220">3220</td><td class="line"> <span class='keyword'>if</span> (success) {</td></tr> +<tr class="codeline" data-linenumber="3221"><td class="num" id="LN3221">3221</td><td class="line"> <span class='keyword'>if</span> (ask_later) {</td></tr> +<tr class="codeline" data-linenumber="3222"><td class="num" id="LN3222">3222</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_SHUTDOWN_INTERACT;</td></tr> +<tr class="codeline" data-linenumber="3223"><td class="num" id="LN3223">3223</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3224"><td class="num" id="LN3224">3224</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_SHUTDOWN;</td></tr> +<tr class="codeline" data-linenumber="3225"><td class="num" id="LN3225">3225</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3226"><td class="num" id="LN3226">3226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3227"><td class="num" id="LN3227">3227</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3228"><td class="num" id="LN3228">3228</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3229"><td class="num" id="LN3229">3229</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3230"><td class="num" id="LN3230">3230</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3231"><td class="num" id="LN3231">3231</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3232"><td class="num" id="LN3232">3232</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3233"><td class="num" id="LN3233">3233</td><td class="line">request_shutdown (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3234"><td class="num" id="LN3234">3234</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3235"><td class="num" id="LN3235">3235</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="3236"><td class="num" id="LN3236">3236</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3237"><td class="num" id="LN3237">3237</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="3238"><td class="num" id="LN3238">3238</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3239"><td class="num" id="LN3239">3239</td><td class="line"> gboolean success;</td></tr> +<tr class="codeline" data-linenumber="3240"><td class="num" id="LN3240">3240</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3241"><td class="num" id="LN3241">3241</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3242"><td class="num" id="LN3242">3242</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: requesting shutdown"</span>);</td></tr> +<tr class="codeline" data-linenumber="3243"><td class="num" id="LN3243">3243</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3244"><td class="num" id="LN3244">3244</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3245"><td class="num" id="LN3245">3245</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3246"><td class="num" id="LN3246">3246</td><td class="line"> <span class='comment'>/* See the comment in request_reboot() for some more details about how</span></td></tr> +<tr class="codeline" data-linenumber="3247"><td class="num" id="LN3247">3247</td><td class="line"> <span class='comment'>* this works. */</span></td></tr> +<tr class="codeline" data-linenumber="3248"><td class="num" id="LN3248">3248</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3249"><td class="num" id="LN3249">3249</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3250"><td class="num" id="LN3250">3250</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3251"><td class="num" id="LN3251">3251</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="3252"><td class="num" id="LN3252">3252</td><td class="line"> <span class='macro'>g_signal_connect (systemd,<span class='macro_popup'>g_signal_connect_data ((systemd), ("privileges-completed"), (<br>((GCallback) (request_shutdown_privileges_completed_systemd))<br>), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3253"><td class="num" id="LN3253">3253</td><td class="line"> <span class='string_literal'><span class='macro'>"privileges-completed"</span>,<span class='macro_popup'>g_signal_connect_data ((systemd), ("privileges-completed"), (<br>((GCallback) (request_shutdown_privileges_completed_systemd))<br>), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3254"><td class="num" id="LN3254">3254</td><td class="line"> <span class='macro'>G_CALLBACK (request_shutdown_privileges_completed_systemd),<span class='macro_popup'>g_signal_connect_data ((systemd), ("privileges-completed"), (<br>((GCallback) (request_shutdown_privileges_completed_systemd))<br>), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3255"><td class="num" id="LN3255">3255</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((systemd), ("privileges-completed"), (<br>((GCallback) (request_shutdown_privileges_completed_systemd))<br>), (manager), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3256"><td class="num" id="LN3256">3256</td><td class="line"> success = gsm_systemd_get_stop_privileges (systemd);</td></tr> +<tr class="codeline" data-linenumber="3257"><td class="num" id="LN3257">3257</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3258"><td class="num" id="LN3258">3258</td><td class="line"> <span class='keyword'>if</span> (!success) {</td></tr> +<tr class="codeline" data-linenumber="3259"><td class="num" id="LN3259">3259</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (systemd,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_systemd), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3260"><td class="num" id="LN3260">3260</td><td class="line"> <span class='macro'>request_shutdown_privileges_completed_systemd,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_systemd), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3261"><td class="num" id="LN3261">3261</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((systemd), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_systemd), (manager<br>))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3262"><td class="num" id="LN3262">3262</td><td class="line"> g_object_unref (systemd);</td></tr> +<tr class="codeline" data-linenumber="3263"><td class="num" id="LN3263">3263</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3264"><td class="num" id="LN3264">3264</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_SHUTDOWN_MDM;</td></tr> +<tr class="codeline" data-linenumber="3265"><td class="num" id="LN3265">3265</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3266"><td class="num" id="LN3266">3266</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3267"><td class="num" id="LN3267">3267</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3268"><td class="num" id="LN3268">3268</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3269"><td class="num" id="LN3269">3269</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3270"><td class="num" id="LN3270">3270</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="3271"><td class="num" id="LN3271">3271</td><td class="line"> <span class='macro'>g_signal_connect (consolekit,<span class='macro_popup'>g_signal_connect_data ((consolekit), ("privileges-completed")<br>, (((GCallback) (request_shutdown_privileges_completed_consolekit<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3272"><td class="num" id="LN3272">3272</td><td class="line"> <span class='string_literal'><span class='macro'>"privileges-completed"</span>,<span class='macro_popup'>g_signal_connect_data ((consolekit), ("privileges-completed")<br>, (((GCallback) (request_shutdown_privileges_completed_consolekit<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3273"><td class="num" id="LN3273">3273</td><td class="line"> <span class='macro'>G_CALLBACK (request_shutdown_privileges_completed_consolekit),<span class='macro_popup'>g_signal_connect_data ((consolekit), ("privileges-completed")<br>, (((GCallback) (request_shutdown_privileges_completed_consolekit<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3274"><td class="num" id="LN3274">3274</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((consolekit), ("privileges-completed")<br>, (((GCallback) (request_shutdown_privileges_completed_consolekit<br>))), (manager), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3275"><td class="num" id="LN3275">3275</td><td class="line"> success = gsm_consolekit_get_stop_privileges (consolekit);</td></tr> +<tr class="codeline" data-linenumber="3276"><td class="num" id="LN3276">3276</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3277"><td class="num" id="LN3277">3277</td><td class="line"> <span class='keyword'>if</span> (!success) {</td></tr> +<tr class="codeline" data-linenumber="3278"><td class="num" id="LN3278">3278</td><td class="line"> <span class='macro'>g_signal_handlers_disconnect_by_func (consolekit,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_consolekit), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3279"><td class="num" id="LN3279">3279</td><td class="line"> <span class='macro'>request_shutdown_privileges_completed_consolekit,<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_consolekit), (manager<br>))</span></span></td></tr> +<tr class="codeline" data-linenumber="3280"><td class="num" id="LN3280">3280</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_handlers_disconnect_matched ((consolekit), (GSignalMatchType<br>) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), 0, 0, ((void*)<br>0), (request_shutdown_privileges_completed_consolekit), (manager<br>))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3281"><td class="num" id="LN3281">3281</td><td class="line"> g_object_unref (consolekit);</td></tr> +<tr class="codeline" data-linenumber="3282"><td class="num" id="LN3282">3282</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3283"><td class="num" id="LN3283">3283</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_SHUTDOWN_MDM;</td></tr> +<tr class="codeline" data-linenumber="3284"><td class="num" id="LN3284">3284</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3285"><td class="num" id="LN3285">3285</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3286"><td class="num" id="LN3286">3286</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3287"><td class="num" id="LN3287">3287</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3288"><td class="num" id="LN3288">3288</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3289"><td class="num" id="LN3289">3289</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3290"><td class="num" id="LN3290">3290</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3291"><td class="num" id="LN3291">3291</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3292"><td class="num" id="LN3292">3292</td><td class="line">request_suspend (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3293"><td class="num" id="LN3293">3293</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3294"><td class="num" id="LN3294">3294</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3295"><td class="num" id="LN3295">3295</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3296"><td class="num" id="LN3296">3296</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: requesting suspend"</span>);</td></tr> +<tr class="codeline" data-linenumber="3297"><td class="num" id="LN3297">3297</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3298"><td class="num" id="LN3298">3298</td><td class="line"> <span class='keyword'>if</span> (! gsm_manager_is_suspend_inhibited (manager)) {</td></tr> +<tr class="codeline" data-linenumber="3299"><td class="num" id="LN3299">3299</td><td class="line"> manager_attempt_suspend (manager);</td></tr> +<tr class="codeline" data-linenumber="3300"><td class="num" id="LN3300">3300</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3301"><td class="num" id="LN3301">3301</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3302"><td class="num" id="LN3302">3302</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3303"><td class="num" id="LN3303">3303</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3304"><td class="num" id="LN3304">3304</td><td class="line"> <span class='keyword'>if</span> (priv->inhibit_dialog != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3305"><td class="num" id="LN3305">3305</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: inhibit dialog already up"</span>);</td></tr> +<tr class="codeline" data-linenumber="3306"><td class="num" id="LN3306">3306</td><td class="line"> gtk_window_present (<span class='macro'>GTK_WINDOW (priv->inhibit_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((priv->inhibit_dialog)), ((gtk_window_get_type ())))))<br>)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3307"><td class="num" id="LN3307">3307</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3308"><td class="num" id="LN3308">3308</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3309"><td class="num" id="LN3309">3309</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3310"><td class="num" id="LN3310">3310</td><td class="line"> priv->inhibit_dialog = gsm_inhibit_dialog_new (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="3311"><td class="num" id="LN3311">3311</td><td class="line"> priv->clients,</td></tr> +<tr class="codeline" data-linenumber="3312"><td class="num" id="LN3312">3312</td><td class="line"> GSM_LOGOUT_ACTION_SLEEP);</td></tr> +<tr class="codeline" data-linenumber="3313"><td class="num" id="LN3313">3313</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3314"><td class="num" id="LN3314">3314</td><td class="line"> <span class='macro'>g_signal_connect (priv->inhibit_dialog,<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3315"><td class="num" id="LN3315">3315</td><td class="line"> <span class='string_literal'><span class='macro'>"response"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3316"><td class="num" id="LN3316">3316</td><td class="line"> <span class='macro'>G_CALLBACK (inhibit_dialog_response),<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3317"><td class="num" id="LN3317">3317</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3318"><td class="num" id="LN3318">3318</td><td class="line"> gtk_widget_show (priv->inhibit_dialog);</td></tr> +<tr class="codeline" data-linenumber="3319"><td class="num" id="LN3319">3319</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3320"><td class="num" id="LN3320">3320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3321"><td class="num" id="LN3321">3321</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3322"><td class="num" id="LN3322">3322</td><td class="line">request_hibernate (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3323"><td class="num" id="LN3323">3323</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3324"><td class="num" id="LN3324">3324</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3325"><td class="num" id="LN3325">3325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3326"><td class="num" id="LN3326">3326</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: requesting hibernate"</span>);</td></tr> +<tr class="codeline" data-linenumber="3327"><td class="num" id="LN3327">3327</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3328"><td class="num" id="LN3328">3328</td><td class="line"> <span class='comment'>/* hibernate uses suspend inhibit */</span></td></tr> +<tr class="codeline" data-linenumber="3329"><td class="num" id="LN3329">3329</td><td class="line"> <span class='keyword'>if</span> (! gsm_manager_is_suspend_inhibited (manager)) {</td></tr> +<tr class="codeline" data-linenumber="3330"><td class="num" id="LN3330">3330</td><td class="line"> manager_attempt_hibernate (manager);</td></tr> +<tr class="codeline" data-linenumber="3331"><td class="num" id="LN3331">3331</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3332"><td class="num" id="LN3332">3332</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3333"><td class="num" id="LN3333">3333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3334"><td class="num" id="LN3334">3334</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3335"><td class="num" id="LN3335">3335</td><td class="line"> <span class='keyword'>if</span> (priv->inhibit_dialog != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3336"><td class="num" id="LN3336">3336</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: inhibit dialog already up"</span>);</td></tr> +<tr class="codeline" data-linenumber="3337"><td class="num" id="LN3337">3337</td><td class="line"> gtk_window_present (<span class='macro'>GTK_WINDOW (priv->inhibit_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((priv->inhibit_dialog)), ((gtk_window_get_type ())))))<br>)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3338"><td class="num" id="LN3338">3338</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3339"><td class="num" id="LN3339">3339</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3340"><td class="num" id="LN3340">3340</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3341"><td class="num" id="LN3341">3341</td><td class="line"> priv->inhibit_dialog = gsm_inhibit_dialog_new (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="3342"><td class="num" id="LN3342">3342</td><td class="line"> priv->clients,</td></tr> +<tr class="codeline" data-linenumber="3343"><td class="num" id="LN3343">3343</td><td class="line"> GSM_LOGOUT_ACTION_HIBERNATE);</td></tr> +<tr class="codeline" data-linenumber="3344"><td class="num" id="LN3344">3344</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3345"><td class="num" id="LN3345">3345</td><td class="line"> <span class='macro'>g_signal_connect (priv->inhibit_dialog,<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3346"><td class="num" id="LN3346">3346</td><td class="line"> <span class='string_literal'><span class='macro'>"response"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3347"><td class="num" id="LN3347">3347</td><td class="line"> <span class='macro'>G_CALLBACK (inhibit_dialog_response),<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3348"><td class="num" id="LN3348">3348</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3349"><td class="num" id="LN3349">3349</td><td class="line"> gtk_widget_show (priv->inhibit_dialog);</td></tr> +<tr class="codeline" data-linenumber="3350"><td class="num" id="LN3350">3350</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3351"><td class="num" id="LN3351">3351</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3352"><td class="num" id="LN3352">3352</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3353"><td class="num" id="LN3353">3353</td><td class="line">request_logout (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3354"><td class="num" id="LN3354">3354</td><td class="line"> GsmManagerLogoutMode mode)</td></tr> +<tr class="codeline" data-linenumber="3355"><td class="num" id="LN3355">3355</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3356"><td class="num" id="LN3356">3356</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3357"><td class="num" id="LN3357">3357</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3358"><td class="num" id="LN3358">3358</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: requesting logout"</span>);</td></tr> +<tr class="codeline" data-linenumber="3359"><td class="num" id="LN3359">3359</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3360"><td class="num" id="LN3360">3360</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3361"><td class="num" id="LN3361">3361</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3362"><td class="num" id="LN3362">3362</td><td class="line"> priv->logout_mode = mode;</td></tr> +<tr class="codeline" data-linenumber="3363"><td class="num" id="LN3363">3363</td><td class="line"> priv->logout_type = GSM_MANAGER_LOGOUT_LOGOUT;</td></tr> +<tr class="codeline" data-linenumber="3364"><td class="num" id="LN3364">3364</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3365"><td class="num" id="LN3365">3365</td><td class="line"> end_phase (manager);</td></tr> +<tr class="codeline" data-linenumber="3366"><td class="num" id="LN3366">3366</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3367"><td class="num" id="LN3367">3367</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3368"><td class="num" id="LN3368">3368</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3369"><td class="num" id="LN3369">3369</td><td class="line">request_switch_user (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3370"><td class="num" id="LN3370">3370</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3371"><td class="num" id="LN3371">3371</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3372"><td class="num" id="LN3372">3372</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3373"><td class="num" id="LN3373">3373</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: requesting user switch"</span>);</td></tr> +<tr class="codeline" data-linenumber="3374"><td class="num" id="LN3374">3374</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3375"><td class="num" id="LN3375">3375</td><td class="line"> <span class='comment'>/* See comment in manager_switch_user() to understand why we do this in</span></td></tr> +<tr class="codeline" data-linenumber="3376"><td class="num" id="LN3376">3376</td><td class="line"> <span class='comment'>* both functions. */</span></td></tr> +<tr class="codeline" data-linenumber="3377"><td class="num" id="LN3377">3377</td><td class="line"> <span class='keyword'>if</span> (_switch_user_is_locked_down (manager)) {</td></tr> +<tr class="codeline" data-linenumber="3378"><td class="num" id="LN3378">3378</td><td class="line"> g_warning (<span class='string_literal'>"Unable to switch user: User switching has been locked down"</span>);</td></tr> +<tr class="codeline" data-linenumber="3379"><td class="num" id="LN3379">3379</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3380"><td class="num" id="LN3380">3380</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3381"><td class="num" id="LN3381">3381</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3382"><td class="num" id="LN3382">3382</td><td class="line"> <span class='keyword'>if</span> (! gsm_manager_is_switch_user_inhibited (manager)) {</td></tr> +<tr class="codeline" data-linenumber="3383"><td class="num" id="LN3383">3383</td><td class="line"> manager_switch_user (manager);</td></tr> +<tr class="codeline" data-linenumber="3384"><td class="num" id="LN3384">3384</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3385"><td class="num" id="LN3385">3385</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3386"><td class="num" id="LN3386">3386</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3387"><td class="num" id="LN3387">3387</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3388"><td class="num" id="LN3388">3388</td><td class="line"> <span class='keyword'>if</span> (priv->inhibit_dialog != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3389"><td class="num" id="LN3389">3389</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: inhibit dialog already up"</span>);</td></tr> +<tr class="codeline" data-linenumber="3390"><td class="num" id="LN3390">3390</td><td class="line"> gtk_window_present (<span class='macro'>GTK_WINDOW (priv->inhibit_dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((priv->inhibit_dialog)), ((gtk_window_get_type ())))))<br>)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3391"><td class="num" id="LN3391">3391</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3392"><td class="num" id="LN3392">3392</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3393"><td class="num" id="LN3393">3393</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3394"><td class="num" id="LN3394">3394</td><td class="line"> priv->inhibit_dialog = gsm_inhibit_dialog_new (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="3395"><td class="num" id="LN3395">3395</td><td class="line"> priv->clients,</td></tr> +<tr class="codeline" data-linenumber="3396"><td class="num" id="LN3396">3396</td><td class="line"> GSM_LOGOUT_ACTION_SWITCH_USER);</td></tr> +<tr class="codeline" data-linenumber="3397"><td class="num" id="LN3397">3397</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3398"><td class="num" id="LN3398">3398</td><td class="line"> <span class='macro'>g_signal_connect (priv->inhibit_dialog,<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3399"><td class="num" id="LN3399">3399</td><td class="line"> <span class='string_literal'><span class='macro'>"response"</span>,<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3400"><td class="num" id="LN3400">3400</td><td class="line"> <span class='macro'>G_CALLBACK (inhibit_dialog_response),<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3401"><td class="num" id="LN3401">3401</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((priv->inhibit_dialog), ("response"<br>), (((GCallback) (inhibit_dialog_response))), (manager), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3402"><td class="num" id="LN3402">3402</td><td class="line"> gtk_widget_show (priv->inhibit_dialog);</td></tr> +<tr class="codeline" data-linenumber="3403"><td class="num" id="LN3403">3403</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3404"><td class="num" id="LN3404">3404</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3405"><td class="num" id="LN3405">3405</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3406"><td class="num" id="LN3406">3406</td><td class="line">logout_dialog_response (GsmLogoutDialog *logout_dialog,</td></tr> +<tr class="codeline" data-linenumber="3407"><td class="num" id="LN3407">3407</td><td class="line"> guint response_id,</td></tr> +<tr class="codeline" data-linenumber="3408"><td class="num" id="LN3408">3408</td><td class="line"> GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3409"><td class="num" id="LN3409">3409</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3410"><td class="num" id="LN3410">3410</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3411"><td class="num" id="LN3411">3411</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3412"><td class="num" id="LN3412">3412</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3413"><td class="num" id="LN3413">3413</td><td class="line"> <span class='comment'>/* We should only be here if mode has already have been set from</span></td></tr> +<tr class="codeline" data-linenumber="3414"><td class="num" id="LN3414">3414</td><td class="line"> <span class='comment'>* show_fallback_shutdown/logout_dialog</span></td></tr> +<tr class="codeline" data-linenumber="3415"><td class="num" id="LN3415">3415</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="3416"><td class="num" id="LN3416">3416</td><td class="line"> <span class='macro'>g_assert (priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_NORMAL)<span class='macro_popup'>do { if (priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_NORMAL<br>) ; else g_assertion_message_expr (((gchar*) 0), "gsm-manager.c"<br>, 3416, ((const char*) (__func__)), "priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_NORMAL"<br>); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3417"><td class="num" id="LN3417">3417</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3418"><td class="num" id="LN3418">3418</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Logout dialog response: %d"</span>, response_id);</td></tr> +<tr class="codeline" data-linenumber="3419"><td class="num" id="LN3419">3419</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3420"><td class="num" id="LN3420">3420</td><td class="line"> gtk_widget_destroy (<span class='macro'>GTK_WIDGET (logout_dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((logout_dialog)), ((gtk_widget_get_type ()))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3421"><td class="num" id="LN3421">3421</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3422"><td class="num" id="LN3422">3422</td><td class="line"> <span class='comment'>/* In case of dialog cancel, switch user, hibernate and</span></td></tr> +<tr class="codeline" data-linenumber="3423"><td class="num" id="LN3423">3423</td><td class="line"> <span class='comment'>* suspend, we just perform the respective action and return,</span></td></tr> +<tr class="codeline" data-linenumber="3424"><td class="num" id="LN3424">3424</td><td class="line"> <span class='comment'>* without shutting down the session. */</span></td></tr> +<tr class="codeline" data-linenumber="3425"><td class="num" id="LN3425">3425</td><td class="line"> <span class='keyword'>switch</span> (response_id) {</td></tr> +<tr class="codeline" data-linenumber="3426"><td class="num" id="LN3426">3426</td><td class="line"> <span class='keyword'>case</span> GTK_RESPONSE_CANCEL:</td></tr> +<tr class="codeline" data-linenumber="3427"><td class="num" id="LN3427">3427</td><td class="line"> <span class='keyword'>case</span> GTK_RESPONSE_NONE:</td></tr> +<tr class="codeline" data-linenumber="3428"><td class="num" id="LN3428">3428</td><td class="line"> <span class='keyword'>case</span> GTK_RESPONSE_DELETE_EVENT:</td></tr> +<tr class="codeline" data-linenumber="3429"><td class="num" id="LN3429">3429</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3430"><td class="num" id="LN3430">3430</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_RESPONSE_SWITCH_USER:</td></tr> +<tr class="codeline" data-linenumber="3431"><td class="num" id="LN3431">3431</td><td class="line"> request_switch_user (manager);</td></tr> +<tr class="codeline" data-linenumber="3432"><td class="num" id="LN3432">3432</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3433"><td class="num" id="LN3433">3433</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_RESPONSE_HIBERNATE:</td></tr> +<tr class="codeline" data-linenumber="3434"><td class="num" id="LN3434">3434</td><td class="line"> request_hibernate (manager);</td></tr> +<tr class="codeline" data-linenumber="3435"><td class="num" id="LN3435">3435</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3436"><td class="num" id="LN3436">3436</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_RESPONSE_SLEEP:</td></tr> +<tr class="codeline" data-linenumber="3437"><td class="num" id="LN3437">3437</td><td class="line"> request_suspend (manager);</td></tr> +<tr class="codeline" data-linenumber="3438"><td class="num" id="LN3438">3438</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3439"><td class="num" id="LN3439">3439</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_RESPONSE_SHUTDOWN:</td></tr> +<tr class="codeline" data-linenumber="3440"><td class="num" id="LN3440">3440</td><td class="line"> request_shutdown (manager);</td></tr> +<tr class="codeline" data-linenumber="3441"><td class="num" id="LN3441">3441</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3442"><td class="num" id="LN3442">3442</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_RESPONSE_REBOOT:</td></tr> +<tr class="codeline" data-linenumber="3443"><td class="num" id="LN3443">3443</td><td class="line"> request_reboot (manager);</td></tr> +<tr class="codeline" data-linenumber="3444"><td class="num" id="LN3444">3444</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3445"><td class="num" id="LN3445">3445</td><td class="line"> <span class='keyword'>case</span> GSM_LOGOUT_RESPONSE_LOGOUT:</td></tr> +<tr class="codeline" data-linenumber="3446"><td class="num" id="LN3446">3446</td><td class="line"> <span class='comment'>/* We've already gotten confirmation from the user so</span></td></tr> +<tr class="codeline" data-linenumber="3447"><td class="num" id="LN3447">3447</td><td class="line"> <span class='comment'>* initiate the logout in NO_CONFIRMATION mode.</span></td></tr> +<tr class="codeline" data-linenumber="3448"><td class="num" id="LN3448">3448</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="3449"><td class="num" id="LN3449">3449</td><td class="line"> <span class='comment'>* (it shouldn't matter whether we use NO_CONFIRMATION or stay</span></td></tr> +<tr class="codeline" data-linenumber="3450"><td class="num" id="LN3450">3450</td><td class="line"> <span class='comment'>* with NORMAL, unless the shell happens to start after the</span></td></tr> +<tr class="codeline" data-linenumber="3451"><td class="num" id="LN3451">3451</td><td class="line"> <span class='comment'>* user confirmed)</span></td></tr> +<tr class="codeline" data-linenumber="3452"><td class="num" id="LN3452">3452</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="3453"><td class="num" id="LN3453">3453</td><td class="line"> request_logout (manager, GSM_MANAGER_LOGOUT_MODE_NO_CONFIRMATION);</td></tr> +<tr class="codeline" data-linenumber="3454"><td class="num" id="LN3454">3454</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3455"><td class="num" id="LN3455">3455</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="3456"><td class="num" id="LN3456">3456</td><td class="line"> <span class='macro'>g_assert_not_reached ()<span class='macro_popup'>do { g_assertion_message_expr (((gchar*) 0), "gsm-manager.c",<br> 3456, ((const char*) (__func__)), ((void*)0)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3457"><td class="num" id="LN3457">3457</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3458"><td class="num" id="LN3458">3458</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3459"><td class="num" id="LN3459">3459</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3460"><td class="num" id="LN3460">3460</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3461"><td class="num" id="LN3461">3461</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3462"><td class="num" id="LN3462">3462</td><td class="line">show_shutdown_dialog (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3463"><td class="num" id="LN3463">3463</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3464"><td class="num" id="LN3464">3464</td><td class="line"> GtkWidget *dialog;</td></tr> +<tr class="codeline" data-linenumber="3465"><td class="num" id="LN3465">3465</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3466"><td class="num" id="LN3466">3466</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3467"><td class="num" id="LN3467">3467</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3468"><td class="num" id="LN3468">3468</td><td class="line"> <span class='keyword'>if</span> (priv->phase >= GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="3469"><td class="num" id="LN3469">3469</td><td class="line"> <span class='comment'>/* Already shutting down, nothing more to do */</span></td></tr> +<tr class="codeline" data-linenumber="3470"><td class="num" id="LN3470">3470</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3471"><td class="num" id="LN3471">3471</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3472"><td class="num" id="LN3472">3472</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3473"><td class="num" id="LN3473">3473</td><td class="line"> priv->logout_mode = GSM_MANAGER_LOGOUT_MODE_NORMAL;</td></tr> +<tr class="codeline" data-linenumber="3474"><td class="num" id="LN3474">3474</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3475"><td class="num" id="LN3475">3475</td><td class="line"> dialog = gsm_get_shutdown_dialog (gdk_screen_get_default (),</td></tr> +<tr class="codeline" data-linenumber="3476"><td class="num" id="LN3476">3476</td><td class="line"> gtk_get_current_event_time ());</td></tr> +<tr class="codeline" data-linenumber="3477"><td class="num" id="LN3477">3477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3478"><td class="num" id="LN3478">3478</td><td class="line"> <span class='macro'>g_signal_connect (dialog,<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>logout_dialog_response))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3479"><td class="num" id="LN3479">3479</td><td class="line"> <span class='string_literal'><span class='macro'>"response"</span>,<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>logout_dialog_response))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3480"><td class="num" id="LN3480">3480</td><td class="line"> <span class='macro'>G_CALLBACK (logout_dialog_response),<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>logout_dialog_response))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3481"><td class="num" id="LN3481">3481</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>logout_dialog_response))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3482"><td class="num" id="LN3482">3482</td><td class="line"> gtk_widget_show (dialog);</td></tr> +<tr class="codeline" data-linenumber="3483"><td class="num" id="LN3483">3483</td><td class="line"> gtk_window_present_with_time (<span class='macro'>GTK_WINDOW (dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3484"><td class="num" id="LN3484">3484</td><td class="line"> gdk_x11_get_server_time (gtk_widget_get_window (<span class='macro'>GTK_WIDGET (dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_widget_get_type ()))))))</span></span>)));</td></tr> +<tr class="codeline" data-linenumber="3485"><td class="num" id="LN3485">3485</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3486"><td class="num" id="LN3486">3486</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3487"><td class="num" id="LN3487">3487</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3488"><td class="num" id="LN3488">3488</td><td class="line">show_logout_dialog (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3489"><td class="num" id="LN3489">3489</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3490"><td class="num" id="LN3490">3490</td><td class="line"> GtkWidget *dialog;</td></tr> +<tr class="codeline" data-linenumber="3491"><td class="num" id="LN3491">3491</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3492"><td class="num" id="LN3492">3492</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3493"><td class="num" id="LN3493">3493</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3494"><td class="num" id="LN3494">3494</td><td class="line"> <span class='keyword'>if</span> (priv->phase >= GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="3495"><td class="num" id="LN3495">3495</td><td class="line"> <span class='comment'>/* Already shutting down, nothing more to do */</span></td></tr> +<tr class="codeline" data-linenumber="3496"><td class="num" id="LN3496">3496</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3497"><td class="num" id="LN3497">3497</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3498"><td class="num" id="LN3498">3498</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3499"><td class="num" id="LN3499">3499</td><td class="line"> priv->logout_mode = GSM_MANAGER_LOGOUT_MODE_NORMAL;</td></tr> +<tr class="codeline" data-linenumber="3500"><td class="num" id="LN3500">3500</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3501"><td class="num" id="LN3501">3501</td><td class="line"> dialog = gsm_get_logout_dialog (gdk_screen_get_default (),</td></tr> +<tr class="codeline" data-linenumber="3502"><td class="num" id="LN3502">3502</td><td class="line"> gtk_get_current_event_time ());</td></tr> +<tr class="codeline" data-linenumber="3503"><td class="num" id="LN3503">3503</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3504"><td class="num" id="LN3504">3504</td><td class="line"> <span class='macro'>g_signal_connect (dialog,<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>logout_dialog_response))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3505"><td class="num" id="LN3505">3505</td><td class="line"> <span class='string_literal'><span class='macro'>"response"</span>,<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>logout_dialog_response))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3506"><td class="num" id="LN3506">3506</td><td class="line"> <span class='macro'>G_CALLBACK (logout_dialog_response),<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>logout_dialog_response))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="3507"><td class="num" id="LN3507">3507</td><td class="line"> <span class='macro'>manager)<span class='macro_popup'>g_signal_connect_data ((dialog), ("response"), (((GCallback) (<br>logout_dialog_response))), (manager), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3508"><td class="num" id="LN3508">3508</td><td class="line"> gtk_widget_show (dialog);</td></tr> +<tr class="codeline" data-linenumber="3509"><td class="num" id="LN3509">3509</td><td class="line"> gtk_window_present_with_time (<span class='macro'>GTK_WINDOW (dialog)<span class='macro_popup'>((((GtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_window_get_type ()))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3510"><td class="num" id="LN3510">3510</td><td class="line"> gdk_x11_get_server_time (gtk_widget_get_window (<span class='macro'>GTK_WIDGET (dialog)<span class='macro_popup'>((((GtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((dialog)), ((gtk_widget_get_type ()))))))</span></span>)));</td></tr> +<tr class="codeline" data-linenumber="3511"><td class="num" id="LN3511">3511</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3512"><td class="num" id="LN3512">3512</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3513"><td class="num" id="LN3513">3513</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="3514"><td class="num" id="LN3514">3514</td><td class="line">user_logout (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3515"><td class="num" id="LN3515">3515</td><td class="line"> GsmManagerLogoutMode mode)</td></tr> +<tr class="codeline" data-linenumber="3516"><td class="num" id="LN3516">3516</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3517"><td class="num" id="LN3517">3517</td><td class="line"> gboolean logout_prompt;</td></tr> +<tr class="codeline" data-linenumber="3518"><td class="num" id="LN3518">3518</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3519"><td class="num" id="LN3519">3519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3520"><td class="num" id="LN3520">3520</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3521"><td class="num" id="LN3521">3521</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3522"><td class="num" id="LN3522">3522</td><td class="line"> <span class='keyword'>if</span> (priv->phase >= GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="3523"><td class="num" id="LN3523">3523</td><td class="line"> <span class='comment'>/* Already shutting down, nothing more to do */</span></td></tr> +<tr class="codeline" data-linenumber="3524"><td class="num" id="LN3524">3524</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="3525"><td class="num" id="LN3525">3525</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3526"><td class="num" id="LN3526">3526</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3527"><td class="num" id="LN3527">3527</td><td class="line"> logout_prompt =</td></tr> +<tr class="codeline" data-linenumber="3528"><td class="num" id="LN3528">3528</td><td class="line"> g_settings_get_boolean (priv->settings_session,</td></tr> +<tr class="codeline" data-linenumber="3529"><td class="num" id="LN3529">3529</td><td class="line"> <span class='string_literal'>"logout-prompt"</span>);</td></tr> +<tr class="codeline" data-linenumber="3530"><td class="num" id="LN3530">3530</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3531"><td class="num" id="LN3531">3531</td><td class="line"> <span class='comment'>/* If the shell isn't running, and this isn't a non-interative logout request,</span></td></tr> +<tr class="codeline" data-linenumber="3532"><td class="num" id="LN3532">3532</td><td class="line"> <span class='comment'>* and the user has their settings configured to show a confirmation dialog for</span></td></tr> +<tr class="codeline" data-linenumber="3533"><td class="num" id="LN3533">3533</td><td class="line"> <span class='comment'>* logout, then go ahead and show the confirmation dialog now.</span></td></tr> +<tr class="codeline" data-linenumber="3534"><td class="num" id="LN3534">3534</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="3535"><td class="num" id="LN3535">3535</td><td class="line"> <span class='keyword'>if</span> (mode == GSM_MANAGER_LOGOUT_MODE_NORMAL && logout_prompt) {</td></tr> +<tr class="codeline" data-linenumber="3536"><td class="num" id="LN3536">3536</td><td class="line"> show_logout_dialog (manager);</td></tr> +<tr class="codeline" data-linenumber="3537"><td class="num" id="LN3537">3537</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3538"><td class="num" id="LN3538">3538</td><td class="line"> request_logout (manager, mode);</td></tr> +<tr class="codeline" data-linenumber="3539"><td class="num" id="LN3539">3539</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3540"><td class="num" id="LN3540">3540</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3541"><td class="num" id="LN3541">3541</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3542"><td class="num" id="LN3542">3542</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="3543"><td class="num" id="LN3543">3543</td><td class="line"> <span class='comment'>dbus-send --session --type=method_call --print-reply</span></td></tr> +<tr class="codeline" data-linenumber="3544"><td class="num" id="LN3544">3544</td><td class="line"> <span class='comment'>--dest=org.gnome.SessionManager</span></td></tr> +<tr class="codeline" data-linenumber="3545"><td class="num" id="LN3545">3545</td><td class="line"> <span class='comment'>/org/gnome/SessionManager</span></td></tr> +<tr class="codeline" data-linenumber="3546"><td class="num" id="LN3546">3546</td><td class="line"> <span class='comment'>org.freedesktop.DBus.Introspectable.Introspect</span></td></tr> +<tr class="codeline" data-linenumber="3547"><td class="num" id="LN3547">3547</td><td class="line"><span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="3548"><td class="num" id="LN3548">3548</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3549"><td class="num" id="LN3549">3549</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3550"><td class="num" id="LN3550">3550</td><td class="line">gsm_manager_set_phase (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3551"><td class="num" id="LN3551">3551</td><td class="line"> GsmManagerPhase phase)</td></tr> +<tr class="codeline" data-linenumber="3552"><td class="num" id="LN3552">3552</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3553"><td class="num" id="LN3553">3553</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3554"><td class="num" id="LN3554">3554</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3555"><td class="num" id="LN3555">3555</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3556"><td class="num" id="LN3556">3556</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3557"><td class="num" id="LN3557">3557</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3558"><td class="num" id="LN3558">3558</td><td class="line"> priv->phase = phase;</td></tr> +<tr class="codeline" data-linenumber="3559"><td class="num" id="LN3559">3559</td><td class="line"> <span class='keyword'>return</span> (<span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3560"><td class="num" id="LN3560">3560</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3561"><td class="num" id="LN3561">3561</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3562"><td class="num" id="LN3562">3562</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3563"><td class="num" id="LN3563">3563</td><td class="line">gsm_manager_request_shutdown (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3564"><td class="num" id="LN3564">3564</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="3565"><td class="num" id="LN3565">3565</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3566"><td class="num" id="LN3566">3566</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3567"><td class="num" id="LN3567">3567</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: RequestShutdown called"</span>);</td></tr> +<tr class="codeline" data-linenumber="3568"><td class="num" id="LN3568">3568</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3569"><td class="num" id="LN3569">3569</td><td class="line"> <span class='macro'>g_return_val_if_fail(GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3570"><td class="num" id="LN3570">3570</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3571"><td class="num" id="LN3571">3571</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3572"><td class="num" id="LN3572">3572</td><td class="line"> <span class='keyword'>if</span> (priv->phase != GSM_MANAGER_PHASE_RUNNING) {</td></tr> +<tr class="codeline" data-linenumber="3573"><td class="num" id="LN3573">3573</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="3574"><td class="num" id="LN3574">3574</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3575"><td class="num" id="LN3575">3575</td><td class="line"> GSM_MANAGER_ERROR_NOT_IN_RUNNING,</td></tr> +<tr class="codeline" data-linenumber="3576"><td class="num" id="LN3576">3576</td><td class="line"> <span class='string_literal'>"RequestShutdown interface is only available during the Running phase"</span>);</td></tr> +<tr class="codeline" data-linenumber="3577"><td class="num" id="LN3577">3577</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3578"><td class="num" id="LN3578">3578</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3579"><td class="num" id="LN3579">3579</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3580"><td class="num" id="LN3580">3580</td><td class="line"> request_shutdown (manager);</td></tr> +<tr class="codeline" data-linenumber="3581"><td class="num" id="LN3581">3581</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3582"><td class="num" id="LN3582">3582</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3583"><td class="num" id="LN3583">3583</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3584"><td class="num" id="LN3584">3584</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3585"><td class="num" id="LN3585">3585</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3586"><td class="num" id="LN3586">3586</td><td class="line">gsm_manager_request_reboot (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3587"><td class="num" id="LN3587">3587</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="3588"><td class="num" id="LN3588">3588</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3589"><td class="num" id="LN3589">3589</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3590"><td class="num" id="LN3590">3590</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3591"><td class="num" id="LN3591">3591</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: RequestReboot called"</span>);</td></tr> +<tr class="codeline" data-linenumber="3592"><td class="num" id="LN3592">3592</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3593"><td class="num" id="LN3593">3593</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3594"><td class="num" id="LN3594">3594</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3595"><td class="num" id="LN3595">3595</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3596"><td class="num" id="LN3596">3596</td><td class="line"> <span class='keyword'>if</span> (priv->phase != GSM_MANAGER_PHASE_RUNNING) {</td></tr> +<tr class="codeline" data-linenumber="3597"><td class="num" id="LN3597">3597</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="3598"><td class="num" id="LN3598">3598</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3599"><td class="num" id="LN3599">3599</td><td class="line"> GSM_MANAGER_ERROR_NOT_IN_RUNNING,</td></tr> +<tr class="codeline" data-linenumber="3600"><td class="num" id="LN3600">3600</td><td class="line"> <span class='string_literal'>"RequestReboot interface is only available during the running phase"</span>);</td></tr> +<tr class="codeline" data-linenumber="3601"><td class="num" id="LN3601">3601</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3602"><td class="num" id="LN3602">3602</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3603"><td class="num" id="LN3603">3603</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3604"><td class="num" id="LN3604">3604</td><td class="line"> request_reboot (manager);</td></tr> +<tr class="codeline" data-linenumber="3605"><td class="num" id="LN3605">3605</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3606"><td class="num" id="LN3606">3606</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3607"><td class="num" id="LN3607">3607</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3608"><td class="num" id="LN3608">3608</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3609"><td class="num" id="LN3609">3609</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="3610"><td class="num" id="LN3610">3610</td><td class="line">_log_out_is_locked_down (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3611"><td class="num" id="LN3611">3611</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3612"><td class="num" id="LN3612">3612</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3613"><td class="num" id="LN3613">3613</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3614"><td class="num" id="LN3614">3614</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3615"><td class="num" id="LN3615">3615</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3616"><td class="num" id="LN3616">3616</td><td class="line"> <span class='keyword'>return</span> g_settings_get_boolean (priv->settings_lockdown,</td></tr> +<tr class="codeline" data-linenumber="3617"><td class="num" id="LN3617">3617</td><td class="line"> <span class='macro'>KEY_LOG_OUT_DISABLE<span class='macro_popup'>"disable-log-out"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3618"><td class="num" id="LN3618">3618</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3619"><td class="num" id="LN3619">3619</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3620"><td class="num" id="LN3620">3620</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="3621"><td class="num" id="LN3621">3621</td><td class="line">_switch_user_is_locked_down (GsmManager *manager)</td></tr> +<tr class="codeline" data-linenumber="3622"><td class="num" id="LN3622">3622</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3623"><td class="num" id="LN3623">3623</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3624"><td class="num" id="LN3624">3624</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3625"><td class="num" id="LN3625">3625</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3626"><td class="num" id="LN3626">3626</td><td class="line"> <span class='keyword'>return</span> g_settings_get_boolean (priv->settings_lockdown,</td></tr> +<tr class="codeline" data-linenumber="3627"><td class="num" id="LN3627">3627</td><td class="line"> <span class='macro'>KEY_USER_SWITCH_DISABLE<span class='macro_popup'>"disable-user-switching"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3628"><td class="num" id="LN3628">3628</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3629"><td class="num" id="LN3629">3629</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3630"><td class="num" id="LN3630">3630</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3631"><td class="num" id="LN3631">3631</td><td class="line">gsm_manager_shutdown (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3632"><td class="num" id="LN3632">3632</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="3633"><td class="num" id="LN3633">3633</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3634"><td class="num" id="LN3634">3634</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3635"><td class="num" id="LN3635">3635</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Shutdown called"</span>);</td></tr> +<tr class="codeline" data-linenumber="3636"><td class="num" id="LN3636">3636</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3637"><td class="num" id="LN3637">3637</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3638"><td class="num" id="LN3638">3638</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3639"><td class="num" id="LN3639">3639</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3640"><td class="num" id="LN3640">3640</td><td class="line"> <span class='keyword'>if</span> (priv->phase != GSM_MANAGER_PHASE_RUNNING) {</td></tr> +<tr class="codeline" data-linenumber="3641"><td class="num" id="LN3641">3641</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="3642"><td class="num" id="LN3642">3642</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3643"><td class="num" id="LN3643">3643</td><td class="line"> GSM_MANAGER_ERROR_NOT_IN_RUNNING,</td></tr> +<tr class="codeline" data-linenumber="3644"><td class="num" id="LN3644">3644</td><td class="line"> <span class='string_literal'>"Shutdown interface is only available during the Running phase"</span>);</td></tr> +<tr class="codeline" data-linenumber="3645"><td class="num" id="LN3645">3645</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3646"><td class="num" id="LN3646">3646</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3647"><td class="num" id="LN3647">3647</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3648"><td class="num" id="LN3648">3648</td><td class="line"> <span class='keyword'>if</span> (_log_out_is_locked_down (manager)) {</td></tr> +<tr class="codeline" data-linenumber="3649"><td class="num" id="LN3649">3649</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="3650"><td class="num" id="LN3650">3650</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3651"><td class="num" id="LN3651">3651</td><td class="line"> GSM_MANAGER_ERROR_LOCKED_DOWN,</td></tr> +<tr class="codeline" data-linenumber="3652"><td class="num" id="LN3652">3652</td><td class="line"> <span class='string_literal'>"Logout has been locked down"</span>);</td></tr> +<tr class="codeline" data-linenumber="3653"><td class="num" id="LN3653">3653</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3654"><td class="num" id="LN3654">3654</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3655"><td class="num" id="LN3655">3655</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3656"><td class="num" id="LN3656">3656</td><td class="line"> show_shutdown_dialog (manager);</td></tr> +<tr class="codeline" data-linenumber="3657"><td class="num" id="LN3657">3657</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3658"><td class="num" id="LN3658">3658</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3659"><td class="num" id="LN3659">3659</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3660"><td class="num" id="LN3660">3660</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3661"><td class="num" id="LN3661">3661</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3662"><td class="num" id="LN3662">3662</td><td class="line">gsm_manager_can_shutdown (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3663"><td class="num" id="LN3663">3663</td><td class="line"> gboolean *shutdown_available,</td></tr> +<tr class="codeline" data-linenumber="3664"><td class="num" id="LN3664">3664</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="3665"><td class="num" id="LN3665">3665</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3666"><td class="num" id="LN3666">3666</td><td class="line"> GsmConsolekit *consolekit;</td></tr> +<tr class="codeline" data-linenumber="3667"><td class="num" id="LN3667">3667</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3668"><td class="num" id="LN3668">3668</td><td class="line"> GsmSystemd *systemd;</td></tr> +<tr class="codeline" data-linenumber="3669"><td class="num" id="LN3669">3669</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3670"><td class="num" id="LN3670">3670</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: CanShutdown called"</span>);</td></tr> +<tr class="codeline" data-linenumber="3671"><td class="num" id="LN3671">3671</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3672"><td class="num" id="LN3672">3672</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3673"><td class="num" id="LN3673">3673</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3674"><td class="num" id="LN3674">3674</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3675"><td class="num" id="LN3675">3675</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>LOGIND_RUNNING()<span class='macro_popup'>(access("/run/systemd/seats/", 0) >= 0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3676"><td class="num" id="LN3676">3676</td><td class="line"> systemd = gsm_get_systemd ();</td></tr> +<tr class="codeline" data-linenumber="3677"><td class="num" id="LN3677">3677</td><td class="line"> *shutdown_available = gsm_systemd_can_stop (systemd)</td></tr> +<tr class="codeline" data-linenumber="3678"><td class="num" id="LN3678">3678</td><td class="line"> || gsm_systemd_can_restart (systemd)</td></tr> +<tr class="codeline" data-linenumber="3679"><td class="num" id="LN3679">3679</td><td class="line"> || gsm_systemd_can_suspend (systemd)</td></tr> +<tr class="codeline" data-linenumber="3680"><td class="num" id="LN3680">3680</td><td class="line"> || gsm_systemd_can_hibernate (systemd);</td></tr> +<tr class="codeline" data-linenumber="3681"><td class="num" id="LN3681">3681</td><td class="line"> g_object_unref (systemd);</td></tr> +<tr class="codeline" data-linenumber="3682"><td class="num" id="LN3682">3682</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3683"><td class="num" id="LN3683">3683</td><td class="line"> <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3684"><td class="num" id="LN3684">3684</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3685"><td class="num" id="LN3685">3685</td><td class="line"> consolekit = gsm_get_consolekit ();</td></tr> +<tr class="codeline" data-linenumber="3686"><td class="num" id="LN3686">3686</td><td class="line"> *shutdown_available = !_log_out_is_locked_down (manager) &&</td></tr> +<tr class="codeline" data-linenumber="3687"><td class="num" id="LN3687">3687</td><td class="line"> (gsm_consolekit_can_stop (consolekit)</td></tr> +<tr class="codeline" data-linenumber="3688"><td class="num" id="LN3688">3688</td><td class="line"> || gsm_consolekit_can_restart (consolekit)</td></tr> +<tr class="codeline" data-linenumber="3689"><td class="num" id="LN3689">3689</td><td class="line"> || gsm_consolekit_can_suspend (consolekit)</td></tr> +<tr class="codeline" data-linenumber="3690"><td class="num" id="LN3690">3690</td><td class="line"> || gsm_consolekit_can_hibernate (consolekit));</td></tr> +<tr class="codeline" data-linenumber="3691"><td class="num" id="LN3691">3691</td><td class="line"> g_object_unref (consolekit);</td></tr> +<tr class="codeline" data-linenumber="3692"><td class="num" id="LN3692">3692</td><td class="line"><span class='directive'>#ifdef <span class='macro'>HAVE_SYSTEMD<span class='macro_popup'>1</span></span></span></td></tr> +<tr class="codeline" data-linenumber="3693"><td class="num" id="LN3693">3693</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3694"><td class="num" id="LN3694">3694</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="3695"><td class="num" id="LN3695">3695</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3696"><td class="num" id="LN3696">3696</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3697"><td class="num" id="LN3697">3697</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3698"><td class="num" id="LN3698">3698</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3699"><td class="num" id="LN3699">3699</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3700"><td class="num" id="LN3700">3700</td><td class="line">gsm_manager_logout (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3701"><td class="num" id="LN3701">3701</td><td class="line"> guint logout_mode,</td></tr> +<tr class="codeline" data-linenumber="3702"><td class="num" id="LN3702">3702</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="3703"><td class="num" id="LN3703">3703</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3704"><td class="num" id="LN3704">3704</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3705"><td class="num" id="LN3705">3705</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Logout called"</span>);</td></tr> +<tr class="codeline" data-linenumber="3706"><td class="num" id="LN3706">3706</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3707"><td class="num" id="LN3707">3707</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3708"><td class="num" id="LN3708">3708</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3709"><td class="num" id="LN3709">3709</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3710"><td class="num" id="LN3710">3710</td><td class="line"> <span class='keyword'>if</span> (priv->phase != GSM_MANAGER_PHASE_RUNNING) {</td></tr> +<tr class="codeline" data-linenumber="3711"><td class="num" id="LN3711">3711</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="3712"><td class="num" id="LN3712">3712</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3713"><td class="num" id="LN3713">3713</td><td class="line"> GSM_MANAGER_ERROR_NOT_IN_RUNNING,</td></tr> +<tr class="codeline" data-linenumber="3714"><td class="num" id="LN3714">3714</td><td class="line"> <span class='string_literal'>"Shutdown interface is only available during the Running phase"</span>);</td></tr> +<tr class="codeline" data-linenumber="3715"><td class="num" id="LN3715">3715</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3716"><td class="num" id="LN3716">3716</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3717"><td class="num" id="LN3717">3717</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3718"><td class="num" id="LN3718">3718</td><td class="line"> <span class='keyword'>if</span> (_log_out_is_locked_down (manager)) {</td></tr> +<tr class="codeline" data-linenumber="3719"><td class="num" id="LN3719">3719</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="3720"><td class="num" id="LN3720">3720</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3721"><td class="num" id="LN3721">3721</td><td class="line"> GSM_MANAGER_ERROR_LOCKED_DOWN,</td></tr> +<tr class="codeline" data-linenumber="3722"><td class="num" id="LN3722">3722</td><td class="line"> <span class='string_literal'>"Logout has been locked down"</span>);</td></tr> +<tr class="codeline" data-linenumber="3723"><td class="num" id="LN3723">3723</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3724"><td class="num" id="LN3724">3724</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3725"><td class="num" id="LN3725">3725</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3726"><td class="num" id="LN3726">3726</td><td class="line"> <span class='keyword'>switch</span> (logout_mode) {</td></tr> +<tr class="codeline" data-linenumber="3727"><td class="num" id="LN3727">3727</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_MODE_NORMAL:</td></tr> +<tr class="codeline" data-linenumber="3728"><td class="num" id="LN3728">3728</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_MODE_NO_CONFIRMATION:</td></tr> +<tr class="codeline" data-linenumber="3729"><td class="num" id="LN3729">3729</td><td class="line"> <span class='keyword'>case</span> GSM_MANAGER_LOGOUT_MODE_FORCE:</td></tr> +<tr class="codeline" data-linenumber="3730"><td class="num" id="LN3730">3730</td><td class="line"> user_logout (manager, logout_mode);</td></tr> +<tr class="codeline" data-linenumber="3731"><td class="num" id="LN3731">3731</td><td class="line"> <span class='keyword'>break</span>;</td></tr> +<tr class="codeline" data-linenumber="3732"><td class="num" id="LN3732">3732</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3733"><td class="num" id="LN3733">3733</td><td class="line"> <span class='keyword'>default</span>:</td></tr> +<tr class="codeline" data-linenumber="3734"><td class="num" id="LN3734">3734</td><td class="line"> g_debug (<span class='string_literal'>"Unknown logout mode option"</span>);</td></tr> +<tr class="codeline" data-linenumber="3735"><td class="num" id="LN3735">3735</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3736"><td class="num" id="LN3736">3736</td><td class="line"> g_set_error (error,</td></tr> +<tr class="codeline" data-linenumber="3737"><td class="num" id="LN3737">3737</td><td class="line"> <span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3738"><td class="num" id="LN3738">3738</td><td class="line"> GSM_MANAGER_ERROR_INVALID_OPTION,</td></tr> +<tr class="codeline" data-linenumber="3739"><td class="num" id="LN3739">3739</td><td class="line"> <span class='string_literal'>"Unknown logout mode flag"</span>);</td></tr> +<tr class="codeline" data-linenumber="3740"><td class="num" id="LN3740">3740</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3741"><td class="num" id="LN3741">3741</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3742"><td class="num" id="LN3742">3742</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3743"><td class="num" id="LN3743">3743</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3744"><td class="num" id="LN3744">3744</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3745"><td class="num" id="LN3745">3745</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3746"><td class="num" id="LN3746">3746</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3747"><td class="num" id="LN3747">3747</td><td class="line">gsm_manager_register_client (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3748"><td class="num" id="LN3748">3748</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *app_id,</td></tr> +<tr class="codeline" data-linenumber="3749"><td class="num" id="LN3749">3749</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *startup_id,</td></tr> +<tr class="codeline" data-linenumber="3750"><td class="num" id="LN3750">3750</td><td class="line"> DBusGMethodInvocation *context)</td></tr> +<tr class="codeline" data-linenumber="3751"><td class="num" id="LN3751">3751</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3752"><td class="num" id="LN3752">3752</td><td class="line"> <span class='keyword'>char</span> *new_startup_id;</td></tr> +<tr class="codeline" data-linenumber="3753"><td class="num" id="LN3753">3753</td><td class="line"> <span class='keyword'>char</span> *sender;</td></tr> +<tr class="codeline" data-linenumber="3754"><td class="num" id="LN3754">3754</td><td class="line"> GsmClient *client;</td></tr> +<tr class="codeline" data-linenumber="3755"><td class="num" id="LN3755">3755</td><td class="line"> GsmApp *app;</td></tr> +<tr class="codeline" data-linenumber="3756"><td class="num" id="LN3756">3756</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3757"><td class="num" id="LN3757">3757</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3758"><td class="num" id="LN3758">3758</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3759"><td class="num" id="LN3759">3759</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3760"><td class="num" id="LN3760">3760</td><td class="line"> app = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3761"><td class="num" id="LN3761">3761</td><td class="line"> client = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3762"><td class="num" id="LN3762">3762</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3763"><td class="num" id="LN3763">3763</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: RegisterClient %s"</span>, startup_id);</td></tr> +<tr class="codeline" data-linenumber="3764"><td class="num" id="LN3764">3764</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3765"><td class="num" id="LN3765">3765</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3766"><td class="num" id="LN3766">3766</td><td class="line"> <span class='keyword'>if</span> (priv->phase >= GSM_MANAGER_PHASE_QUERY_END_SESSION) {</td></tr> +<tr class="codeline" data-linenumber="3767"><td class="num" id="LN3767">3767</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3768"><td class="num" id="LN3768">3768</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3769"><td class="num" id="LN3769">3769</td><td class="line"> g_debug (<span class='string_literal'>"Unable to register client: shutting down"</span>);</td></tr> +<tr class="codeline" data-linenumber="3770"><td class="num" id="LN3770">3770</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3771"><td class="num" id="LN3771">3771</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3772"><td class="num" id="LN3772">3772</td><td class="line"> GSM_MANAGER_ERROR_NOT_IN_RUNNING,</td></tr> +<tr class="codeline" data-linenumber="3773"><td class="num" id="LN3773">3773</td><td class="line"> <span class='string_literal'>"Unable to register client"</span>);</td></tr> +<tr class="codeline" data-linenumber="3774"><td class="num" id="LN3774">3774</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3775"><td class="num" id="LN3775">3775</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3776"><td class="num" id="LN3776">3776</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3777"><td class="num" id="LN3777">3777</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3778"><td class="num" id="LN3778">3778</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3779"><td class="num" id="LN3779">3779</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (startup_id)<span class='macro_popup'>((startup_id)==((void*)0)||(startup_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3780"><td class="num" id="LN3780">3780</td><td class="line"> new_startup_id = gsm_util_generate_startup_id ();</td></tr> +<tr class="codeline" data-linenumber="3781"><td class="num" id="LN3781">3781</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3782"><td class="num" id="LN3782">3782</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3783"><td class="num" id="LN3783">3783</td><td class="line"> client = (GsmClient *)gsm_store_find (priv->clients,</td></tr> +<tr class="codeline" data-linenumber="3784"><td class="num" id="LN3784">3784</td><td class="line"> (GsmStoreFunc)_client_has_startup_id,</td></tr> +<tr class="codeline" data-linenumber="3785"><td class="num" id="LN3785">3785</td><td class="line"> (<span class='keyword'>char</span> *)startup_id);</td></tr> +<tr class="codeline" data-linenumber="3786"><td class="num" id="LN3786">3786</td><td class="line"> <span class='comment'>/* We can't have two clients with the same startup id. */</span></td></tr> +<tr class="codeline" data-linenumber="3787"><td class="num" id="LN3787">3787</td><td class="line"> <span class='keyword'>if</span> (client != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3788"><td class="num" id="LN3788">3788</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3789"><td class="num" id="LN3789">3789</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3790"><td class="num" id="LN3790">3790</td><td class="line"> g_debug (<span class='string_literal'>"Unable to register client: already registered"</span>);</td></tr> +<tr class="codeline" data-linenumber="3791"><td class="num" id="LN3791">3791</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3792"><td class="num" id="LN3792">3792</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3793"><td class="num" id="LN3793">3793</td><td class="line"> GSM_MANAGER_ERROR_ALREADY_REGISTERED,</td></tr> +<tr class="codeline" data-linenumber="3794"><td class="num" id="LN3794">3794</td><td class="line"> <span class='string_literal'>"Unable to register client"</span>);</td></tr> +<tr class="codeline" data-linenumber="3795"><td class="num" id="LN3795">3795</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3796"><td class="num" id="LN3796">3796</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3797"><td class="num" id="LN3797">3797</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3798"><td class="num" id="LN3798">3798</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3799"><td class="num" id="LN3799">3799</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3800"><td class="num" id="LN3800">3800</td><td class="line"> new_startup_id = <span class='macro'>g_strdup (startup_id)<span class='macro_popup'>g_strdup_inline (startup_id)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3801"><td class="num" id="LN3801">3801</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3802"><td class="num" id="LN3802">3802</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3803"><td class="num" id="LN3803">3803</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Adding new client %s to session"</span>, new_startup_id);</td></tr> +<tr class="codeline" data-linenumber="3804"><td class="num" id="LN3804">3804</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3805"><td class="num" id="LN3805">3805</td><td class="line"> <span class='keyword'>if</span> (app == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> && !<span class='macro'>IS_STRING_EMPTY (startup_id)<span class='macro_popup'>((startup_id)==((void*)0)||(startup_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3806"><td class="num" id="LN3806">3806</td><td class="line"> app = find_app_for_startup_id (manager, startup_id);</td></tr> +<tr class="codeline" data-linenumber="3807"><td class="num" id="LN3807">3807</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3808"><td class="num" id="LN3808">3808</td><td class="line"> <span class='keyword'>if</span> (app == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span> && !<span class='macro'>IS_STRING_EMPTY (app_id)<span class='macro_popup'>((app_id)==((void*)0)||(app_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3809"><td class="num" id="LN3809">3809</td><td class="line"> <span class='comment'>/* try to associate this app id with a known app */</span></td></tr> +<tr class="codeline" data-linenumber="3810"><td class="num" id="LN3810">3810</td><td class="line"> app = find_app_for_app_id (manager, app_id);</td></tr> +<tr class="codeline" data-linenumber="3811"><td class="num" id="LN3811">3811</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3812"><td class="num" id="LN3812">3812</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3813"><td class="num" id="LN3813">3813</td><td class="line"> sender = dbus_g_method_get_sender (context);</td></tr> +<tr class="codeline" data-linenumber="3814"><td class="num" id="LN3814">3814</td><td class="line"> client = gsm_dbus_client_new (new_startup_id, sender);</td></tr> +<tr class="codeline" data-linenumber="3815"><td class="num" id="LN3815">3815</td><td class="line"> g_free (sender);</td></tr> +<tr class="codeline" data-linenumber="3816"><td class="num" id="LN3816">3816</td><td class="line"> <span class='keyword'>if</span> (client == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3817"><td class="num" id="LN3817">3817</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3818"><td class="num" id="LN3818">3818</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3819"><td class="num" id="LN3819">3819</td><td class="line"> g_debug (<span class='string_literal'>"Unable to create client"</span>);</td></tr> +<tr class="codeline" data-linenumber="3820"><td class="num" id="LN3820">3820</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3821"><td class="num" id="LN3821">3821</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3822"><td class="num" id="LN3822">3822</td><td class="line"> GSM_MANAGER_ERROR_GENERAL,</td></tr> +<tr class="codeline" data-linenumber="3823"><td class="num" id="LN3823">3823</td><td class="line"> <span class='string_literal'>"Unable to register client"</span>);</td></tr> +<tr class="codeline" data-linenumber="3824"><td class="num" id="LN3824">3824</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3825"><td class="num" id="LN3825">3825</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3826"><td class="num" id="LN3826">3826</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3827"><td class="num" id="LN3827">3827</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3828"><td class="num" id="LN3828">3828</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3829"><td class="num" id="LN3829">3829</td><td class="line"> gsm_store_add (priv->clients, gsm_client_peek_id (client), <span class='macro'>G_OBJECT (client)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((client)), (((GType) ((20) << (2))))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3830"><td class="num" id="LN3830">3830</td><td class="line"> <span class='comment'>/* the store will own the ref */</span></td></tr> +<tr class="codeline" data-linenumber="3831"><td class="num" id="LN3831">3831</td><td class="line"> g_object_unref (client);</td></tr> +<tr class="codeline" data-linenumber="3832"><td class="num" id="LN3832">3832</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3833"><td class="num" id="LN3833">3833</td><td class="line"> <span class='keyword'>if</span> (app != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3834"><td class="num" id="LN3834">3834</td><td class="line"> gsm_client_set_app_id (client, gsm_app_peek_app_id (app));</td></tr> +<tr class="codeline" data-linenumber="3835"><td class="num" id="LN3835">3835</td><td class="line"> gsm_app_registered (app);</td></tr> +<tr class="codeline" data-linenumber="3836"><td class="num" id="LN3836">3836</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="3837"><td class="num" id="LN3837">3837</td><td class="line"> <span class='comment'>/* if an app id is specified store it in the client</span></td></tr> +<tr class="codeline" data-linenumber="3838"><td class="num" id="LN3838">3838</td><td class="line"> <span class='comment'>so we can save it later */</span></td></tr> +<tr class="codeline" data-linenumber="3839"><td class="num" id="LN3839">3839</td><td class="line"> gsm_client_set_app_id (client, app_id);</td></tr> +<tr class="codeline" data-linenumber="3840"><td class="num" id="LN3840">3840</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3841"><td class="num" id="LN3841">3841</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3842"><td class="num" id="LN3842">3842</td><td class="line"> gsm_client_set_status (client, GSM_CLIENT_REGISTERED);</td></tr> +<tr class="codeline" data-linenumber="3843"><td class="num" id="LN3843">3843</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3844"><td class="num" id="LN3844">3844</td><td class="line"> <span class='macro'>g_assert (new_startup_id != NULL)<span class='macro_popup'>do { if (new_startup_id != ((void*)0)) ; else g_assertion_message_expr<br> (((gchar*) 0), "gsm-manager.c", 3844, ((const char*) (__func__<br>)), "new_startup_id != NULL"); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3845"><td class="num" id="LN3845">3845</td><td class="line"> g_free (new_startup_id);</td></tr> +<tr class="codeline" data-linenumber="3846"><td class="num" id="LN3846">3846</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3847"><td class="num" id="LN3847">3847</td><td class="line"> dbus_g_method_return (context, gsm_client_peek_id (client));</td></tr> +<tr class="codeline" data-linenumber="3848"><td class="num" id="LN3848">3848</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3849"><td class="num" id="LN3849">3849</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3850"><td class="num" id="LN3850">3850</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3851"><td class="num" id="LN3851">3851</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3852"><td class="num" id="LN3852">3852</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3853"><td class="num" id="LN3853">3853</td><td class="line">gsm_manager_unregister_client (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3854"><td class="num" id="LN3854">3854</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *client_id,</td></tr> +<tr class="codeline" data-linenumber="3855"><td class="num" id="LN3855">3855</td><td class="line"> DBusGMethodInvocation *context)</td></tr> +<tr class="codeline" data-linenumber="3856"><td class="num" id="LN3856">3856</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3857"><td class="num" id="LN3857">3857</td><td class="line"> GsmClient *client;</td></tr> +<tr class="codeline" data-linenumber="3858"><td class="num" id="LN3858">3858</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3859"><td class="num" id="LN3859">3859</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3860"><td class="num" id="LN3860">3860</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3861"><td class="num" id="LN3861">3861</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3862"><td class="num" id="LN3862">3862</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: UnregisterClient %s"</span>, client_id);</td></tr> +<tr class="codeline" data-linenumber="3863"><td class="num" id="LN3863">3863</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3864"><td class="num" id="LN3864">3864</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3865"><td class="num" id="LN3865">3865</td><td class="line"> client = (GsmClient *)gsm_store_lookup (priv->clients, client_id);</td></tr> +<tr class="codeline" data-linenumber="3866"><td class="num" id="LN3866">3866</td><td class="line"> <span class='keyword'>if</span> (client == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3867"><td class="num" id="LN3867">3867</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3868"><td class="num" id="LN3868">3868</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3869"><td class="num" id="LN3869">3869</td><td class="line"> g_debug (<span class='string_literal'>"Unable to unregister client: not registered"</span>);</td></tr> +<tr class="codeline" data-linenumber="3870"><td class="num" id="LN3870">3870</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3871"><td class="num" id="LN3871">3871</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3872"><td class="num" id="LN3872">3872</td><td class="line"> GSM_MANAGER_ERROR_NOT_REGISTERED,</td></tr> +<tr class="codeline" data-linenumber="3873"><td class="num" id="LN3873">3873</td><td class="line"> <span class='string_literal'>"Unable to unregister client"</span>);</td></tr> +<tr class="codeline" data-linenumber="3874"><td class="num" id="LN3874">3874</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3875"><td class="num" id="LN3875">3875</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3876"><td class="num" id="LN3876">3876</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3877"><td class="num" id="LN3877">3877</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3878"><td class="num" id="LN3878">3878</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3879"><td class="num" id="LN3879">3879</td><td class="line"> <span class='comment'>/* don't disconnect client here, only change the status.</span></td></tr> +<tr class="codeline" data-linenumber="3880"><td class="num" id="LN3880">3880</td><td class="line"> <span class='comment'>Wait until it leaves the bus before disconnecting it */</span></td></tr> +<tr class="codeline" data-linenumber="3881"><td class="num" id="LN3881">3881</td><td class="line"> gsm_client_set_status (client, GSM_CLIENT_UNREGISTERED);</td></tr> +<tr class="codeline" data-linenumber="3882"><td class="num" id="LN3882">3882</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3883"><td class="num" id="LN3883">3883</td><td class="line"> dbus_g_method_return (context);</td></tr> +<tr class="codeline" data-linenumber="3884"><td class="num" id="LN3884">3884</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3885"><td class="num" id="LN3885">3885</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3886"><td class="num" id="LN3886">3886</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3887"><td class="num" id="LN3887">3887</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3888"><td class="num" id="LN3888">3888</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3889"><td class="num" id="LN3889">3889</td><td class="line">gsm_manager_inhibit (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3890"><td class="num" id="LN3890">3890</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *app_id,</td></tr> +<tr class="codeline" data-linenumber="3891"><td class="num" id="LN3891">3891</td><td class="line"> guint toplevel_xid,</td></tr> +<tr class="codeline" data-linenumber="3892"><td class="num" id="LN3892">3892</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *reason,</td></tr> +<tr class="codeline" data-linenumber="3893"><td class="num" id="LN3893">3893</td><td class="line"> guint flags,</td></tr> +<tr class="codeline" data-linenumber="3894"><td class="num" id="LN3894">3894</td><td class="line"> DBusGMethodInvocation *context)</td></tr> +<tr class="codeline" data-linenumber="3895"><td class="num" id="LN3895">3895</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3896"><td class="num" id="LN3896">3896</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="3897"><td class="num" id="LN3897">3897</td><td class="line"> guint cookie;</td></tr> +<tr class="codeline" data-linenumber="3898"><td class="num" id="LN3898">3898</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3899"><td class="num" id="LN3899">3899</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3900"><td class="num" id="LN3900">3900</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3901"><td class="num" id="LN3901">3901</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3902"><td class="num" id="LN3902">3902</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Inhibit xid=%u app_id=%s reason=%s flags=%u"</span>,</td></tr> +<tr class="codeline" data-linenumber="3903"><td class="num" id="LN3903">3903</td><td class="line"> toplevel_xid,</td></tr> +<tr class="codeline" data-linenumber="3904"><td class="num" id="LN3904">3904</td><td class="line"> app_id,</td></tr> +<tr class="codeline" data-linenumber="3905"><td class="num" id="LN3905">3905</td><td class="line"> reason,</td></tr> +<tr class="codeline" data-linenumber="3906"><td class="num" id="LN3906">3906</td><td class="line"> flags);</td></tr> +<tr class="codeline" data-linenumber="3907"><td class="num" id="LN3907">3907</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3908"><td class="num" id="LN3908">3908</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3909"><td class="num" id="LN3909">3909</td><td class="line"> <span class='keyword'>if</span> (priv->logout_mode == GSM_MANAGER_LOGOUT_MODE_FORCE) {</td></tr> +<tr class="codeline" data-linenumber="3910"><td class="num" id="LN3910">3910</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3911"><td class="num" id="LN3911">3911</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3912"><td class="num" id="LN3912">3912</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3913"><td class="num" id="LN3913">3913</td><td class="line"> GSM_MANAGER_ERROR_GENERAL,</td></tr> +<tr class="codeline" data-linenumber="3914"><td class="num" id="LN3914">3914</td><td class="line"> <span class='string_literal'>"Forced logout cannot be inhibited"</span>);</td></tr> +<tr class="codeline" data-linenumber="3915"><td class="num" id="LN3915">3915</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Unable to inhibit: %s"</span>, new_error->message);</td></tr> +<tr class="codeline" data-linenumber="3916"><td class="num" id="LN3916">3916</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3917"><td class="num" id="LN3917">3917</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3918"><td class="num" id="LN3918">3918</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3919"><td class="num" id="LN3919">3919</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3920"><td class="num" id="LN3920">3920</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3921"><td class="num" id="LN3921">3921</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (app_id)<span class='macro_popup'>((app_id)==((void*)0)||(app_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3922"><td class="num" id="LN3922">3922</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3923"><td class="num" id="LN3923">3923</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3924"><td class="num" id="LN3924">3924</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3925"><td class="num" id="LN3925">3925</td><td class="line"> GSM_MANAGER_ERROR_GENERAL,</td></tr> +<tr class="codeline" data-linenumber="3926"><td class="num" id="LN3926">3926</td><td class="line"> <span class='string_literal'>"Application ID not specified"</span>);</td></tr> +<tr class="codeline" data-linenumber="3927"><td class="num" id="LN3927">3927</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Unable to inhibit: %s"</span>, new_error->message);</td></tr> +<tr class="codeline" data-linenumber="3928"><td class="num" id="LN3928">3928</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3929"><td class="num" id="LN3929">3929</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3930"><td class="num" id="LN3930">3930</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3931"><td class="num" id="LN3931">3931</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3932"><td class="num" id="LN3932">3932</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3933"><td class="num" id="LN3933">3933</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (reason)<span class='macro_popup'>((reason)==((void*)0)||(reason)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3934"><td class="num" id="LN3934">3934</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3935"><td class="num" id="LN3935">3935</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3936"><td class="num" id="LN3936">3936</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3937"><td class="num" id="LN3937">3937</td><td class="line"> GSM_MANAGER_ERROR_GENERAL,</td></tr> +<tr class="codeline" data-linenumber="3938"><td class="num" id="LN3938">3938</td><td class="line"> <span class='string_literal'>"Reason not specified"</span>);</td></tr> +<tr class="codeline" data-linenumber="3939"><td class="num" id="LN3939">3939</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Unable to inhibit: %s"</span>, new_error->message);</td></tr> +<tr class="codeline" data-linenumber="3940"><td class="num" id="LN3940">3940</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3941"><td class="num" id="LN3941">3941</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3942"><td class="num" id="LN3942">3942</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3943"><td class="num" id="LN3943">3943</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3944"><td class="num" id="LN3944">3944</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3945"><td class="num" id="LN3945">3945</td><td class="line"> <span class='keyword'>if</span> (flags == 0) {</td></tr> +<tr class="codeline" data-linenumber="3946"><td class="num" id="LN3946">3946</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3947"><td class="num" id="LN3947">3947</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3948"><td class="num" id="LN3948">3948</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3949"><td class="num" id="LN3949">3949</td><td class="line"> GSM_MANAGER_ERROR_GENERAL,</td></tr> +<tr class="codeline" data-linenumber="3950"><td class="num" id="LN3950">3950</td><td class="line"> <span class='string_literal'>"Invalid inhibit flags"</span>);</td></tr> +<tr class="codeline" data-linenumber="3951"><td class="num" id="LN3951">3951</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Unable to inhibit: %s"</span>, new_error->message);</td></tr> +<tr class="codeline" data-linenumber="3952"><td class="num" id="LN3952">3952</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3953"><td class="num" id="LN3953">3953</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3954"><td class="num" id="LN3954">3954</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3955"><td class="num" id="LN3955">3955</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3956"><td class="num" id="LN3956">3956</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3957"><td class="num" id="LN3957">3957</td><td class="line"> cookie = _generate_unique_cookie (manager);</td></tr> +<tr class="codeline" data-linenumber="3958"><td class="num" id="LN3958">3958</td><td class="line"> inhibitor = gsm_inhibitor_new (app_id,</td></tr> +<tr class="codeline" data-linenumber="3959"><td class="num" id="LN3959">3959</td><td class="line"> toplevel_xid,</td></tr> +<tr class="codeline" data-linenumber="3960"><td class="num" id="LN3960">3960</td><td class="line"> flags,</td></tr> +<tr class="codeline" data-linenumber="3961"><td class="num" id="LN3961">3961</td><td class="line"> reason,</td></tr> +<tr class="codeline" data-linenumber="3962"><td class="num" id="LN3962">3962</td><td class="line"> dbus_g_method_get_sender (context),</td></tr> +<tr class="codeline" data-linenumber="3963"><td class="num" id="LN3963">3963</td><td class="line"> cookie);</td></tr> +<tr class="codeline" data-linenumber="3964"><td class="num" id="LN3964">3964</td><td class="line"> gsm_store_add (priv->inhibitors, gsm_inhibitor_peek_id (inhibitor), <span class='macro'>G_OBJECT (inhibitor)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((inhibitor)), (((GType) ((20) << (2))))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="3965"><td class="num" id="LN3965">3965</td><td class="line"> g_object_unref (inhibitor);</td></tr> +<tr class="codeline" data-linenumber="3966"><td class="num" id="LN3966">3966</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3967"><td class="num" id="LN3967">3967</td><td class="line"> dbus_g_method_return (context, cookie);</td></tr> +<tr class="codeline" data-linenumber="3968"><td class="num" id="LN3968">3968</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3969"><td class="num" id="LN3969">3969</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3970"><td class="num" id="LN3970">3970</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="3971"><td class="num" id="LN3971">3971</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3972"><td class="num" id="LN3972">3972</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="3973"><td class="num" id="LN3973">3973</td><td class="line">gsm_manager_uninhibit (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="3974"><td class="num" id="LN3974">3974</td><td class="line"> guint cookie,</td></tr> +<tr class="codeline" data-linenumber="3975"><td class="num" id="LN3975">3975</td><td class="line"> DBusGMethodInvocation *context)</td></tr> +<tr class="codeline" data-linenumber="3976"><td class="num" id="LN3976">3976</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="3977"><td class="num" id="LN3977">3977</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="3978"><td class="num" id="LN3978">3978</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="3979"><td class="num" id="LN3979">3979</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3980"><td class="num" id="LN3980">3980</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3981"><td class="num" id="LN3981">3981</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3982"><td class="num" id="LN3982">3982</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: Uninhibit %u"</span>, cookie);</td></tr> +<tr class="codeline" data-linenumber="3983"><td class="num" id="LN3983">3983</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3984"><td class="num" id="LN3984">3984</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="3985"><td class="num" id="LN3985">3985</td><td class="line"> inhibitor = (GsmInhibitor *)gsm_store_find (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="3986"><td class="num" id="LN3986">3986</td><td class="line"> (GsmStoreFunc)_find_by_cookie,</td></tr> +<tr class="codeline" data-linenumber="3987"><td class="num" id="LN3987">3987</td><td class="line"> &cookie);</td></tr> +<tr class="codeline" data-linenumber="3988"><td class="num" id="LN3988">3988</td><td class="line"> <span class='keyword'>if</span> (inhibitor == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="3989"><td class="num" id="LN3989">3989</td><td class="line"> GError *new_error;</td></tr> +<tr class="codeline" data-linenumber="3990"><td class="num" id="LN3990">3990</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="3991"><td class="num" id="LN3991">3991</td><td class="line"> new_error = g_error_new (<span class='macro'>GSM_MANAGER_ERROR<span class='macro_popup'>gsm_manager_error_quark ()</span></span>,</td></tr> +<tr class="codeline" data-linenumber="3992"><td class="num" id="LN3992">3992</td><td class="line"> GSM_MANAGER_ERROR_GENERAL,</td></tr> +<tr class="codeline" data-linenumber="3993"><td class="num" id="LN3993">3993</td><td class="line"> <span class='string_literal'>"Unable to uninhibit: Invalid cookie"</span>);</td></tr> +<tr class="codeline" data-linenumber="3994"><td class="num" id="LN3994">3994</td><td class="line"> dbus_g_method_return_error (context, new_error);</td></tr> +<tr class="codeline" data-linenumber="3995"><td class="num" id="LN3995">3995</td><td class="line"> g_debug (<span class='string_literal'>"Unable to uninhibit: %s"</span>, new_error->message);</td></tr> +<tr class="codeline" data-linenumber="3996"><td class="num" id="LN3996">3996</td><td class="line"> g_error_free (new_error);</td></tr> +<tr class="codeline" data-linenumber="3997"><td class="num" id="LN3997">3997</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="3998"><td class="num" id="LN3998">3998</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="3999"><td class="num" id="LN3999">3999</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4000"><td class="num" id="LN4000">4000</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: removing inhibitor %s %u reason '%s' %u connection %s"</span>,</td></tr> +<tr class="codeline" data-linenumber="4001"><td class="num" id="LN4001">4001</td><td class="line"> gsm_inhibitor_peek_app_id (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="4002"><td class="num" id="LN4002">4002</td><td class="line"> gsm_inhibitor_peek_toplevel_xid (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="4003"><td class="num" id="LN4003">4003</td><td class="line"> gsm_inhibitor_peek_reason (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="4004"><td class="num" id="LN4004">4004</td><td class="line"> gsm_inhibitor_peek_flags (inhibitor),</td></tr> +<tr class="codeline" data-linenumber="4005"><td class="num" id="LN4005">4005</td><td class="line"> gsm_inhibitor_peek_bus_name (inhibitor));</td></tr> +<tr class="codeline" data-linenumber="4006"><td class="num" id="LN4006">4006</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4007"><td class="num" id="LN4007">4007</td><td class="line"> gsm_store_remove (priv->inhibitors, gsm_inhibitor_peek_id (inhibitor));</td></tr> +<tr class="codeline" data-linenumber="4008"><td class="num" id="LN4008">4008</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4009"><td class="num" id="LN4009">4009</td><td class="line"> dbus_g_method_return (context);</td></tr> +<tr class="codeline" data-linenumber="4010"><td class="num" id="LN4010">4010</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4011"><td class="num" id="LN4011">4011</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4012"><td class="num" id="LN4012">4012</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4013"><td class="num" id="LN4013">4013</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4014"><td class="num" id="LN4014">4014</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="4015"><td class="num" id="LN4015">4015</td><td class="line">gsm_manager_is_inhibited (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="4016"><td class="num" id="LN4016">4016</td><td class="line"> guint flags,</td></tr> +<tr class="codeline" data-linenumber="4017"><td class="num" id="LN4017">4017</td><td class="line"> gboolean *is_inhibited,</td></tr> +<tr class="codeline" data-linenumber="4018"><td class="num" id="LN4018">4018</td><td class="line"> GError *error)</td></tr> +<tr class="codeline" data-linenumber="4019"><td class="num" id="LN4019">4019</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4020"><td class="num" id="LN4020">4020</td><td class="line"> GsmInhibitor *inhibitor;</td></tr> +<tr class="codeline" data-linenumber="4021"><td class="num" id="LN4021">4021</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="4022"><td class="num" id="LN4022">4022</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4023"><td class="num" id="LN4023">4023</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4024"><td class="num" id="LN4024">4024</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4025"><td class="num" id="LN4025">4025</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="4026"><td class="num" id="LN4026">4026</td><td class="line"> <span class='keyword'>if</span> (priv->inhibitors == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span></td></tr> +<tr class="codeline" data-linenumber="4027"><td class="num" id="LN4027">4027</td><td class="line"> || gsm_store_size (priv->inhibitors) == 0) {</td></tr> +<tr class="codeline" data-linenumber="4028"><td class="num" id="LN4028">4028</td><td class="line"> *is_inhibited = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4029"><td class="num" id="LN4029">4029</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4030"><td class="num" id="LN4030">4030</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4031"><td class="num" id="LN4031">4031</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4032"><td class="num" id="LN4032">4032</td><td class="line"> inhibitor = (GsmInhibitor *) gsm_store_find (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="4033"><td class="num" id="LN4033">4033</td><td class="line"> (GsmStoreFunc)inhibitor_has_flag,</td></tr> +<tr class="codeline" data-linenumber="4034"><td class="num" id="LN4034">4034</td><td class="line"> <span class='macro'>GUINT_TO_POINTER (flags)<span class='macro_popup'>((gpointer) (gulong) (flags))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="4035"><td class="num" id="LN4035">4035</td><td class="line"> <span class='keyword'>if</span> (inhibitor == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4036"><td class="num" id="LN4036">4036</td><td class="line"> *is_inhibited = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4037"><td class="num" id="LN4037">4037</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="4038"><td class="num" id="LN4038">4038</td><td class="line"> *is_inhibited = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4039"><td class="num" id="LN4039">4039</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4040"><td class="num" id="LN4040">4040</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4041"><td class="num" id="LN4041">4041</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4042"><td class="num" id="LN4042">4042</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4043"><td class="num" id="LN4043">4043</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4044"><td class="num" id="LN4044">4044</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4045"><td class="num" id="LN4045">4045</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="4046"><td class="num" id="LN4046">4046</td><td class="line">listify_store_ids (<span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="4047"><td class="num" id="LN4047">4047</td><td class="line"> GObject *object,</td></tr> +<tr class="codeline" data-linenumber="4048"><td class="num" id="LN4048">4048</td><td class="line"> GPtrArray **array)</td></tr> +<tr class="codeline" data-linenumber="4049"><td class="num" id="LN4049">4049</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4050"><td class="num" id="LN4050">4050</td><td class="line"> g_ptr_array_add (*array, <span class='macro'>g_strdup (id)<span class='macro_popup'>g_strdup_inline (id)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="4051"><td class="num" id="LN4051">4051</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4052"><td class="num" id="LN4052">4052</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4053"><td class="num" id="LN4053">4053</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4054"><td class="num" id="LN4054">4054</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="4055"><td class="num" id="LN4055">4055</td><td class="line">gsm_manager_get_clients (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="4056"><td class="num" id="LN4056">4056</td><td class="line"> GPtrArray **clients,</td></tr> +<tr class="codeline" data-linenumber="4057"><td class="num" id="LN4057">4057</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="4058"><td class="num" id="LN4058">4058</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4059"><td class="num" id="LN4059">4059</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="4060"><td class="num" id="LN4060">4060</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4061"><td class="num" id="LN4061">4061</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4062"><td class="num" id="LN4062">4062</td><td class="line"> <span class='keyword'>if</span> (clients == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4063"><td class="num" id="LN4063">4063</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4064"><td class="num" id="LN4064">4064</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4065"><td class="num" id="LN4065">4065</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4066"><td class="num" id="LN4066">4066</td><td class="line"> *clients = g_ptr_array_new ();</td></tr> +<tr class="codeline" data-linenumber="4067"><td class="num" id="LN4067">4067</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="4068"><td class="num" id="LN4068">4068</td><td class="line"> gsm_store_foreach (priv->clients, (GsmStoreFunc)listify_store_ids, clients);</td></tr> +<tr class="codeline" data-linenumber="4069"><td class="num" id="LN4069">4069</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4070"><td class="num" id="LN4070">4070</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4071"><td class="num" id="LN4071">4071</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4072"><td class="num" id="LN4072">4072</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4073"><td class="num" id="LN4073">4073</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="4074"><td class="num" id="LN4074">4074</td><td class="line">gsm_manager_get_inhibitors (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="4075"><td class="num" id="LN4075">4075</td><td class="line"> GPtrArray **inhibitors,</td></tr> +<tr class="codeline" data-linenumber="4076"><td class="num" id="LN4076">4076</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="4077"><td class="num" id="LN4077">4077</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4078"><td class="num" id="LN4078">4078</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="4079"><td class="num" id="LN4079">4079</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4080"><td class="num" id="LN4080">4080</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4081"><td class="num" id="LN4081">4081</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4082"><td class="num" id="LN4082">4082</td><td class="line"> <span class='keyword'>if</span> (inhibitors == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4083"><td class="num" id="LN4083">4083</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4084"><td class="num" id="LN4084">4084</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4085"><td class="num" id="LN4085">4085</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4086"><td class="num" id="LN4086">4086</td><td class="line"> *inhibitors = g_ptr_array_new ();</td></tr> +<tr class="codeline" data-linenumber="4087"><td class="num" id="LN4087">4087</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="4088"><td class="num" id="LN4088">4088</td><td class="line"> gsm_store_foreach (priv->inhibitors,</td></tr> +<tr class="codeline" data-linenumber="4089"><td class="num" id="LN4089">4089</td><td class="line"> (GsmStoreFunc) listify_store_ids,</td></tr> +<tr class="codeline" data-linenumber="4090"><td class="num" id="LN4090">4090</td><td class="line"> inhibitors);</td></tr> +<tr class="codeline" data-linenumber="4091"><td class="num" id="LN4091">4091</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4092"><td class="num" id="LN4092">4092</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4093"><td class="num" id="LN4093">4093</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4094"><td class="num" id="LN4094">4094</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4095"><td class="num" id="LN4095">4095</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="4096"><td class="num" id="LN4096">4096</td><td class="line">_app_has_autostart_condition (<span class='keyword'>const</span> <span class='keyword'>char</span> *id,</td></tr> +<tr class="codeline" data-linenumber="4097"><td class="num" id="LN4097">4097</td><td class="line"> GsmApp *app,</td></tr> +<tr class="codeline" data-linenumber="4098"><td class="num" id="LN4098">4098</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *condition)</td></tr> +<tr class="codeline" data-linenumber="4099"><td class="num" id="LN4099">4099</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4100"><td class="num" id="LN4100">4100</td><td class="line"> gboolean has;</td></tr> +<tr class="codeline" data-linenumber="4101"><td class="num" id="LN4101">4101</td><td class="line"> gboolean disabled;</td></tr> +<tr class="codeline" data-linenumber="4102"><td class="num" id="LN4102">4102</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4103"><td class="num" id="LN4103">4103</td><td class="line"> has = gsm_app_has_autostart_condition (app, condition);</td></tr> +<tr class="codeline" data-linenumber="4104"><td class="num" id="LN4104">4104</td><td class="line"> disabled = gsm_app_peek_is_disabled (app);</td></tr> +<tr class="codeline" data-linenumber="4105"><td class="num" id="LN4105">4105</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4106"><td class="num" id="LN4106">4106</td><td class="line"> <span class='keyword'>return</span> has && !disabled;</td></tr> +<tr class="codeline" data-linenumber="4107"><td class="num" id="LN4107">4107</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4108"><td class="num" id="LN4108">4108</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4109"><td class="num" id="LN4109">4109</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="4110"><td class="num" id="LN4110">4110</td><td class="line">gsm_manager_is_autostart_condition_handled (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="4111"><td class="num" id="LN4111">4111</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *condition,</td></tr> +<tr class="codeline" data-linenumber="4112"><td class="num" id="LN4112">4112</td><td class="line"> gboolean *handled,</td></tr> +<tr class="codeline" data-linenumber="4113"><td class="num" id="LN4113">4113</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="4114"><td class="num" id="LN4114">4114</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4115"><td class="num" id="LN4115">4115</td><td class="line"> GsmApp *app;</td></tr> +<tr class="codeline" data-linenumber="4116"><td class="num" id="LN4116">4116</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="4117"><td class="num" id="LN4117">4117</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4118"><td class="num" id="LN4118">4118</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4119"><td class="num" id="LN4119">4119</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4120"><td class="num" id="LN4120">4120</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="4121"><td class="num" id="LN4121">4121</td><td class="line"> app = (GsmApp *) gsm_store_find (priv->apps,(</td></tr> +<tr class="codeline" data-linenumber="4122"><td class="num" id="LN4122">4122</td><td class="line"> GsmStoreFunc) _app_has_autostart_condition,</td></tr> +<tr class="codeline" data-linenumber="4123"><td class="num" id="LN4123">4123</td><td class="line"> (<span class='keyword'>char</span> *)condition);</td></tr> +<tr class="codeline" data-linenumber="4124"><td class="num" id="LN4124">4124</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4125"><td class="num" id="LN4125">4125</td><td class="line"> <span class='keyword'>if</span> (app != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4126"><td class="num" id="LN4126">4126</td><td class="line"> *handled = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4127"><td class="num" id="LN4127">4127</td><td class="line"> } <span class='keyword'>else</span> {</td></tr> +<tr class="codeline" data-linenumber="4128"><td class="num" id="LN4128">4128</td><td class="line"> *handled = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4129"><td class="num" id="LN4129">4129</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4130"><td class="num" id="LN4130">4130</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4131"><td class="num" id="LN4131">4131</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4132"><td class="num" id="LN4132">4132</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4133"><td class="num" id="LN4133">4133</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4134"><td class="num" id="LN4134">4134</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="4135"><td class="num" id="LN4135">4135</td><td class="line">append_app (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="4136"><td class="num" id="LN4136">4136</td><td class="line"> GsmApp *app)</td></tr> +<tr class="codeline" data-linenumber="4137"><td class="num" id="LN4137">4137</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4138"><td class="num" id="LN4138">4138</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *id;</td></tr> +<tr class="codeline" data-linenumber="4139"><td class="num" id="LN4139">4139</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *app_id;</td></tr> +<tr class="codeline" data-linenumber="4140"><td class="num" id="LN4140">4140</td><td class="line"> GsmApp *dup;</td></tr> +<tr class="codeline" data-linenumber="4141"><td class="num" id="LN4141">4141</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="4142"><td class="num" id="LN4142">4142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4143"><td class="num" id="LN4143">4143</td><td class="line"> id = gsm_app_peek_id (app);</td></tr> +<tr class="codeline" data-linenumber="4144"><td class="num" id="LN4144">4144</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (id)<span class='macro_popup'>((id)==((void*)0)||(id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4145"><td class="num" id="LN4145">4145</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: not adding app: no id"</span>);</td></tr> +<tr class="codeline" data-linenumber="4146"><td class="num" id="LN4146">4146</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="4147"><td class="num" id="LN4147">4147</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4148"><td class="num" id="LN4148">4148</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4149"><td class="num" id="LN4149">4149</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="4150"><td class="num" id="LN4150">4150</td><td class="line"> dup = (GsmApp *)gsm_store_lookup (priv->apps, id);</td></tr> +<tr class="codeline" data-linenumber="4151"><td class="num" id="LN4151">4151</td><td class="line"> <span class='keyword'>if</span> (dup != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4152"><td class="num" id="LN4152">4152</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: not adding app: already added"</span>);</td></tr> +<tr class="codeline" data-linenumber="4153"><td class="num" id="LN4153">4153</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="4154"><td class="num" id="LN4154">4154</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4155"><td class="num" id="LN4155">4155</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4156"><td class="num" id="LN4156">4156</td><td class="line"> app_id = gsm_app_peek_app_id (app);</td></tr> +<tr class="codeline" data-linenumber="4157"><td class="num" id="LN4157">4157</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>IS_STRING_EMPTY (app_id)<span class='macro_popup'>((app_id)==((void*)0)||(app_id)[0]=='\0')</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4158"><td class="num" id="LN4158">4158</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: not adding app: no app-id"</span>);</td></tr> +<tr class="codeline" data-linenumber="4159"><td class="num" id="LN4159">4159</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="4160"><td class="num" id="LN4160">4160</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4161"><td class="num" id="LN4161">4161</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4162"><td class="num" id="LN4162">4162</td><td class="line"> dup = find_app_for_app_id (manager, app_id);</td></tr> +<tr class="codeline" data-linenumber="4163"><td class="num" id="LN4163">4163</td><td class="line"> <span class='keyword'>if</span> (dup != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4164"><td class="num" id="LN4164">4164</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: not adding app: app-id already exists"</span>);</td></tr> +<tr class="codeline" data-linenumber="4165"><td class="num" id="LN4165">4165</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="4166"><td class="num" id="LN4166">4166</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4167"><td class="num" id="LN4167">4167</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4168"><td class="num" id="LN4168">4168</td><td class="line"> gsm_store_add (priv->apps, id, <span class='macro'>G_OBJECT (app)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((app)), (((GType) ((20) << (2))))))))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="4169"><td class="num" id="LN4169">4169</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4170"><td class="num" id="LN4170">4170</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4171"><td class="num" id="LN4171">4171</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="4172"><td class="num" id="LN4172">4172</td><td class="line">gsm_manager_add_autostart_app (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="4173"><td class="num" id="LN4173">4173</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *path,</td></tr> +<tr class="codeline" data-linenumber="4174"><td class="num" id="LN4174">4174</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *provides)</td></tr> +<tr class="codeline" data-linenumber="4175"><td class="num" id="LN4175">4175</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4176"><td class="num" id="LN4176">4176</td><td class="line"> GsmApp *app;</td></tr> +<tr class="codeline" data-linenumber="4177"><td class="num" id="LN4177">4177</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="4178"><td class="num" id="LN4178">4178</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4179"><td class="num" id="LN4179">4179</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4180"><td class="num" id="LN4180">4180</td><td class="line"> <span class='macro'>g_return_val_if_fail (path != NULL, FALSE)<span class='macro_popup'>do { if ((path != ((void*)0))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "path != NULL"); return<br> ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4181"><td class="num" id="LN4181">4181</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4182"><td class="num" id="LN4182">4182</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="4183"><td class="num" id="LN4183">4183</td><td class="line"> <span class='comment'>/* first check to see if service is already provided */</span></td></tr> +<tr class="codeline" data-linenumber="4184"><td class="num" id="LN4184">4184</td><td class="line"> <span class='keyword'>if</span> (provides != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4185"><td class="num" id="LN4185">4185</td><td class="line"> GsmApp *dup;</td></tr> +<tr class="codeline" data-linenumber="4186"><td class="num" id="LN4186">4186</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4187"><td class="num" id="LN4187">4187</td><td class="line"> dup = (GsmApp *)gsm_store_find (priv->apps,</td></tr> +<tr class="codeline" data-linenumber="4188"><td class="num" id="LN4188">4188</td><td class="line"> (GsmStoreFunc)_find_app_provides,</td></tr> +<tr class="codeline" data-linenumber="4189"><td class="num" id="LN4189">4189</td><td class="line"> (<span class='keyword'>char</span> *)provides);</td></tr> +<tr class="codeline" data-linenumber="4190"><td class="num" id="LN4190">4190</td><td class="line"> <span class='keyword'>if</span> (dup != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4191"><td class="num" id="LN4191">4191</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: service '%s' is already provided"</span>, provides);</td></tr> +<tr class="codeline" data-linenumber="4192"><td class="num" id="LN4192">4192</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4193"><td class="num" id="LN4193">4193</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4194"><td class="num" id="LN4194">4194</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4195"><td class="num" id="LN4195">4195</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4196"><td class="num" id="LN4196">4196</td><td class="line"> app = gsm_autostart_app_new (path);</td></tr> +<tr class="codeline" data-linenumber="4197"><td class="num" id="LN4197">4197</td><td class="line"> <span class='keyword'>if</span> (app == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4198"><td class="num" id="LN4198">4198</td><td class="line"> g_warning (<span class='string_literal'>"could not read %s"</span>, path);</td></tr> +<tr class="codeline" data-linenumber="4199"><td class="num" id="LN4199">4199</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4200"><td class="num" id="LN4200">4200</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4201"><td class="num" id="LN4201">4201</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4202"><td class="num" id="LN4202">4202</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: read %s"</span>, path);</td></tr> +<tr class="codeline" data-linenumber="4203"><td class="num" id="LN4203">4203</td><td class="line"> append_app (manager, app);</td></tr> +<tr class="codeline" data-linenumber="4204"><td class="num" id="LN4204">4204</td><td class="line"> g_object_unref (app);</td></tr> +<tr class="codeline" data-linenumber="4205"><td class="num" id="LN4205">4205</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4206"><td class="num" id="LN4206">4206</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4207"><td class="num" id="LN4207">4207</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4208"><td class="num" id="LN4208">4208</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4209"><td class="num" id="LN4209">4209</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="4210"><td class="num" id="LN4210">4210</td><td class="line">gsm_manager_add_autostart_apps_from_dir (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="4211"><td class="num" id="LN4211">4211</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *path)</td></tr> +<tr class="codeline" data-linenumber="4212"><td class="num" id="LN4212">4212</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4213"><td class="num" id="LN4213">4213</td><td class="line"> GDir *dir;</td></tr> +<tr class="codeline" data-linenumber="4214"><td class="num" id="LN4214">4214</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span> *name;</td></tr> +<tr class="codeline" data-linenumber="4215"><td class="num" id="LN4215">4215</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4216"><td class="num" id="LN4216">4216</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4217"><td class="num" id="LN4217">4217</td><td class="line"> <span class='macro'>g_return_val_if_fail (path != NULL, FALSE)<span class='macro_popup'>do { if ((path != ((void*)0))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "path != NULL"); return<br> ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4218"><td class="num" id="LN4218">4218</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4219"><td class="num" id="LN4219">4219</td><td class="line"> g_debug (<span class='string_literal'>"GsmManager: *** Adding autostart apps for %s"</span>, path);</td></tr> +<tr class="codeline" data-linenumber="4220"><td class="num" id="LN4220">4220</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4221"><td class="num" id="LN4221">4221</td><td class="line"> dir = g_dir_open (path, 0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="4222"><td class="num" id="LN4222">4222</td><td class="line"> <span class='keyword'>if</span> (dir == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4223"><td class="num" id="LN4223">4223</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4224"><td class="num" id="LN4224">4224</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4225"><td class="num" id="LN4225">4225</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4226"><td class="num" id="LN4226">4226</td><td class="line"> <span class='keyword'>while</span> ((name = g_dir_read_name (dir))) {</td></tr> +<tr class="codeline" data-linenumber="4227"><td class="num" id="LN4227">4227</td><td class="line"> <span class='keyword'>char</span> *desktop_file;</td></tr> +<tr class="codeline" data-linenumber="4228"><td class="num" id="LN4228">4228</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4229"><td class="num" id="LN4229">4229</td><td class="line"> <span class='keyword'>if</span> (!<span class='macro'>g_str_has_suffix (name, <span class='string_literal'>".desktop"</span>)<span class='macro_popup'>(__builtin_constant_p (".desktop")? __extension__ ({ const char<br> * const __str = (name); const char * const __suffix = (".desktop"<br>); gboolean __result = (0); if (__str == ((void*)0) || __suffix<br> == ((void*)0)) __result = (g_str_has_suffix) (__str, __suffix<br>); else { const size_t __str_len = strlen (((__str) + !(__str<br>))); const size_t __suffix_len = strlen (((__suffix) + !(__suffix<br>))); if (__str_len >= __suffix_len) __result = memcmp (__str<br> + __str_len - __suffix_len, ((__suffix) + !(__suffix)), __suffix_len<br>) == 0; } __result; }) : (g_str_has_suffix) (name, ".desktop"<br>) )</span></span>) {</td></tr> +<tr class="codeline" data-linenumber="4230"><td class="num" id="LN4230">4230</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="4231"><td class="num" id="LN4231">4231</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4232"><td class="num" id="LN4232">4232</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4233"><td class="num" id="LN4233">4233</td><td class="line"> desktop_file = g_build_filename (path, name, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="4234"><td class="num" id="LN4234">4234</td><td class="line"> gsm_manager_add_autostart_app (manager, desktop_file, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="4235"><td class="num" id="LN4235">4235</td><td class="line"> g_free (desktop_file);</td></tr> +<tr class="codeline" data-linenumber="4236"><td class="num" id="LN4236">4236</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="4237"><td class="num" id="LN4237">4237</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4238"><td class="num" id="LN4238">4238</td><td class="line"> g_dir_close (dir);</td></tr> +<tr class="codeline" data-linenumber="4239"><td class="num" id="LN4239">4239</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4240"><td class="num" id="LN4240">4240</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4241"><td class="num" id="LN4241">4241</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="4242"><td class="num" id="LN4242">4242</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4243"><td class="num" id="LN4243">4243</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="4244"><td class="num" id="LN4244">4244</td><td class="line">gsm_manager_is_session_running (GsmManager *manager,</td></tr> +<tr class="codeline" data-linenumber="4245"><td class="num" id="LN4245">4245</td><td class="line"> gboolean *running,</td></tr> +<tr class="codeline" data-linenumber="4246"><td class="num" id="LN4246">4246</td><td class="line"> GError **error)</td></tr> +<tr class="codeline" data-linenumber="4247"><td class="num" id="LN4247">4247</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="4248"><td class="num" id="LN4248">4248</td><td class="line"> GsmManagerPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="4249"><td class="num" id="LN4249">4249</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4250"><td class="num" id="LN4250">4250</td><td class="line"> <span class='macro'>g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE)<span class='macro_popup'>do { if ((GSM_IS_MANAGER (manager))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "GSM_IS_MANAGER (manager)"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4251"><td class="num" id="LN4251">4251</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="4252"><td class="num" id="LN4252">4252</td><td class="line"> priv = gsm_manager_get_instance_private (manager);</td></tr> +<tr class="codeline" data-linenumber="4253"><td class="num" id="LN4253">4253</td><td class="line"> *running = (priv->phase == GSM_MANAGER_PHASE_RUNNING);</td></tr> +<tr class="codeline" data-linenumber="4254"><td class="num" id="LN4254">4254</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="4255"><td class="num" id="LN4255">4255</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/scanview.css b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/scanview.css new file mode 100644 index 0000000..cf8a5a6 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/scanview.css @@ -0,0 +1,62 @@ +body { color:#000000; background-color:#ffffff } +body { font-family: Helvetica, sans-serif; font-size:9pt } +h1 { font-size: 14pt; } +h2 { font-size: 12pt; } +table { font-size:9pt } +table { border-spacing: 0px; border: 1px solid black } +th, table thead { + background-color:#eee; color:#666666; + font-weight: bold; cursor: default; + text-align:center; + font-weight: bold; font-family: Verdana; + white-space:nowrap; +} +.W { font-size:0px } +th, td { padding:5px; padding-left:8px; text-align:left } +td.SUMM_DESC { padding-left:12px } +td.DESC { white-space:pre } +td.Q { text-align:right } +td { text-align:left } +tbody.scrollContent { overflow:auto } + +table.form_group { + background-color: #ccc; + border: 1px solid #333; + padding: 2px; +} + +table.form_inner_group { + background-color: #ccc; + border: 1px solid #333; + padding: 0px; +} + +table.form { + background-color: #999; + border: 1px solid #333; + padding: 2px; +} + +td.form_label { + text-align: right; + vertical-align: top; +} +/* For one line entires */ +td.form_clabel { + text-align: right; + vertical-align: center; +} +td.form_value { + text-align: left; + vertical-align: top; +} +td.form_submit { + text-align: right; + vertical-align: top; +} + +h1.SubmitFail { + color: #f00; +} +h1.SubmitOk { +} diff --git a/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/sorttable.js b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/sorttable.js new file mode 100644 index 0000000..32faa07 --- /dev/null +++ b/2024-08-21-191347-5925-1@e385b9f15829_gdbus-finish/sorttable.js @@ -0,0 +1,492 @@ +/* + SortTable + version 2 + 7th April 2007 + Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ + + Instructions: + Download this file + Add <script src="sorttable.js"></script> to your HTML + Add class="sortable" to any table you'd like to make sortable + Click on the headers to sort + + Thanks to many, many people for contributions and suggestions. + Licenced as X11: http://www.kryogenix.org/code/browser/licence.html + This basically means: do what you want with it. +*/ + + +var stIsIE = /*@cc_on!@*/false; + +sorttable = { + init: function() { + // quit if this function has already been called + if (arguments.callee.done) return; + // flag this function so we don't do the same thing twice + arguments.callee.done = true; + // kill the timer + if (_timer) clearInterval(_timer); + + if (!document.createElement || !document.getElementsByTagName) return; + + sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; + + forEach(document.getElementsByTagName('table'), function(table) { + if (table.className.search(/\bsortable\b/) != -1) { + sorttable.makeSortable(table); + } + }); + + }, + + makeSortable: function(table) { + if (table.getElementsByTagName('thead').length == 0) { + // table doesn't have a tHead. Since it should have, create one and + // put the first table row in it. + the = document.createElement('thead'); + the.appendChild(table.rows[0]); + table.insertBefore(the,table.firstChild); + } + // Safari doesn't support table.tHead, sigh + if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; + + if (table.tHead.rows.length != 1) return; // can't cope with two header rows + + // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as + // "total" rows, for example). This is B&R, since what you're supposed + // to do is put them in a tfoot. So, if there are sortbottom rows, + // for backward compatibility, move them to tfoot (creating it if needed). + sortbottomrows = []; + for (var i=0; i<table.rows.length; i++) { + if (table.rows[i].className.search(/\bsortbottom\b/) != -1) { + sortbottomrows[sortbottomrows.length] = table.rows[i]; + } + } + if (sortbottomrows) { + if (table.tFoot == null) { + // table doesn't have a tfoot. Create one. + tfo = document.createElement('tfoot'); + table.appendChild(tfo); + } + for (var i=0; i<sortbottomrows.length; i++) { + tfo.appendChild(sortbottomrows[i]); + } + delete sortbottomrows; + } + + // work through each column and calculate its type + headrow = table.tHead.rows[0].cells; + for (var i=0; i<headrow.length; i++) { + // manually override the type with a sorttable_type attribute + if (!headrow[i].className.match(/\bsorttable_nosort\b/)) { // skip this col + mtch = headrow[i].className.match(/\bsorttable_([a-z0-9]+)\b/); + if (mtch) { override = mtch[1]; } + if (mtch && typeof sorttable["sort_"+override] == 'function') { + headrow[i].sorttable_sortfunction = sorttable["sort_"+override]; + } else { + headrow[i].sorttable_sortfunction = sorttable.guessType(table,i); + } + // make it clickable to sort + headrow[i].sorttable_columnindex = i; + headrow[i].sorttable_tbody = table.tBodies[0]; + dean_addEvent(headrow[i],"click", function(e) { + + if (this.className.search(/\bsorttable_sorted\b/) != -1) { + // if we're already sorted by this column, just + // reverse the table, which is quicker + sorttable.reverse(this.sorttable_tbody); + this.className = this.className.replace('sorttable_sorted', + 'sorttable_sorted_reverse'); + this.removeChild(document.getElementById('sorttable_sortfwdind')); + sortrevind = document.createElement('span'); + sortrevind.id = "sorttable_sortrevind"; + sortrevind.innerHTML = stIsIE ? ' <font face="webdings">5</font>' : ' ▴'; + this.appendChild(sortrevind); + return; + } + if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { + // if we're already sorted by this column in reverse, just + // re-reverse the table, which is quicker + sorttable.reverse(this.sorttable_tbody); + this.className = this.className.replace('sorttable_sorted_reverse', + 'sorttable_sorted'); + this.removeChild(document.getElementById('sorttable_sortrevind')); + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾'; + this.appendChild(sortfwdind); + return; + } + + // remove sorttable_sorted classes + theadrow = this.parentNode; + forEach(theadrow.childNodes, function(cell) { + if (cell.nodeType == 1) { // an element + cell.className = cell.className.replace('sorttable_sorted_reverse',''); + cell.className = cell.className.replace('sorttable_sorted',''); + } + }); + sortfwdind = document.getElementById('sorttable_sortfwdind'); + if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } + sortrevind = document.getElementById('sorttable_sortrevind'); + if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } + + this.className += ' sorttable_sorted'; + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾'; + this.appendChild(sortfwdind); + + // build an array to sort. This is a Schwartzian transform thing, + // i.e., we "decorate" each row with the actual sort key, + // sort based on the sort keys, and then put the rows back in order + // which is a lot faster because you only do getInnerText once per row + row_array = []; + col = this.sorttable_columnindex; + rows = this.sorttable_tbody.rows; + for (var j=0; j<rows.length; j++) { + row_array[row_array.length] = [sorttable.getInnerText(rows[j].cells[col]), rows[j]]; + } + /* If you want a stable sort, uncomment the following line */ + sorttable.shaker_sort(row_array, this.sorttable_sortfunction); + /* and comment out this one */ + //row_array.sort(this.sorttable_sortfunction); + + tb = this.sorttable_tbody; + for (var j=0; j<row_array.length; j++) { + tb.appendChild(row_array[j][1]); + } + + delete row_array; + }); + } + } + }, + + guessType: function(table, column) { + // guess the type of a column based on its first non-blank row + sortfn = sorttable.sort_alpha; + for (var i=0; i<table.tBodies[0].rows.length; i++) { + text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]); + if (text != '') { + if (text.match(/^-?[�$�]?[\d,.]+%?$/)) { + return sorttable.sort_numeric; + } + // check for a date: dd/mm/yyyy or dd/mm/yy + // can have / or . or - as separator + // can be mm/dd as well + possdate = text.match(sorttable.DATE_RE) + if (possdate) { + // looks like a date + first = parseInt(possdate[1]); + second = parseInt(possdate[2]); + if (first > 12) { + // definitely dd/mm + return sorttable.sort_ddmm; + } else if (second > 12) { + return sorttable.sort_mmdd; + } else { + // looks like a date, but we can't tell which, so assume + // that it's dd/mm (English imperialism!) and keep looking + sortfn = sorttable.sort_ddmm; + } + } + } + } + return sortfn; + }, + + getInnerText: function(node) { + // gets the text we want to use for sorting for a cell. + // strips leading and trailing whitespace. + // this is *not* a generic getInnerText function; it's special to sorttable. + // for example, you can override the cell text with a customkey attribute. + // it also gets .value for <input> fields. + + hasInputs = (typeof node.getElementsByTagName == 'function') && + node.getElementsByTagName('input').length; + + if (node.getAttribute("sorttable_customkey") != null) { + return node.getAttribute("sorttable_customkey"); + } + else if (typeof node.textContent != 'undefined' && !hasInputs) { + return node.textContent.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.innerText != 'undefined' && !hasInputs) { + return node.innerText.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.text != 'undefined' && !hasInputs) { + return node.text.replace(/^\s+|\s+$/g, ''); + } + else { + switch (node.nodeType) { + case 3: + if (node.nodeName.toLowerCase() == 'input') { + return node.value.replace(/^\s+|\s+$/g, ''); + } + case 4: + return node.nodeValue.replace(/^\s+|\s+$/g, ''); + break; + case 1: + case 11: + var innerText = ''; + for (var i = 0; i < node.childNodes.length; i++) { + innerText += sorttable.getInnerText(node.childNodes[i]); + } + return innerText.replace(/^\s+|\s+$/g, ''); + break; + default: + return ''; + } + } + }, + + reverse: function(tbody) { + // reverse the rows in a tbody + newrows = []; + for (var i=0; i<tbody.rows.length; i++) { + newrows[newrows.length] = tbody.rows[i]; + } + for (var i=newrows.length-1; i>=0; i--) { + tbody.appendChild(newrows[i]); + } + delete newrows; + }, + + /* sort functions + each sort function takes two parameters, a and b + you are comparing a[0] and b[0] */ + sort_numeric: function(a,b) { + aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); + if (isNaN(aa)) aa = 0; + bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); + if (isNaN(bb)) bb = 0; + return aa-bb; + }, + sort_alpha: function(a,b) { + if (a[0]==b[0]) return 0; + if (a[0]<b[0]) return -1; + return 1; + }, + sort_ddmm: function(a,b) { + mtch = a[0].match(sorttable.DATE_RE); + y = mtch[3]; m = mtch[2]; d = mtch[1]; + if (m.length == 1) m = '0'+m; + if (d.length == 1) d = '0'+d; + dt1 = y+m+d; + mtch = b[0].match(sorttable.DATE_RE); + y = mtch[3]; m = mtch[2]; d = mtch[1]; + if (m.length == 1) m = '0'+m; + if (d.length == 1) d = '0'+d; + dt2 = y+m+d; + if (dt1==dt2) return 0; + if (dt1<dt2) return -1; + return 1; + }, + sort_mmdd: function(a,b) { + mtch = a[0].match(sorttable.DATE_RE); + y = mtch[3]; d = mtch[2]; m = mtch[1]; + if (m.length == 1) m = '0'+m; + if (d.length == 1) d = '0'+d; + dt1 = y+m+d; + mtch = b[0].match(sorttable.DATE_RE); + y = mtch[3]; d = mtch[2]; m = mtch[1]; + if (m.length == 1) m = '0'+m; + if (d.length == 1) d = '0'+d; + dt2 = y+m+d; + if (dt1==dt2) return 0; + if (dt1<dt2) return -1; + return 1; + }, + + shaker_sort: function(list, comp_func) { + // A stable sort function to allow multi-level sorting of data + // see: http://en.wikipedia.org/wiki/Cocktail_sort + // thanks to Joseph Nahmias + var b = 0; + var t = list.length - 1; + var swap = true; + + while(swap) { + swap = false; + for(var i = b; i < t; ++i) { + if ( comp_func(list[i], list[i+1]) > 0 ) { + var q = list[i]; list[i] = list[i+1]; list[i+1] = q; + swap = true; + } + } // for + t--; + + if (!swap) break; + + for(var i = t; i > b; --i) { + if ( comp_func(list[i], list[i-1]) < 0 ) { + var q = list[i]; list[i] = list[i-1]; list[i-1] = q; + swap = true; + } + } // for + b++; + + } // while(swap) + } +} + +/* ****************************************************************** + Supporting functions: bundled here to avoid depending on a library + ****************************************************************** */ + +// Dean Edwards/Matthias Miller/John Resig + +/* for Mozilla/Opera9 */ +if (document.addEventListener) { + document.addEventListener("DOMContentLoaded", sorttable.init, false); +} + +/* for Internet Explorer */ +/*@cc_on @*/ +/*@if (@_win32) + document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>"); + var script = document.getElementById("__ie_onload"); + script.onreadystatechange = function() { + if (this.readyState == "complete") { + sorttable.init(); // call the onload handler + } + }; +/*@end @*/ + +/* for Safari */ +if (/WebKit/i.test(navigator.userAgent)) { // sniff + var _timer = setInterval(function() { + if (/loaded|complete/.test(document.readyState)) { + sorttable.init(); // call the onload handler + } + }, 10); +} + +/* for other browsers */ +window.onload = sorttable.init; + +// written by Dean Edwards, 2005 +// with input from Tino Zijdel, Matthias Miller, Diego Perini + +// http://dean.edwards.name/weblog/2005/10/add-event/ + +function dean_addEvent(element, type, handler) { + if (element.addEventListener) { + element.addEventListener(type, handler, false); + } else { + // assign each event handler a unique ID + if (!handler.$$guid) handler.$$guid = dean_addEvent.guid++; + // create a hash table of event types for the element + if (!element.events) element.events = {}; + // create a hash table of event handlers for each element/event pair + var handlers = element.events[type]; + if (!handlers) { + handlers = element.events[type] = {}; + // store the existing event handler (if there is one) + if (element["on" + type]) { + handlers[0] = element["on" + type]; + } + } + // store the event handler in the hash table + handlers[handler.$$guid] = handler; + // assign a global event handler to do all the work + element["on" + type] = handleEvent; + } +}; +// a counter used to create unique IDs +dean_addEvent.guid = 1; + +function removeEvent(element, type, handler) { + if (element.removeEventListener) { + element.removeEventListener(type, handler, false); + } else { + // delete the event handler from the hash table + if (element.events && element.events[type]) { + delete element.events[type][handler.$$guid]; + } + } +}; + +function handleEvent(event) { + var returnValue = true; + // grab the event object (IE uses a global event object) + event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event); + // get a reference to the hash table of event handlers + var handlers = this.events[event.type]; + // execute each event handler + for (var i in handlers) { + this.$$handleEvent = handlers[i]; + if (this.$$handleEvent(event) === false) { + returnValue = false; + } + } + return returnValue; +}; + +function fixEvent(event) { + // add W3C standard event methods + event.preventDefault = fixEvent.preventDefault; + event.stopPropagation = fixEvent.stopPropagation; + return event; +}; +fixEvent.preventDefault = function() { + this.returnValue = false; +}; +fixEvent.stopPropagation = function() { + this.cancelBubble = true; +} + +// Dean's forEach: http://dean.edwards.name/base/forEach.js +/* + forEach, version 1.0 + Copyright 2006, Dean Edwards + License: http://www.opensource.org/licenses/mit-license.php +*/ + +// array-like enumeration +if (!Array.forEach) { // mozilla already supports this + Array.forEach = function(array, block, context) { + for (var i = 0; i < array.length; i++) { + block.call(context, array[i], i, array); + } + }; +} + +// generic enumeration +Function.prototype.forEach = function(object, block, context) { + for (var key in object) { + if (typeof this.prototype[key] == "undefined") { + block.call(context, object[key], key, object); + } + } +}; + +// character enumeration +String.forEach = function(string, block, context) { + Array.forEach(string.split(""), function(chr, index) { + block.call(context, chr, index, string); + }); +}; + +// globally resolve forEach enumeration +var forEach = function(object, block, context) { + if (object) { + var resolve = Object; // default + if (object instanceof Function) { + // functions have a "length" property + resolve = Function; + } else if (object.forEach instanceof Function) { + // the object implements a custom forEach method so use that + object.forEach(block, context); + return; + } else if (typeof object == "string") { + // the object is a string + resolve = String; + } else if (typeof object.length == "number") { + // the object is array-like + resolve = Array; + } + resolve.forEach(object, block, context); + } +}; |