如何移除碰觸邊界視窗自動放大功能 [論壇 - Ubuntu基本設定]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊



如何移除碰觸邊界視窗自動放大功能
會員二級
註冊日期:
2010/3/24 11:15
所屬群組:
已註冊使用者
等級: 4
HP : 0 / 85
MP : 10 / 3235
EXP: 40
離線
請教各位大大,

在 ubuntu 14.04 中,當滑鼠拖拉視窗碰觸到畫面上下左右邊界時,視窗就會自動放大(如附件)
請問是否有設定能關閉這個功能?

謝謝!

附件:



png  2016-04-08 12:19:26 的螢幕擷圖.png (945.79 KB)
19272_57073239cc086.png 1080X608 px

2016/4/8 12:20
應用擴展 工具箱
回覆: 如何移除碰觸邊界視窗自動放大功能
管理員
註冊日期:
2011/3/11 6:32
所屬群組:
討論區管理群
等級: 44
HP : 216 / 1084
MP : 1088 / 38120
EXP: 38
離線
changp 寫到:
在 ubuntu 14.04 中,當滑鼠拖拉視窗碰觸到畫面上下左右邊界時,視窗就會自動放大(如附件)
請問是否有設定能關閉這個功能?

此為由 Compiz 視窗管理員的 Grid 外掛功能所提供,停用該外掛功能即可

另外這個行為跟 Windows Aero Snap 相同就是

2016/4/8 12:48
本篇發表文章以「創用CC BY 3.0 或更新之台灣地區版本」授權條款釋出,如何使用敬請參考
 Creative Commons — 姓名標示 3.0 台灣 — CC BY 3.0 TW
 http://creativecommons.org/licenses/by/3.0/tw/

「你不懂的東西就不要亂講,被懂得人看破手腳就算了,騙不懂的人誤導別人,還要別人把你當成大師,這就真的是說不過去了。」
 by Allen Own
 出處 http://www.plurk.com/p/i4uogm

自由知識創作平台介紹
 https://docs.google.com/document/d/1MGG6lW_0qCgH4U785R-IwSc_INdoBGej1l-JxiA4gPE
如何建立新的自由知識創作平台文件
 https://docs.google.com/document/d/11NdzOW2lGYksfyQIcPMPye5tlmj1J0QTkgPTmQvIvKA
應用擴展 工具箱
回覆: 如何移除碰觸邊界視窗自動放大功能
會員二級
註冊日期:
2010/3/24 11:15
所屬群組:
已註冊使用者
等級: 4
HP : 0 / 85
MP : 10 / 3235
EXP: 40
離線
謝謝V字龍大大!

可以再請問若要從 gsettings 去設定停用,該如何執行?謝謝!

2016/4/8 14:22
應用擴展 工具箱
回覆: 如何移除碰觸邊界視窗自動放大功能
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 36
HP : 179 / 898
MP : 664 / 28634
EXP: 92
離線
changp 寫到:
謝謝V字龍大大!

可以再請問若要從 gsettings 去設定停用,該如何執行?謝謝!


## CLI 工具

執行


$ gsettings


顯示


Usage:
gsettings --version
gsettings [--schemadir SCHEMADIR] COMMAND [ARGS...]

Commands:
help Show this information
list-schemas List installed schemas
list-relocatable-schemas List relocatable schemas
list-keys List keys in a schema
list-children List children of a schema
list-recursively List keys and values, recursively
range Queries the range of a key
get Get the value of a key
set Set the value of a key
reset Reset the value of a key
reset-recursively Reset all values in a given schema
writable Check if a key is writable
monitor Watch for changes

Use 'gsettings help COMMAND' to get detailed help.




執行


$ gsettings list-relocatable-schemas | grep org.compiz




執行


$ gsettings list-keys org.compiz.core:/ | grep active-plugins




執行


$ gsettings get org.compiz.core:/ active-plugins



顯示


['core', 'composite', 'opengl', 'compiztoolbox', 'decor', 'vpswitch', 'snap', 'mousepoll', 'resize', 'place', 'move', 'wall', 'grid', 'regex', 'imgpng', 'session', 'gnomecompat', 'animation', 'fade', 'unitymtgrabhandles', 'workarounds', 'scale', 'expo', 'ezoom', 'unityshell']




執行 (下面的是把上面的複製下來,然後把「'grid'」拿掉。)


$ gsettings set org.compiz.core:/ active-plugins "['core', 'composite', 'opengl', 'compiztoolbox', 'decor', 'vpswitch', 'snap', 'mousepoll', 'resize', 'place', 'move', 'wall', 'regex', 'imgpng', 'session', 'gnomecompat', 'animation', 'fade', 'unitymtgrabhandles', 'workarounds', 'scale', 'expo', 'ezoom', 'unityshell']"




上面這個指令有錯,要改成下面這個


$ gsettings setorg.compiz.core:/org/compiz/profiles/unity/plugins/core/ active-plugins "['core', 'composite', 'opengl', 'compiztoolbox', 'decor', 'vpswitch', 'snap', 'mousepoll', 'resize', 'place', 'move', 'wall', 'regex', 'imgpng', 'session', 'gnomecompat', 'animation', 'fade', 'unitymtgrabhandles', 'workarounds', 'scale', 'expo', 'ezoom', 'unityshell']"



請參考下面的「回覆討論」。




恢復預設值


$ gsettings reset org.compiz.core:/ active-plugins





## 相關的檔案

* /usr/share/glib-2.0/schemas/org.compiz.core.gschema.xml
* /usr/share/glib-2.0/schemas/10_compiz-gnome.gschema.override

## 參考文章

V字龍 寫到:
changp 寫到:
在 ubuntu 14.04 中,當滑鼠拖拉視窗碰觸到畫面上下左右邊界時,視窗就會自動放大(如附件)
請問是否有設定能關閉這個功能?

此為由 Compiz 視窗管理員的 Grid 外掛功能所提供,停用該外掛功能即可

另外這個行為跟 Windows Aero Snap 相同就是


* 依據「V字龍」給的「關鍵字」,查詢「unity grid snap ubuntu」 。
* Customize Ubuntu 15.04 – Top 20 Awesome Tips to Customize Ubuntu 15.04
* 查詢「gsetting org.compiz.core
* Arch Wiki / Compiz configuration / 6.2 GSettings configuration / 6.2.1 Enabling or disabling a Compiz plugin using GSettings
* 以前關於「gsettings」的使用討論串


## GUI 工具


安裝「unity-tweak-tool


$ sudo apt-get install unity-tweak-tool



執行「unity-tweak-tool


$ unity-tweak-tool




在「Window Manage / Window Snapping」的第一個選項「Genernal / Window Snapping」」 那裡就可以切換


一開始我是追這個程式的原始碼,是python寫的,
後來為了對照「gsettings」的用法,才找到「Arch Wiki」那篇文章。

以下簡易紀錄追綜的步驟

下載套件


$ apt-get download unity-tweak-tool



解開套件


$ dpkg -x unity-tweak-tool_0.0.6ubuntu1_all.deb unity-tweak-tool




查詢「snapping」


$ grep snapping unity-tweak-tool/* -R



可以找到一個檔「unity-tweak-tool/usr/lib/python3/dist-packages/UnityTweakTool/section/spaghetti/compiz.py

裡面有一段


def on_sw_window_snapping_active_notify(self, widget, udata=None):

plugins = gsettings.core.get_strv('active-plugins')
if self.ui['sw_window_snapping'].get_active() == True:
if 'grid' not in plugins:
plugins.append('grid')
gsettings.core.set_strv('active-plugins', plugins)
else:
if 'grid' in plugins:
plugins.remove('grid')
gsettings.core.set_strv('active-plugins', plugins)


另外查詢「on_sw_window_snapping_active_notify」
可以找到另一個檔「unity-tweak-tool/usr/share/unity-tweak-tool/windowmanager.ui


$ grep on_sw_window_snapping_active_notify unity-tweak-tool/* -R




## API

* Gio.Settings.set_strv

2016/4/8 17:14
應用擴展 工具箱
回覆: 如何移除碰觸邊界視窗自動放大功能
會員二級
註冊日期:
2010/3/24 11:15
所屬群組:
已註冊使用者
等級: 4
HP : 0 / 85
MP : 10 / 3235
EXP: 40
離線
我執行了下面的 command ,但結果還是不變...

$ gsettings set org.compiz.core:/ active-plugins "['core', 'composite', 'opengl', 'compiztoolbox', 'decor', 'vpswitch', 'snap', 'mousepoll', 'resize', 'place', 'move', 'wall', 'regex', 'imgpng', 'session', 'gnomecompat', 'animation', 'fade', 'unitymtgrabhandles', 'workarounds', 'scale', 'expo', 'ezoom', 'unityshell']"

2016/4/8 18:04
應用擴展 工具箱
回覆: 如何移除碰觸邊界視窗自動放大功能
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 36
HP : 179 / 898
MP : 664 / 28634
EXP: 92
離線
changp 寫到:
我執行了下面的 command ,但結果還是不變...

$ gsettings set org.compiz.core:/ active-plugins "['core', 'composite', 'opengl', 'compiztoolbox', 'decor', 'vpswitch', 'snap', 'mousepoll', 'resize', 'place', 'move', 'wall', 'regex', 'imgpng', 'session', 'gnomecompat', 'animation', 'fade', 'unitymtgrabhandles', 'workarounds', 'scale', 'expo', 'ezoom', 'unityshell']"


嗯,我剛剛重測一遍,
用gsettings改,沒有反應,
unity-tweak-tool則有

對不起,我要再研究看看,要下什麼指令才有反應,或是哪個步驟出錯

Orz...

2016/4/8 18:23
應用擴展 工具箱
回覆: 如何移除碰觸邊界視窗自動放大功能
會員二級
註冊日期:
2010/3/24 11:15
所屬群組:
已註冊使用者
等級: 4
HP : 0 / 85
MP : 10 / 3235
EXP: 40
離線
samwhelp 大大

我後來試了以下這個,結果是可以的

gsettings set org.compiz.core:/org/compiz/profiles/unity/plugins/core/ active-plugins "['core', 'composite', 'opengl', 'compiztoolbox', 'decor', 'vpswitch', 'snap', 'mousepoll', 'resize', 'place', 'move', 'wall', 'regex', 'imgpng', 'session', 'gnomecompat', 'animation', 'fade', 'unitymtgrabhandles', 'workarounds', 'scale', 'expo', 'ezoom', 'unityshell']"


非常感謝!!

2016/4/8 18:29
應用擴展 工具箱
回覆: 如何移除碰觸邊界視窗自動放大功能
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 36
HP : 179 / 898
MP : 664 / 28634
EXP: 92
離線
changp 寫到:
samwhelp 大大

我後來試了以下這個,結果是可以的

gsettings set org.compiz.core:/org/compiz/profiles/unity/plugins/core/ active-plugins "['core', 'composite', 'opengl', 'compiztoolbox', 'decor', 'vpswitch', 'snap', 'mousepoll', 'resize', 'place', 'move', 'wall', 'regex', 'imgpng', 'session', 'gnomecompat', 'animation', 'fade', 'unitymtgrabhandles', 'workarounds', 'scale', 'expo', 'ezoom', 'unityshell']"


非常感謝!!



嗯嗯!我再重新看了Arch Wiki那篇,是要先找到profile


$ gsettings list-recursively org.compiz | grep current-profile



就會顯示


org.compiz current-profile 'unity'



然後就是你提的,可以work的指令了

差別在「path」


org.compiz.core:/org/compiz/profiles/unity/plugins/core/



原本我寫的


org.compiz.core:/



我也要感謝你拉,有你的提問,讓我有這個機緣,可以學會這個用法
還有感謝「V字龍」的提示。

感恩,我可以去吃飯了



## 相關檔案

* /usr/share/glib-2.0/schemas/org.compiz.gschema.xml

## 後記

對「gsettings」的「path」的概念,還不是很了解,所以研究了一下「GSettings

要先從區分「Relocatable schemas」和「Not Relocatable schemas」開始,

從「GSettings」這一頁找尋「Relocatable schemas」,可以找到下面一段敘述


Relocatable schemas

A relocatable schema is one with no path attribute specified on its <schema> element. By using g_settings_new_with_path(), a GSettings object can be instantiated for a relocatable schema, assigning a path to the instance. Paths passed to g_settings_new_with_path() will typically be constructed dynamically from a constant prefix plus some form of instance identifier; but they must still be valid GSettings paths. Paths could also be constant and used with a globally installed schema originating from a dependency library.



注意這一句


A relocatable schema is one with no path attribute specified on its <schema> element.



以下驗證

### not relocatable schema

執行


$ gsettings list-schemas | grep org.compiz



顯示


org.compiz.gwd
org.compiz
org.compiz.integrated



執行


$ grep 'path=' /usr/share/glib-2.0/schemas/org.compiz.*.xml



顯示


/usr/share/glib-2.0/schemas/org.compiz.gschema.xml: <schema id="org.compiz" path="/org/compiz/" gettext-domain="compiz">
/usr/share/glib-2.0/schemas/org.compiz.gwd.gschema.xml: <schema id="org.compiz.gwd" path="/org/compiz/gwd/" gettext-domain="compiz">
/usr/share/glib-2.0/schemas/org.compiz.integrated.gschema.xml: <schema path="/org/compiz/integrated/" id="org.compiz.integrated">



執行


$ gsettings get org.compiz current-profile



會正常顯示


'Default'



但若執行下面的指令(schema加了path)


$ gsettings get org.compiz:/ current-profile



就會顯示下面的提示訊息


Schema 'org.compiz' is not relocatable (path must not be specified)



對照上面的「/usr/share/glib-2.0/schemas/org.compiz.gschema.xml: <schema id="org.compiz" path="/org/compiz/" gettext-domain="compiz">」

有「path="/org/compiz/"」,所以「org.compiz」不是「relocatable」


### relocatable schema

執行


$ gsettings list-relocatable-schemas | grep org.compiz




顯示


org.compiz.session
org.compiz.scaleaddon
org.compiz.core
...略...


執行


$ gsettings get org.compiz.core:/ active-plugins



會正常顯示


[ 'core', 'composite', 'opengl', 'compiztoolbox', 'decor', 'vpswitch', 'snap', 'mousepoll', 'resize', 'place', 'move', 'wall', 'grid', 'regex', 'imgpng', 'session', 'gnomecompat', 'animation', 'fade', 'unitymtgrabhandles', 'workarounds', 'scale', 'expo', 'ezoom', 'unityshell' ]



若執行


$ gsettings get org.compiz.core:/ active-plugins



則會出現提示訊息


Schema 'org.compiz.core' is relocatable (path must be specified)



也就是說「org.compiz.core」是「relocatable schema」

可以觀察「/usr/share/glib-2.0/schemas/org.compiz.core.gschema.xml」這個檔


$ grep 'id=' /usr/share/glib-2.0/schemas/org.compiz.core.gschema.xml



顯示


<schema id="org.compiz.core" gettext-domain="compiz">


並沒有「path=""」的屬性,所以「org.compiz.core」是「relocatable schema」。


### 小結

至於 「gsettings set org.compiz.core:/org/compiz/profiles/unity/plugins/core/」
後面這一段「/org/compiz/profiles/unity/plugins/core/」的path寫法規則,
我初步猜測,應該是要依照該程式寫的規則,可以再去閱讀上面「Relocatable schemas」那一段說明。(後記:連同下面的「dconf」就可以拼湊出概念)。
或是研究「compiz」的原始碼,我目前還沒找到「compiz」是否有文件紀錄這一段,只有從「Arch Wiki」那看到規則。

以下是下載「compiz」「source package」的指令


$ apt-get source compiz



待研究...


另外在「unity-tweak-tool/usr/lib/python3/dist-packages/UnityTweakTool/section/spaghetti/gsettings.py」,
有一段程式碼,就有這樣的規則,


def plugin(plugin):
schema = 'org.compiz.'+plugin
path = '/org/compiz/profiles/unity/plugins/'+plugin+'/'
test_schema(schema)
return Gio.Settings(schema = schema, path = path)



## dconf

從「這一頁」可以看到,gsetting,可以使用不同的「backend」,來儲存這些設定,目前系統應該是使用「dconf」來儲存。

可以測試下面的指令,



$ dconf list /org/compiz/



然後按下「tab」,就可以找到上面說的「path」

可以找到「/org/compiz/profiles/unity/plugins/core/」

## 更多參考

* https://wiki.gnome.org/Projects/dconf
* https://wiki.gnome.org/Projects/dconf/SystemAdministrators
* https://developer.gnome.org/GSettings/
* https://developer.gnome.org/gio/stable/GSettings.html
* https://developer.gnome.org/gio/stable/gsettings-tool.html
* https://developer.gnome.org/gio/stable/glib-compile-schemas.html
* https://developer.gnome.org/gio/stable/ch34s06.html
* Vala Settings Sample

## 相關檔案

* ~/.config/dconf/user
* /usr/share/glib-2.0/schemas/
* /usr/share/glib-2.0/schemas/gschemas.compiled

## 相關指令

* dconf
* gsettings
* glib-compile-schemas

2016/4/8 18:47
應用擴展 工具箱


 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.