177
notify_cb (const char *name, const char *channel_name, McsAction action, McsSetting * setting, void *data)
181
set_placement_mode (ScreenInfo *screen_info, const char *value)
179
ScreenInfo *screen_info;
181
screen_info = (ScreenInfo *) data;
182
183
g_return_if_fail (screen_info != NULL);
184
if (!g_ascii_strcasecmp (CHANNEL1, channel_name))
189
/* The following is to reduce initial startup time and reload */
190
if (!screen_info->mcs_initted)
194
case MCS_ACTION_CHANGED:
195
if (setting->type == MCS_TYPE_INT)
197
if (!strcmp (name, "Xfwm/BoxMove"))
199
screen_info->params->box_move = setting->data.v_int;
201
else if (!strcmp (name, "Xfwm/BoxResize"))
203
screen_info->params->box_resize = setting->data.v_int;
205
else if (!strcmp (name, "Xfwm/ClickToFocus"))
207
screen_info->params->click_to_focus = setting->data.v_int;
208
update_grabs (screen_info);
210
else if (!strcmp (name, "Xfwm/FocusNewWindow"))
212
screen_info->params->focus_new = setting->data.v_int;
214
else if (!strcmp (name, "Xfwm/FocusRaise"))
216
screen_info->params->raise_on_focus = setting->data.v_int;
218
else if (!strcmp (name, "Xfwm/RaiseDelay"))
220
screen_info->params->raise_delay = setting->data.v_int;
222
else if (!strcmp (name, "Xfwm/RaiseOnClick"))
224
screen_info->params->raise_on_click = setting->data.v_int;
225
update_grabs (screen_info);
227
else if (!strcmp (name, "Xfwm/SnapToBorder"))
229
screen_info->params->snap_to_border = setting->data.v_int;
231
else if (!strcmp (name, "Xfwm/SnapToWindows"))
233
screen_info->params->snap_to_windows = setting->data.v_int;
235
else if (!strcmp (name, "Xfwm/SnapWidth"))
237
screen_info->params->snap_width = setting->data.v_int;
239
else if (!strcmp (name, "Xfwm/WrapWorkspaces"))
241
screen_info->params->wrap_workspaces = setting->data.v_int;
242
placeSidewalks (screen_info, screen_info->params->wrap_workspaces);
244
else if (!strcmp (name, "Xfwm/WrapWindows"))
246
screen_info->params->wrap_windows = setting->data.v_int;
248
else if (!strcmp (name, "Xfwm/WrapResistance"))
250
screen_info->params->wrap_resistance = setting->data.v_int;
253
else if (setting->type == MCS_TYPE_STRING)
255
if (!strcmp (name, "Xfwm/DblClickAction"))
257
reloadScreenSettings (screen_info, NO_UPDATE_FLAG);
259
else if (!strcmp (name, "Xfwm/ThemeName"))
261
reloadScreenSettings (screen_info, UPDATE_MAXIMIZE | UPDATE_GRAVITY | UPDATE_CACHE);
263
else if (!strcmp (name, "Xfwm/ButtonLayout"))
265
reloadScreenSettings (screen_info, UPDATE_FRAME | UPDATE_CACHE);
267
if (!strcmp (name, "Xfwm/TitleAlign"))
269
reloadScreenSettings (screen_info, UPDATE_FRAME | UPDATE_CACHE);
271
if (!strcmp (name, "Xfwm/TitleFont"))
273
reloadScreenSettings (screen_info, UPDATE_FRAME | UPDATE_CACHE);
277
case MCS_ACTION_DELETED:
282
else if (!g_ascii_strcasecmp (CHANNEL2, channel_name))
287
/* The following is to reduce initial startup time and reloads */
288
if (!screen_info->mcs_initted)
292
case MCS_ACTION_CHANGED:
293
if (setting->type == MCS_TYPE_INT)
295
if (!strcmp (name, "Xfwm/LeftMargin"))
297
set_settings_margin (screen_info, STRUTS_LEFT, setting->data.v_int);
299
else if (!strcmp (name, "Xfwm/RightMargin"))
301
set_settings_margin (screen_info, STRUTS_RIGHT, setting->data.v_int);
303
else if (!strcmp (name, "Xfwm/BottomMargin"))
305
set_settings_margin (screen_info, STRUTS_BOTTOM, setting->data.v_int);
307
else if (!strcmp (name, "Xfwm/TopMargin"))
309
set_settings_margin (screen_info, STRUTS_TOP, setting->data.v_int);
313
case MCS_ACTION_DELETED:
318
else if (!g_ascii_strcasecmp (CHANNEL3, channel_name))
323
/* The following is to reduce initial startup time and reloads */
324
if (!screen_info->mcs_initted)
328
case MCS_ACTION_CHANGED:
329
if (setting->type == MCS_TYPE_INT)
331
if (!strcmp (name, "Xfwm/WorkspaceCount"))
333
workspaceSetCount(screen_info, setting->data.v_int);
337
case MCS_ACTION_DELETED:
342
else if (!g_ascii_strcasecmp (CHANNEL4, channel_name))
347
/* The following is to reduce initial startup time and reloads */
348
if (!screen_info->mcs_initted)
352
case MCS_ACTION_CHANGED:
353
if (setting->type == MCS_TYPE_STRING)
355
if (!strcmp (name, "Xfwm/KeyThemeName"))
357
reloadScreenSettings (screen_info, NO_UPDATE_FLAG);
361
case MCS_ACTION_DELETED:
366
else if (!g_ascii_strcasecmp (CHANNEL5, channel_name))
371
/* The following is to reduce initial startup time and reloads */
372
if (!screen_info->mcs_initted)
376
case MCS_ACTION_CHANGED:
377
if (setting->type == MCS_TYPE_INT)
379
if (!strcmp (name, "Xfwm/BorderlessMaximize"))
381
screen_info->params->borderless_maximize = setting->data.v_int;
382
reloadScreenSettings (screen_info, UPDATE_MAXIMIZE);
384
else if (!strcmp (name, "Xfwm/CycleMinimum"))
386
screen_info->params->cycle_minimum = setting->data.v_int;
388
else if (!strcmp (name, "Xfwm/CycleHidden"))
390
screen_info->params->cycle_hidden = setting->data.v_int;
392
else if (!strcmp (name, "Xfwm/CycleWorkspaces"))
394
screen_info->params->cycle_workspaces = setting->data.v_int;
396
else if (!strcmp (name, "Xfwm/FocusHint"))
398
screen_info->params->focus_hint = setting->data.v_int;
400
else if (!strcmp (name, "Xfwm/FrameOpacity"))
402
screen_info->params->frame_opacity = setting->data.v_int;
403
reloadScreenSettings (screen_info, UPDATE_FRAME);
405
else if (!strcmp (name, "Xfwm/InactiveOpacity"))
407
screen_info->params->inactive_opacity = setting->data.v_int;
408
reloadScreenSettings (screen_info, UPDATE_FRAME);
409
clientUpdateOpacity (screen_info, clientGetFocus ());
411
else if (!strcmp (name, "Xfwm/MoveOpacity"))
413
screen_info->params->move_opacity = setting->data.v_int;
415
else if (!strcmp (name, "Xfwm/ResizeOpacity"))
417
screen_info->params->resize_opacity = setting->data.v_int;
419
else if (!strcmp (name, "Xfwm/PopupOpacity"))
421
screen_info->params->popup_opacity = setting->data.v_int;
422
reloadScreenSettings (screen_info, UPDATE_FRAME);
424
else if (!strcmp (name, "Xfwm/PlacementRatio"))
426
screen_info->params->placement_ratio = setting->data.v_int;
428
else if (!strcmp (name, "Xfwm/ShowFrameShadow"))
430
screen_info->params->show_frame_shadow = setting->data.v_int;
431
reloadScreenSettings (screen_info, UPDATE_FRAME);
433
else if (!strcmp (name, "Xfwm/ShowPopupShadow"))
435
screen_info->params->show_popup_shadow = setting->data.v_int;
436
reloadScreenSettings (screen_info, UPDATE_FRAME);
438
else if (!strcmp (name, "Xfwm/SnapResist"))
440
screen_info->params->snap_resist = setting->data.v_int;
442
else if (!strcmp (name, "Xfwm/PreventFocusStealing"))
444
screen_info->params->prevent_focus_stealing = setting->data.v_int;
446
else if (!strcmp (name, "Xfwm/RaiseWithAnyButton"))
448
screen_info->params->raise_with_any_button = setting->data.v_int;
449
update_grabs (screen_info);
451
else if (!strcmp (name, "Xfwm/RestoreOnMove"))
453
screen_info->params->restore_on_move = setting->data.v_int;
455
else if (!strcmp (name, "Xfwm/ScrollWorkspaces"))
457
screen_info->params->scroll_workspaces = setting->data.v_int;
459
else if (!strcmp (name, "Xfwm/ToggleWorkspaces"))
461
screen_info->params->toggle_workspaces = setting->data.v_int;
463
else if (!strcmp (name, "Xfwm/UnredirectOverlays"))
465
screen_info->params->unredirect_overlays = setting->data.v_int;
467
else if (!strcmp (name, "Xfwm/UseCompositing"))
469
screen_info->params->use_compositing = setting->data.v_int;
470
compositorActivateScreen (screen_info,
471
screen_info->params->use_compositing);
473
else if (!strcmp (name, "Xfwm/WrapLayout"))
475
screen_info->params->wrap_layout = setting->data.v_int;
477
else if (!strcmp (name, "Xfwm/WrapCycle"))
479
screen_info->params->wrap_cycle = setting->data.v_int;
482
else if (setting->type == MCS_TYPE_STRING)
484
if (!strcmp (name, "Xfwm/EasyClick"))
486
reloadScreenSettings (screen_info, UPDATE_BUTTON_GRABS);
488
else if (!strcmp (name, "Xfwm/ActivateAction"))
490
set_activate_action (screen_info, setting->data.v_string);
494
case MCS_ACTION_DELETED:
501
static GdkFilterReturn
502
client_event_filter (GdkXEvent * xevent, GdkEvent * event, gpointer data)
504
ScreenInfo *screen_info;
506
screen_info = (ScreenInfo *) data;
507
g_return_val_if_fail (screen_info != NULL, GDK_FILTER_CONTINUE);
509
if (mcs_client_process_event (screen_info->mcs_client, (XEvent *) xevent))
511
return GDK_FILTER_REMOVE;
515
return GDK_FILTER_CONTINUE;
520
watch_cb (Window window, Bool is_start, long mask, void *cb_data)
524
gdkwin = gdk_window_lookup (window);
530
gdkwin = gdk_window_foreign_new (window);
534
g_object_ref (gdkwin);
536
gdk_window_add_filter (gdkwin, client_event_filter, cb_data);
541
gdk_window_remove_filter (gdkwin, client_event_filter, cb_data);
542
g_object_unref (gdkwin);
184
g_return_if_fail (value != NULL);
186
if (!g_ascii_strcasecmp ("mouse", value))
188
screen_info->params->placement_mode = PLACE_MOUSE;
192
screen_info->params->placement_mode = PLACE_CENTER;
582
loadMcsData (ScreenInfo *screen_info, Settings *rc)
214
loadXfconfData (ScreenInfo *screen_info, Settings *rc)
586
if (screen_info->mcs_client)
217
for (i = XPM_COLOR_SYMBOL_SIZE; rc[i].option; ++i)
588
/* "Regular" channel */
589
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/ClickToFocus", CHANNEL1,
590
&setting) == MCS_SUCCESS)
592
setBooleanValueFromInt ("click_to_focus", setting->data.v_int, rc);
593
mcs_setting_free (setting);
595
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/FocusNewWindow", CHANNEL1,
596
&setting) == MCS_SUCCESS)
598
setBooleanValueFromInt ("focus_new", setting->data.v_int, rc);
599
mcs_setting_free (setting);
601
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/FocusRaise", CHANNEL1,
602
&setting) == MCS_SUCCESS)
604
setBooleanValueFromInt ("raise_on_focus", setting->data.v_int, rc);
605
mcs_setting_free (setting);
607
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/RaiseDelay", CHANNEL1,
608
&setting) == MCS_SUCCESS)
610
setIntValueFromInt ("raise_delay", setting->data.v_int, rc);
611
mcs_setting_free (setting);
613
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/RaiseOnClick", CHANNEL1,
614
&setting) == MCS_SUCCESS)
616
setBooleanValueFromInt ("raise_on_click", setting->data.v_int, rc);
617
mcs_setting_free (setting);
619
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/SnapToBorder", CHANNEL1,
620
&setting) == MCS_SUCCESS)
622
setBooleanValueFromInt ("snap_to_border", setting->data.v_int, rc);
623
mcs_setting_free (setting);
625
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/SnapToWindows", CHANNEL1,
626
&setting) == MCS_SUCCESS)
628
setBooleanValueFromInt ("snap_to_windows", setting->data.v_int, rc);
629
mcs_setting_free (setting);
631
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/SnapWidth", CHANNEL1,
632
&setting) == MCS_SUCCESS)
634
setIntValueFromInt ("snap_width", setting->data.v_int, rc);
635
mcs_setting_free (setting);
637
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/WrapWorkspaces", CHANNEL1,
638
&setting) == MCS_SUCCESS)
640
setBooleanValueFromInt ("wrap_workspaces", setting->data.v_int, rc);
641
mcs_setting_free (setting);
643
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/WrapWindows", CHANNEL1,
644
&setting) == MCS_SUCCESS)
646
setBooleanValueFromInt ("wrap_windows", setting->data.v_int, rc);
647
mcs_setting_free (setting);
649
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/WrapResistance", CHANNEL1,
650
&setting) == MCS_SUCCESS)
652
setIntValueFromInt ("wrap_resistance", setting->data.v_int, rc);
653
mcs_setting_free (setting);
655
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/BoxMove", CHANNEL1,
656
&setting) == MCS_SUCCESS)
658
setBooleanValueFromInt ("box_move", setting->data.v_int, rc);
659
mcs_setting_free (setting);
661
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/BoxResize", CHANNEL1,
662
&setting) == MCS_SUCCESS)
664
setBooleanValueFromInt ("box_resize", setting->data.v_int, rc);
665
mcs_setting_free (setting);
667
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/DblClickAction", CHANNEL1,
668
&setting) == MCS_SUCCESS)
670
setValue ("double_click_action", setting->data.v_string, rc);
671
mcs_setting_free (setting);
673
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/ThemeName", CHANNEL1,
674
&setting) == MCS_SUCCESS)
676
setValue ("theme", setting->data.v_string, rc);
677
mcs_setting_free (setting);
679
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/ButtonLayout", CHANNEL1,
680
&setting) == MCS_SUCCESS)
682
setValue ("button_layout", setting->data.v_string, rc);
683
mcs_setting_free (setting);
685
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/TitleAlign", CHANNEL1,
686
&setting) == MCS_SUCCESS)
688
setValue ("title_alignment", setting->data.v_string, rc);
689
mcs_setting_free (setting);
691
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/TitleFont", CHANNEL1,
692
&setting) == MCS_SUCCESS)
694
setValue ("title_font", setting->data.v_string, rc);
695
mcs_setting_free (setting);
698
/* Margins channel */
699
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/LeftMargin", CHANNEL2,
700
&setting) == MCS_SUCCESS)
702
setIntValueFromInt ("margin_left", setting->data.v_int, rc);
703
mcs_setting_free (setting);
705
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/RightMargin", CHANNEL2,
706
&setting) == MCS_SUCCESS)
708
setIntValueFromInt ("margin_right", setting->data.v_int, rc);
709
mcs_setting_free (setting);
711
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/BottomMargin", CHANNEL2,
712
&setting) == MCS_SUCCESS)
714
setIntValueFromInt ("margin_bottom", setting->data.v_int, rc);
715
mcs_setting_free (setting);
717
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/TopMargin", CHANNEL2,
718
&setting) == MCS_SUCCESS)
720
setIntValueFromInt ("margin_top", setting->data.v_int, rc);
721
mcs_setting_free (setting);
724
/* Workspaces channel */
725
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/WorkspaceCount", CHANNEL3,
726
&setting) == MCS_SUCCESS)
728
setIntValueFromInt ("workspace_count", setting->data.v_int, rc);
729
mcs_setting_free (setting);
732
/* Keyboard theme channel */
733
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/KeyThemeName", CHANNEL4,
734
&setting) == MCS_SUCCESS)
736
setValue ("keytheme", setting->data.v_string, rc);
737
mcs_setting_free (setting);
741
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/ActivateAction", CHANNEL5,
742
&setting) == MCS_SUCCESS)
744
setValue ("activate_action", setting->data.v_string, rc);
745
mcs_setting_free (setting);
747
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/BorderlessMaximize", CHANNEL5,
748
&setting) == MCS_SUCCESS)
750
setBooleanValueFromInt ("borderless_maximize", setting->data.v_int, rc);
751
mcs_setting_free (setting);
753
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/CycleMinimum", CHANNEL5,
754
&setting) == MCS_SUCCESS)
756
setBooleanValueFromInt ("cycle_minimum", setting->data.v_int, rc);
757
mcs_setting_free (setting);
759
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/CycleHidden", CHANNEL5,
760
&setting) == MCS_SUCCESS)
762
setBooleanValueFromInt ("cycle_hidden", setting->data.v_int, rc);
763
mcs_setting_free (setting);
765
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/CycleWorkspaces", CHANNEL5,
766
&setting) == MCS_SUCCESS)
768
setBooleanValueFromInt ("cycle_workspaces", setting->data.v_int, rc);
769
mcs_setting_free (setting);
771
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/EasyClick", CHANNEL5,
772
&setting) == MCS_SUCCESS)
774
setValue ("easy_click", setting->data.v_string, rc);
775
mcs_setting_free (setting);
777
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/FocusHint", CHANNEL5,
778
&setting) == MCS_SUCCESS)
780
setBooleanValueFromInt ("focus_hint", setting->data.v_int, rc);
781
mcs_setting_free (setting);
783
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/FrameOpacity", CHANNEL5,
784
&setting) == MCS_SUCCESS)
786
setIntValueFromInt ("frame_opacity", setting->data.v_int, rc);
787
mcs_setting_free (setting);
789
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/PlacementRatio", CHANNEL5,
790
&setting) == MCS_SUCCESS)
792
setIntValueFromInt ("placement_ratio", setting->data.v_int, rc);
793
mcs_setting_free (setting);
795
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/InactiveOpacity", CHANNEL5,
796
&setting) == MCS_SUCCESS)
798
setIntValueFromInt ("inactive_opacity", setting->data.v_int, rc);
799
mcs_setting_free (setting);
801
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/MoveOpacity", CHANNEL5,
802
&setting) == MCS_SUCCESS)
804
setIntValueFromInt ("move_opacity", setting->data.v_int, rc);
805
mcs_setting_free (setting);
807
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/ResizeOpacity", CHANNEL5,
808
&setting) == MCS_SUCCESS)
810
setIntValueFromInt ("resize_opacity", setting->data.v_int, rc);
811
mcs_setting_free (setting);
813
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/PopupOpacity", CHANNEL5,
814
&setting) == MCS_SUCCESS)
816
setIntValueFromInt ("popup_opacity", setting->data.v_int, rc);
817
mcs_setting_free (setting);
819
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/ShowFrameShadow", CHANNEL5,
820
&setting) == MCS_SUCCESS)
822
setBooleanValueFromInt ("show_frame_shadow", setting->data.v_int, rc);
823
mcs_setting_free (setting);
825
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/ShowPopupShadow", CHANNEL5,
826
&setting) == MCS_SUCCESS)
828
setBooleanValueFromInt ("show_popup_shadow", setting->data.v_int, rc);
829
mcs_setting_free (setting);
831
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/SnapResist", CHANNEL5,
832
&setting) == MCS_SUCCESS)
834
setBooleanValueFromInt ("snap_resist", setting->data.v_int, rc);
835
mcs_setting_free (setting);
837
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/PreventFocusStealing", CHANNEL5,
838
&setting) == MCS_SUCCESS)
840
setBooleanValueFromInt ("prevent_focus_stealing", setting->data.v_int, rc);
841
mcs_setting_free (setting);
843
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/RaiseWithAnyButton", CHANNEL5,
844
&setting) == MCS_SUCCESS)
846
setBooleanValueFromInt ("raise_with_any_button", setting->data.v_int, rc);
847
mcs_setting_free (setting);
849
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/RestoreOnMove", CHANNEL5,
850
&setting) == MCS_SUCCESS)
852
setBooleanValueFromInt ("restore_on_move", setting->data.v_int, rc);
853
mcs_setting_free (setting);
855
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/ScrollWorkspaces", CHANNEL5,
856
&setting) == MCS_SUCCESS)
858
setBooleanValueFromInt ("scroll_workspaces", setting->data.v_int, rc);
859
mcs_setting_free (setting);
861
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/ToggleWorkspaces", CHANNEL5,
862
&setting) == MCS_SUCCESS)
864
setBooleanValueFromInt ("toggle_workspaces", setting->data.v_int, rc);
865
mcs_setting_free (setting);
867
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/UnredirectOverlays", CHANNEL5,
868
&setting) == MCS_SUCCESS)
870
setBooleanValueFromInt ("unredirect_overlays", setting->data.v_int, rc);
871
mcs_setting_free (setting);
873
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/UseCompositing", CHANNEL5,
874
&setting) == MCS_SUCCESS)
876
setBooleanValueFromInt ("use_compositing", setting->data.v_int, rc);
877
mcs_setting_free (setting);
879
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/WrapLayout", CHANNEL5,
880
&setting) == MCS_SUCCESS)
882
setBooleanValueFromInt ("wrap_layout", setting->data.v_int, rc);
883
mcs_setting_free (setting);
885
if (mcs_client_get_setting (screen_info->mcs_client, "Xfwm/WrapCycle", CHANNEL5,
886
&setting) == MCS_SUCCESS)
888
setBooleanValueFromInt ("wrap_cycle", setting->data.v_int, rc);
889
mcs_setting_free (setting);
219
gchar *property_name = g_strconcat("/general/", rc[i].option, NULL);
220
if(xfconf_channel_has_property(screen_info->xfwm4_channel, property_name))
224
g_value_unset(rc[i].value);
227
rc[i].value = g_new0(GValue, 1);
229
if(!xfconf_channel_get_property(screen_info->xfwm4_channel, property_name, rc[i].value))
231
g_warning("get prop failed");
237
xfconf_channel_set_property(screen_info->xfwm4_channel, property_name, rc[i].value);
239
g_free(property_name);
894
244
/* Simple helper function to avoid copy/paste of code */
945
302
return TITLE_SHADOW_NONE;
306
getFontHeight (const PangoFontDescription *desc, PangoContext *context)
308
PangoFontMetrics *metrics;
309
PangoLanguage *language;
312
g_return_val_if_fail (desc, 0);
313
g_return_val_if_fail (context, 0);
315
language = pango_context_get_language (context);
316
metrics = pango_context_get_metrics (context, desc, language);
317
height = PANGO_PIXELS (pango_font_metrics_get_ascent (metrics) +
318
pango_font_metrics_get_descent (metrics));
319
pango_font_metrics_unref (metrics);
949
326
loadTheme (ScreenInfo *screen_info, Settings *rc)
328
static const char *side_names[] = {
334
static const char *corner_names[] = {
341
static const char *button_names[] = {
350
static const char *button_state_names[] = {
951
362
GValue tmp_val = { 0, };
952
363
DisplayInfo *display_info;
953
364
xfwmColorSymbol colsym[ XPM_COLOR_SYMBOL_SIZE + 1 ];
954
365
GtkWidget *widget;
957
368
PangoFontDescription *desc;
369
PangoContext *context;
960
372
widget = myScreenGetGtkWidget (screen_info);
961
373
display_info = screen_info->display_info;
965
rc[0].value = getUIStyle (widget, "fg", "selected");
966
rc[1].value = getUIStyle (widget, "fg", "insensitive");
967
rc[2].value = getUIStyle (widget, "dark", "selected");
968
rc[3].value = getUIStyle (widget, "dark", "insensitive");
969
rc[4].value = getUIStyle (widget, "fg", "normal");
970
rc[5].value = getUIStyle (widget, "fg", "normal");
971
rc[6].value = getUIStyle (widget, "bg", "selected");
972
rc[7].value = getUIStyle (widget, "light", "selected");
973
rc[8].value = getUIStyle (widget, "dark", "selected");
974
rc[9].value = getUIStyle (widget, "mid", "selected");
975
rc[10].value = getUIStyle (widget, "bg", "normal");
976
rc[11].value = getUIStyle (widget, "light", "normal");
977
rc[12].value = getUIStyle (widget, "dark", "normal");
978
rc[13].value = getUIStyle (widget, "mid", "normal");
979
rc[14].value = getUIStyle (widget, "bg", "insensitive");
980
rc[15].value = getUIStyle (widget, "light", "insensitive");
981
rc[16].value = getUIStyle (widget, "dark", "insensitive");
982
rc[17].value = getUIStyle (widget, "mid", "insensitive");
983
rc[18].value = getUIStyle (widget, "bg", "normal");
984
rc[19].value = getUIStyle (widget, "light", "normal");
985
rc[20].value = getUIStyle (widget, "dark", "normal");
986
rc[21].value = getUIStyle (widget, "mid", "normal");
989
theme = getThemeDir (getValue ("theme", rc), THEMERC);
378
setStringValue (rc[0].option, getUIStyle (widget, "fg", "selected"), rc);
379
setStringValue (rc[1].option, getUIStyle (widget, "fg", "insensitive"), rc);
380
setStringValue (rc[2].option, getUIStyle (widget, "dark", "selected"), rc);
381
setStringValue (rc[3].option, getUIStyle (widget, "dark", "insensitive"), rc);
382
setStringValue (rc[4].option, getUIStyle (widget, "fg", "normal"), rc);
383
setStringValue (rc[5].option, getUIStyle (widget, "fg", "normal"), rc);
384
setStringValue (rc[6].option, getUIStyle (widget, "bg", "selected"), rc);
385
setStringValue (rc[7].option, getUIStyle (widget, "light", "selected"), rc);
386
setStringValue (rc[8].option, getUIStyle (widget, "dark", "selected"), rc);
387
setStringValue (rc[9].option, getUIStyle (widget, "mid", "selected"), rc);
388
setStringValue (rc[10].option, getUIStyle (widget, "bg", "normal"), rc);
389
setStringValue (rc[11].option, getUIStyle (widget, "light", "normal"), rc);
390
setStringValue (rc[12].option, getUIStyle (widget, "dark", "normal"), rc);
391
setStringValue (rc[13].option, getUIStyle (widget, "mid", "normal"), rc);
392
setStringValue (rc[14].option, getUIStyle (widget, "bg", "insensitive"), rc);
393
setStringValue (rc[15].option, getUIStyle (widget, "light", "insensitive"), rc);
394
setStringValue (rc[16].option, getUIStyle (widget, "dark", "insensitive"), rc);
395
setStringValue (rc[17].option, getUIStyle (widget, "mid", "insensitive"), rc);
396
setStringValue (rc[18].option, getUIStyle (widget, "bg", "normal"), rc);
397
setStringValue (rc[19].option, getUIStyle (widget, "light", "normal"), rc);
398
setStringValue (rc[20].option, getUIStyle (widget, "dark", "normal"), rc);
399
setStringValue (rc[21].option, getUIStyle (widget, "mid", "normal"), rc);
402
theme = getThemeDir (getStringValue ("theme", rc), THEMERC);
990
403
parseRc (THEMERC, theme, rc);
992
405
screen_info->params->shadow_delta_x =
993
- (TOINT (getValue ("shadow_delta_x", rc)));
406
- getIntValue ("shadow_delta_x", rc);
994
407
screen_info->params->shadow_delta_y =
995
- (TOINT (getValue ("shadow_delta_y", rc)));
408
- getIntValue ("shadow_delta_y", rc);
996
409
screen_info->params->shadow_delta_width =
997
- (TOINT (getValue ("shadow_delta_width", rc)));
410
- getIntValue ("shadow_delta_width", rc);
998
411
screen_info->params->shadow_delta_height =
999
- (TOINT (getValue ("shadow_delta_height", rc)));
412
- getIntValue ("shadow_delta_height", rc);
1001
414
for (i = 0; i < XPM_COLOR_SYMBOL_SIZE; i++)
1003
416
colsym[i].name = rc[i].option;
1004
colsym[i].value = rc[i].value;
417
colsym[i].value = g_value_get_string(rc[i].value);
1006
419
colsym[XPM_COLOR_SYMBOL_SIZE].name = NULL;
1007
420
colsym[XPM_COLOR_SYMBOL_SIZE].value = NULL;
1009
display_info->dbl_click_time = abs (TOINT (getValue ("dbl_click_time", rc)));
422
display_info->dbl_click_time = abs (getIntValue ("dbl_click_time", rc));
1010
423
g_value_init (&tmp_val, G_TYPE_INT);
1011
424
if (gdk_setting_get ("gtk-double-click-time", &tmp_val))
1013
426
display_info->dbl_click_time = abs (g_value_get_int (&tmp_val));
1016
font = getValue ("title_font", rc);
429
screen_info->font_height = 0;
430
font = getStringValue ("title_font", rc);
1017
431
if (font && strlen (font))
1019
433
desc = pango_font_description_from_string (font);
434
context = getUIPangoContext (widget);
1022
437
gtk_widget_modify_font (widget, desc);
438
screen_info->font_height = getFontHeight (desc, context);
1023
439
pango_font_description_free (desc);
1043
459
screen_info->white_gc = widget->style->white_gc;
1044
460
g_object_ref (G_OBJECT (widget->style->white_gc));
1046
xfwmPixmapLoad (screen_info, &screen_info->sides[SIDE_LEFT][ACTIVE], theme,
1047
"left-active", colsym);
1048
xfwmPixmapLoad (screen_info, &screen_info->sides[SIDE_LEFT][INACTIVE], theme,
1049
"left-inactive", colsym);
1050
xfwmPixmapLoad (screen_info, &screen_info->sides[SIDE_RIGHT][ACTIVE], theme,
1051
"right-active", colsym);
1052
xfwmPixmapLoad (screen_info, &screen_info->sides[SIDE_RIGHT][INACTIVE], theme,
1053
"right-inactive", colsym);
1054
xfwmPixmapLoad (screen_info, &screen_info->sides[SIDE_BOTTOM][ACTIVE], theme,
1055
"bottom-active", colsym);
1056
xfwmPixmapLoad (screen_info, &screen_info->sides[SIDE_BOTTOM][INACTIVE], theme,
1057
"bottom-inactive", colsym);
1058
xfwmPixmapLoad (screen_info, &screen_info->corners[CORNER_TOP_LEFT][ACTIVE], theme,
1059
"top-left-active", colsym);
1060
xfwmPixmapLoad (screen_info, &screen_info->corners[CORNER_TOP_LEFT][INACTIVE], theme,
1061
"top-left-inactive", colsym);
1062
xfwmPixmapLoad (screen_info, &screen_info->corners[CORNER_TOP_RIGHT][ACTIVE], theme,
1063
"top-right-active", colsym);
1064
xfwmPixmapLoad (screen_info, &screen_info->corners[CORNER_TOP_RIGHT][INACTIVE], theme,
1065
"top-right-inactive", colsym);
1066
xfwmPixmapLoad (screen_info, &screen_info->corners[CORNER_BOTTOM_LEFT][ACTIVE], theme,
1067
"bottom-left-active", colsym);
1068
xfwmPixmapLoad (screen_info, &screen_info->corners[CORNER_BOTTOM_LEFT][INACTIVE], theme,
1069
"bottom-left-inactive", colsym);
1070
xfwmPixmapLoad (screen_info, &screen_info->corners[CORNER_BOTTOM_RIGHT][ACTIVE], theme,
1071
"bottom-right-active", colsym);
1072
xfwmPixmapLoad (screen_info, &screen_info->corners[CORNER_BOTTOM_RIGHT][INACTIVE], theme,
1073
"bottom-right-inactive", colsym);
1074
xfwmPixmapLoad (screen_info, &screen_info->buttons[HIDE_BUTTON][ACTIVE], theme,
1075
"hide-active", colsym);
1076
xfwmPixmapLoad (screen_info, &screen_info->buttons[HIDE_BUTTON][INACTIVE], theme,
1077
"hide-inactive", colsym);
1078
xfwmPixmapLoad (screen_info, &screen_info->buttons[HIDE_BUTTON][PRESSED], theme,
1079
"hide-pressed", colsym);
1080
xfwmPixmapLoad (screen_info, &screen_info->buttons[CLOSE_BUTTON][ACTIVE], theme,
1081
"close-active", colsym);
1082
xfwmPixmapLoad (screen_info, &screen_info->buttons[CLOSE_BUTTON][INACTIVE], theme,
1083
"close-inactive", colsym);
1084
xfwmPixmapLoad (screen_info, &screen_info->buttons[CLOSE_BUTTON][PRESSED], theme,
1085
"close-pressed", colsym);
1086
xfwmPixmapLoad (screen_info, &screen_info->buttons[MAXIMIZE_BUTTON][ACTIVE], theme,
1087
"maximize-active", colsym);
1088
xfwmPixmapLoad (screen_info, &screen_info->buttons[MAXIMIZE_BUTTON][INACTIVE], theme,
1089
"maximize-inactive", colsym);
1090
xfwmPixmapLoad (screen_info, &screen_info->buttons[MAXIMIZE_BUTTON][PRESSED], theme,
1091
"maximize-pressed", colsym);
1092
xfwmPixmapLoad (screen_info, &screen_info->buttons[SHADE_BUTTON][ACTIVE], theme,
1093
"shade-active", colsym);
1094
xfwmPixmapLoad (screen_info, &screen_info->buttons[SHADE_BUTTON][INACTIVE], theme,
1095
"shade-inactive", colsym);
1096
xfwmPixmapLoad (screen_info, &screen_info->buttons[SHADE_BUTTON][PRESSED], theme,
1097
"shade-pressed", colsym);
1098
xfwmPixmapLoad (screen_info, &screen_info->buttons[STICK_BUTTON][ACTIVE], theme,
1099
"stick-active", colsym);
1100
xfwmPixmapLoad (screen_info, &screen_info->buttons[STICK_BUTTON][INACTIVE], theme,
1101
"stick-inactive", colsym);
1102
xfwmPixmapLoad (screen_info, &screen_info->buttons[STICK_BUTTON][PRESSED], theme,
1103
"stick-pressed", colsym);
1104
xfwmPixmapLoad (screen_info, &screen_info->buttons[MENU_BUTTON][ACTIVE], theme,
1105
"menu-active", colsym);
1106
xfwmPixmapLoad (screen_info, &screen_info->buttons[MENU_BUTTON][INACTIVE], theme,
1107
"menu-inactive", colsym);
1108
xfwmPixmapLoad (screen_info, &screen_info->buttons[MENU_BUTTON][PRESSED], theme,
1109
"menu-pressed", colsym);
1110
xfwmPixmapLoad (screen_info, &screen_info->buttons[SHADE_BUTTON][T_ACTIVE], theme,
1111
"shade-toggled-active", colsym);
1112
xfwmPixmapLoad (screen_info, &screen_info->buttons[SHADE_BUTTON][T_INACTIVE], theme,
1113
"shade-toggled-inactive", colsym);
1114
xfwmPixmapLoad (screen_info, &screen_info->buttons[SHADE_BUTTON][T_PRESSED], theme,
1115
"shade-toggled-pressed", colsym);
1116
xfwmPixmapLoad (screen_info, &screen_info->buttons[STICK_BUTTON][T_ACTIVE], theme,
1117
"stick-toggled-active", colsym);
1118
xfwmPixmapLoad (screen_info, &screen_info->buttons[STICK_BUTTON][T_INACTIVE], theme,
1119
"stick-toggled-inactive", colsym);
1120
xfwmPixmapLoad (screen_info, &screen_info->buttons[STICK_BUTTON][T_PRESSED], theme,
1121
"stick-toggled-pressed", colsym);
1122
xfwmPixmapLoad (screen_info, &screen_info->buttons[MAXIMIZE_BUTTON][T_ACTIVE], theme,
1123
"maximize-toggled-active", colsym);
1124
xfwmPixmapLoad (screen_info, &screen_info->buttons[MAXIMIZE_BUTTON][T_INACTIVE], theme,
1125
"maximize-toggled-inactive", colsym);
1126
xfwmPixmapLoad (screen_info, &screen_info->buttons[MAXIMIZE_BUTTON][T_PRESSED], theme,
1127
"maximize-toggled-pressed", colsym);
1128
xfwmPixmapLoad (screen_info, &screen_info->title[TITLE_1][ACTIVE], theme,
1129
"title-1-active", colsym);
1130
xfwmPixmapLoad (screen_info, &screen_info->title[TITLE_1][INACTIVE], theme,
1131
"title-1-inactive", colsym);
1132
xfwmPixmapLoad (screen_info, &screen_info->title[TITLE_2][ACTIVE], theme,
1133
"title-2-active", colsym);
1134
xfwmPixmapLoad (screen_info, &screen_info->title[TITLE_2][INACTIVE], theme,
1135
"title-2-inactive", colsym);
1136
xfwmPixmapLoad (screen_info, &screen_info->title[TITLE_3][ACTIVE], theme,
1137
"title-3-active", colsym);
1138
xfwmPixmapLoad (screen_info, &screen_info->title[TITLE_3][INACTIVE], theme,
1139
"title-3-inactive", colsym);
1140
xfwmPixmapLoad (screen_info, &screen_info->title[TITLE_4][ACTIVE], theme,
1141
"title-4-active", colsym);
1142
xfwmPixmapLoad (screen_info, &screen_info->title[TITLE_4][INACTIVE], theme,
1143
"title-4-inactive", colsym);
1144
xfwmPixmapLoad (screen_info, &screen_info->title[TITLE_5][ACTIVE], theme,
1145
"title-5-active", colsym);
1146
xfwmPixmapLoad (screen_info, &screen_info->title[TITLE_5][INACTIVE], theme,
1147
"title-5-inactive", colsym);
462
for (i = 0; i < SIDE_TOP; i++) /* Keep SIDE_TOP for later */
464
g_snprintf(imagename, sizeof (imagename), "%s-active", side_names[i]);
465
xfwmPixmapLoad (screen_info, &screen_info->sides[i][ACTIVE], theme, imagename, colsym);
467
g_snprintf(imagename, sizeof (imagename), "%s-inactive", side_names[i]);
468
xfwmPixmapLoad (screen_info, &screen_info->sides[i][INACTIVE], theme, imagename, colsym);
470
for (i = 0; i < CORNER_COUNT; i++)
472
g_snprintf(imagename, sizeof (imagename), "%s-active", corner_names[i]);
473
xfwmPixmapLoad (screen_info, &screen_info->corners[i][ACTIVE], theme, imagename, colsym);
475
g_snprintf(imagename, sizeof (imagename), "%s-inactive", corner_names[i]);
476
xfwmPixmapLoad (screen_info, &screen_info->corners[i][INACTIVE], theme, imagename, colsym);
478
for (i = 0; i < BUTTON_COUNT; i++)
480
for (j = 0; j < STATE_COUNT; j++)
482
g_snprintf(imagename, sizeof (imagename), "%s-%s", button_names[i], button_state_names[j]);
483
xfwmPixmapLoad (screen_info, &screen_info->buttons[i][j], theme, imagename, colsym);
486
for (i = 0; i < TITLE_COUNT; i++)
488
g_snprintf(imagename, sizeof (imagename), "title-%d-active", i + 1);
489
xfwmPixmapLoad (screen_info, &screen_info->title[i][ACTIVE], theme, imagename, colsym);
491
g_snprintf(imagename, sizeof (imagename), "title-%d-inactive", i + 1);
492
xfwmPixmapLoad (screen_info, &screen_info->title[i][INACTIVE], theme, imagename, colsym);
494
g_snprintf(imagename, sizeof (imagename), "top-%d-active", i + 1);
495
xfwmPixmapLoad (screen_info, &screen_info->top[i][ACTIVE], theme, imagename, colsym);
497
g_snprintf(imagename, sizeof (imagename), "top-%d-inactive", i + 1);
498
xfwmPixmapLoad (screen_info, &screen_info->top[i][INACTIVE], theme, imagename, colsym);
1149
501
screen_info->box_gc = createGC (screen_info, "#FFFFFF", GXxor, NULL, 2, TRUE);
1151
if (!g_ascii_strcasecmp ("left", getValue ("title_alignment", rc)))
503
if (!g_ascii_strcasecmp ("left", getStringValue ("title_alignment", rc)))
1153
505
screen_info->params->title_alignment = ALIGN_LEFT;
1155
else if (!g_ascii_strcasecmp ("right", getValue ("title_alignment", rc)))
507
else if (!g_ascii_strcasecmp ("right", getStringValue ("title_alignment", rc)))
1157
509
screen_info->params->title_alignment = ALIGN_RIGHT;
1164
516
screen_info->params->full_width_title =
1165
!g_ascii_strcasecmp ("true", getValue ("full_width_title", rc));
517
getBoolValue ("full_width_title", rc);
1166
518
screen_info->params->title_shadow[ACTIVE] = getTitleShadow (rc, "title_shadow_active");
1167
519
screen_info->params->title_shadow[INACTIVE] = getTitleShadow (rc, "title_shadow_inactive");
1169
strncpy (screen_info->params->button_layout, getValue ("button_layout", rc), BUTTON_COUNT + 1);
1170
screen_info->params->button_spacing = TOINT (getValue ("button_spacing", rc));
1171
screen_info->params->button_offset = TOINT (getValue ("button_offset", rc));
1172
screen_info->params->maximized_offset = TOINT (getValue ("maximized_offset", rc));
521
strncpy (screen_info->params->button_layout, getStringValue ("button_layout", rc), BUTTON_STRING_COUNT);
522
screen_info->params->button_spacing = getIntValue ("button_spacing", rc);
523
screen_info->params->button_offset = getIntValue ("button_offset", rc);
524
screen_info->params->maximized_offset = getIntValue ("maximized_offset", rc);
1173
525
screen_info->params->title_vertical_offset_active =
1174
TOINT (getValue ("title_vertical_offset_active", rc));
526
getIntValue ("title_vertical_offset_active", rc);
1175
527
screen_info->params->title_vertical_offset_inactive =
1176
TOINT (getValue ("title_vertical_offset_inactive", rc));
528
getIntValue ("title_vertical_offset_inactive", rc);
1177
529
screen_info->params->title_horizontal_offset =
1178
TOINT (getValue ("title_horizontal_offset", rc));
530
getIntValue ("title_horizontal_offset", rc);
1184
loadKeyBindings (ScreenInfo *screen_info, Settings *rc)
536
loadKeyBindings (ScreenInfo *screen_info)
1188
gchar *keythemevalue;
1190
543
dpy = myScreenGetXDisplay (screen_info);
1192
Load defaults keytheme so that even if there are
1193
missing shortcuts in an older user defined key theme
1194
the missing keys will be taken from the default
1196
keytheme = getThemeDir (DEFAULT_KEYTHEME, KEYTHEMERC);
1197
parseRc (KEYTHEMERC, keytheme, rc);
1200
keythemevalue = getValue ("keytheme", rc);
545
shortcuts = xfce_shortcuts_provider_get_shortcuts (screen_info->shortcuts_provider);
547
parseShortcut (screen_info, KEY_CANCEL, "cancel_key", shortcuts);
548
parseShortcut (screen_info, KEY_DOWN, "down_key", shortcuts);
549
parseShortcut (screen_info, KEY_LEFT, "left_key", shortcuts);
550
parseShortcut (screen_info, KEY_RIGHT, "right_key", shortcuts);
551
parseShortcut (screen_info, KEY_UP, "up_key", shortcuts);
552
parseShortcut (screen_info, KEY_ADD_WORKSPACE, "add_workspace_key", shortcuts);
553
parseShortcut (screen_info, KEY_ADD_ADJACENT_WORKSPACE, "add_adjacent_workspace_key", shortcuts);
554
parseShortcut (screen_info, KEY_CLOSE_WINDOW, "close_window_key", shortcuts);
555
parseShortcut (screen_info, KEY_CYCLE_WINDOWS, "cycle_windows_key", shortcuts);
556
parseShortcut (screen_info, KEY_CYCLE_REVERSE_WINDOWS, "cycle_reverse_windows_key", shortcuts);
557
parseShortcut (screen_info, KEY_DEL_WORKSPACE, "del_workspace_key", shortcuts);
558
parseShortcut (screen_info, KEY_DEL_ACTIVE_WORKSPACE, "del_active_workspace_key", shortcuts);
559
parseShortcut (screen_info, KEY_DOWN_WORKSPACE, "down_workspace_key", shortcuts);
560
parseShortcut (screen_info, KEY_FILL_HORIZ, "fill_horiz_key", shortcuts);
561
parseShortcut (screen_info, KEY_FILL_VERT, "fill_vert_key", shortcuts);
562
parseShortcut (screen_info, KEY_FILL_WINDOW, "fill_window_key", shortcuts);
563
parseShortcut (screen_info, KEY_HIDE_WINDOW, "hide_window_key", shortcuts);
564
parseShortcut (screen_info, KEY_LEFT_WORKSPACE, "left_workspace_key", shortcuts);
565
parseShortcut (screen_info, KEY_LOWER_WINDOW, "lower_window_key", shortcuts);
566
parseShortcut (screen_info, KEY_MOVE, "move_window_key", shortcuts);
567
parseShortcut (screen_info, KEY_MAXIMIZE_HORIZ, "maximize_horiz_key", shortcuts);
568
parseShortcut (screen_info, KEY_MAXIMIZE_VERT, "maximize_vert_key", shortcuts);
569
parseShortcut (screen_info, KEY_MAXIMIZE_WINDOW, "maximize_window_key", shortcuts);
570
parseShortcut (screen_info, KEY_MOVE_DOWN_WORKSPACE, "move_window_down_workspace_key", shortcuts);
571
parseShortcut (screen_info, KEY_MOVE_LEFT_WORKSPACE, "move_window_left_workspace_key", shortcuts);
572
parseShortcut (screen_info, KEY_MOVE_NEXT_WORKSPACE, "move_window_next_workspace_key", shortcuts);
573
parseShortcut (screen_info, KEY_MOVE_PREV_WORKSPACE, "move_window_prev_workspace_key", shortcuts);
574
parseShortcut (screen_info, KEY_MOVE_RIGHT_WORKSPACE, "move_window_right_workspace_key", shortcuts);
575
parseShortcut (screen_info, KEY_MOVE_UP_WORKSPACE, "move_window_up_workspace_key", shortcuts);
576
parseShortcut (screen_info, KEY_NEXT_WORKSPACE, "next_workspace_key", shortcuts);
577
parseShortcut (screen_info, KEY_POPUP_MENU, "popup_menu_key", shortcuts);
578
parseShortcut (screen_info, KEY_PREV_WORKSPACE, "prev_workspace_key", shortcuts);
579
parseShortcut (screen_info, KEY_RAISE_WINDOW, "raise_window_key", shortcuts);
580
parseShortcut (screen_info, KEY_RESIZE, "resize_window_key", shortcuts);
581
parseShortcut (screen_info, KEY_RIGHT_WORKSPACE, "right_workspace_key", shortcuts);
582
parseShortcut (screen_info, KEY_SHADE_WINDOW, "shade_window_key", shortcuts);
583
parseShortcut (screen_info, KEY_SHOW_DESKTOP, "show_desktop_key", shortcuts);
584
parseShortcut (screen_info, KEY_STICK_WINDOW, "stick_window_key", shortcuts);
585
parseShortcut (screen_info, KEY_TOGGLE_ABOVE, "above_key", shortcuts);
586
parseShortcut (screen_info, KEY_TOGGLE_FULLSCREEN, "fullscreen_key", shortcuts);
587
parseShortcut (screen_info, KEY_UP_WORKSPACE, "up_workspace_key", shortcuts);
589
for (i = 0; i < 12; i++)
1203
keytheme = getThemeDir (keythemevalue, KEYTHEMERC);
1204
if (!parseRc (KEYTHEMERC, keytheme, rc))
1206
g_warning ("Specified key theme \"%s\" missing, using default", keythemevalue);
591
g_snprintf(keyname, sizeof (keyname), "move_window_workspace_%d_key", i + 1);
592
parseShortcut (screen_info, KEY_MOVE_WORKSPACE_1 + i, keyname, shortcuts);
1212
g_warning ("Missing values in defaults file");
594
g_snprintf(keyname, sizeof (keyname), "workspace_%d_key", i + 1);
595
parseShortcut (screen_info, KEY_WORKSPACE_1 + i, keyname, shortcuts);
1217
parseKeyString (dpy, &screen_info->params->keys[KEY_ADD_WORKSPACE], getValue ("add_workspace_key", rc));
1218
parseKeyString (dpy, &screen_info->params->keys[KEY_CANCEL], getValue ("cancel_key", rc));
1219
parseKeyString (dpy, &screen_info->params->keys[KEY_CLOSE_WINDOW], getValue ("close_window_key", rc));
1220
parseKeyString (dpy, &screen_info->params->keys[KEY_CYCLE_WINDOWS], getValue ("cycle_windows_key", rc));
1221
parseKeyString (dpy, &screen_info->params->keys[KEY_DEL_WORKSPACE], getValue ("del_workspace_key", rc));
1222
parseKeyString (dpy, &screen_info->params->keys[KEY_DOWN_WORKSPACE], getValue ("down_workspace_key", rc));
1223
parseKeyString (dpy, &screen_info->params->keys[KEY_HIDE_WINDOW], getValue ("hide_window_key", rc));
1224
parseKeyString (dpy, &screen_info->params->keys[KEY_LEFT_WORKSPACE], getValue ("left_workspace_key", rc));
1225
parseKeyString (dpy, &screen_info->params->keys[KEY_LOWER_WINDOW], getValue ("lower_window_key", rc));
1226
parseKeyString (dpy, &screen_info->params->keys[KEY_MAXIMIZE_HORIZ], getValue ("maximize_horiz_key", rc));
1227
parseKeyString (dpy, &screen_info->params->keys[KEY_MAXIMIZE_VERT], getValue ("maximize_vert_key", rc));
1228
parseKeyString (dpy, &screen_info->params->keys[KEY_MAXIMIZE_WINDOW], getValue ("maximize_window_key", rc));
1229
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_DOWN], getValue ("move_window_down_key", rc));
1230
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_DOWN_WORKSPACE], getValue ("move_window_down_workspace_key", rc));
1231
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_LEFT], getValue ("move_window_left_key", rc));
1232
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_LEFT_WORKSPACE], getValue ("move_window_left_workspace_key", rc));
1233
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_NEXT_WORKSPACE], getValue ("move_window_next_workspace_key", rc));
1234
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_PREV_WORKSPACE], getValue ("move_window_prev_workspace_key", rc));
1235
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_RIGHT], getValue ("move_window_right_key", rc));
1236
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_RIGHT_WORKSPACE], getValue ("move_window_right_workspace_key", rc));
1237
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_UP], getValue ("move_window_up_key", rc));
1238
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_UP_WORKSPACE], getValue ("move_window_up_workspace_key", rc));
1239
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_WORKSPACE_1], getValue ("move_window_workspace_1_key", rc));
1240
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_WORKSPACE_2], getValue ("move_window_workspace_2_key", rc));
1241
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_WORKSPACE_3], getValue ("move_window_workspace_3_key", rc));
1242
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_WORKSPACE_4], getValue ("move_window_workspace_4_key", rc));
1243
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_WORKSPACE_5], getValue ("move_window_workspace_5_key", rc));
1244
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_WORKSPACE_6], getValue ("move_window_workspace_6_key", rc));
1245
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_WORKSPACE_7], getValue ("move_window_workspace_7_key", rc));
1246
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_WORKSPACE_8], getValue ("move_window_workspace_8_key", rc));
1247
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_WORKSPACE_9], getValue ("move_window_workspace_9_key", rc));
1248
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_WORKSPACE_10], getValue ("move_window_workspace_10_key", rc));
1249
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_WORKSPACE_11], getValue ("move_window_workspace_11_key", rc));
1250
parseKeyString (dpy, &screen_info->params->keys[KEY_MOVE_WORKSPACE_12], getValue ("move_window_workspace_12_key", rc));
1251
parseKeyString (dpy, &screen_info->params->keys[KEY_NEXT_WORKSPACE], getValue ("next_workspace_key", rc));
1252
parseKeyString (dpy, &screen_info->params->keys[KEY_POPUP_MENU], getValue ("popup_menu_key", rc));
1253
parseKeyString (dpy, &screen_info->params->keys[KEY_PREV_WORKSPACE], getValue ("prev_workspace_key", rc));
1254
parseKeyString (dpy, &screen_info->params->keys[KEY_RAISE_WINDOW], getValue ("raise_window_key", rc));
1255
parseKeyString (dpy, &screen_info->params->keys[KEY_RESIZE_DOWN], getValue ("resize_window_down_key", rc));
1256
parseKeyString (dpy, &screen_info->params->keys[KEY_RESIZE_LEFT], getValue ("resize_window_left_key", rc));
1257
parseKeyString (dpy, &screen_info->params->keys[KEY_RESIZE_RIGHT], getValue ("resize_window_right_key", rc));
1258
parseKeyString (dpy, &screen_info->params->keys[KEY_RESIZE_UP], getValue ("resize_window_up_key", rc));
1259
parseKeyString (dpy, &screen_info->params->keys[KEY_RIGHT_WORKSPACE], getValue ("right_workspace_key", rc));
1260
parseKeyString (dpy, &screen_info->params->keys[KEY_SHADE_WINDOW], getValue ("shade_window_key", rc));
1261
parseKeyString (dpy, &screen_info->params->keys[KEY_SHOW_DESKTOP], getValue("show_desktop_key", rc));
1262
parseKeyString (dpy, &screen_info->params->keys[KEY_STICK_WINDOW], getValue ("stick_window_key", rc));
1263
parseKeyString (dpy, &screen_info->params->keys[KEY_TOGGLE_FULLSCREEN], getValue ("fullscreen_key", rc));
1264
parseKeyString (dpy, &screen_info->params->keys[KEY_UP_WORKSPACE], getValue ("up_workspace_key", rc));
1265
parseKeyString (dpy, &screen_info->params->keys[KEY_WORKSPACE_1], getValue ("workspace_1_key", rc));
1266
parseKeyString (dpy, &screen_info->params->keys[KEY_WORKSPACE_2], getValue ("workspace_2_key", rc));
1267
parseKeyString (dpy, &screen_info->params->keys[KEY_WORKSPACE_3], getValue ("workspace_3_key", rc));
1268
parseKeyString (dpy, &screen_info->params->keys[KEY_WORKSPACE_4], getValue ("workspace_4_key", rc));
1269
parseKeyString (dpy, &screen_info->params->keys[KEY_WORKSPACE_5], getValue ("workspace_5_key", rc));
1270
parseKeyString (dpy, &screen_info->params->keys[KEY_WORKSPACE_6], getValue ("workspace_6_key", rc));
1271
parseKeyString (dpy, &screen_info->params->keys[KEY_WORKSPACE_7], getValue ("workspace_7_key", rc));
1272
parseKeyString (dpy, &screen_info->params->keys[KEY_WORKSPACE_8], getValue ("workspace_8_key", rc));
1273
parseKeyString (dpy, &screen_info->params->keys[KEY_WORKSPACE_9], getValue ("workspace_9_key", rc));
1274
parseKeyString (dpy, &screen_info->params->keys[KEY_WORKSPACE_10], getValue ("workspace_10_key", rc));
1275
parseKeyString (dpy, &screen_info->params->keys[KEY_WORKSPACE_11], getValue ("workspace_11_key", rc));
1276
parseKeyString (dpy, &screen_info->params->keys[KEY_WORKSPACE_12], getValue ("workspace_12_key", rc));
598
xfce_shortcuts_free (shortcuts);
1278
600
myScreenUngrabKeys (screen_info);
1279
601
myScreenGrabKeys (screen_info);
1287
609
const gchar *value;
1288
610
Settings rc[] = {
1289
611
/* Do not change the order of the following parameters */
1290
{"active_text_color", NULL, FALSE},
1291
{"inactive_text_color", NULL, FALSE},
1292
{"active_text_shadow_color", NULL, FALSE},
1293
{"inactive_text_shadow_color", NULL, FALSE},
1294
{"active_border_color", NULL, FALSE},
1295
{"inactive_border_color", NULL, FALSE},
1296
{"active_color_1", NULL, FALSE},
1297
{"active_hilight_1", NULL, FALSE},
1298
{"active_shadow_1", NULL, FALSE},
1299
{"active_mid_1", NULL, FALSE},
1300
{"active_color_2", NULL, FALSE},
1301
{"active_hilight_2", NULL, FALSE},
1302
{"active_shadow_2", NULL, FALSE},
1303
{"active_mid_2", NULL, FALSE},
1304
{"inactive_color_1", NULL, FALSE},
1305
{"inactive_hilight_1", NULL, FALSE},
1306
{"inactive_shadow_1", NULL, FALSE},
1307
{"inactive_mid_1", NULL, FALSE},
1308
{"inactive_color_2", NULL, FALSE},
1309
{"inactive_hilight_2", NULL, FALSE},
1310
{"inactive_shadow_2", NULL, FALSE},
1311
{"inactive_mid_2", NULL, FALSE},
612
{"active_text_color", NULL, G_TYPE_STRING, FALSE},
613
{"inactive_text_color", NULL, G_TYPE_STRING, FALSE},
614
{"active_text_shadow_color", NULL, G_TYPE_STRING, FALSE},
615
{"inactive_text_shadow_color", NULL, G_TYPE_STRING, FALSE},
616
{"active_border_color", NULL, G_TYPE_STRING, FALSE},
617
{"inactive_border_color", NULL, G_TYPE_STRING, FALSE},
618
{"active_color_1", NULL, G_TYPE_STRING, FALSE},
619
{"active_hilight_1", NULL, G_TYPE_STRING, FALSE},
620
{"active_shadow_1", NULL, G_TYPE_STRING, FALSE},
621
{"active_mid_1", NULL, G_TYPE_STRING, FALSE},
622
{"active_color_2", NULL, G_TYPE_STRING, FALSE},
623
{"active_hilight_2", NULL, G_TYPE_STRING, FALSE},
624
{"active_shadow_2", NULL, G_TYPE_STRING, FALSE},
625
{"active_mid_2", NULL, G_TYPE_STRING, FALSE},
626
{"inactive_color_1", NULL, G_TYPE_STRING, FALSE},
627
{"inactive_hilight_1", NULL, G_TYPE_STRING, FALSE},
628
{"inactive_shadow_1", NULL, G_TYPE_STRING, FALSE},
629
{"inactive_mid_1", NULL, G_TYPE_STRING, FALSE},
630
{"inactive_color_2", NULL, G_TYPE_STRING, FALSE},
631
{"inactive_hilight_2", NULL, G_TYPE_STRING, FALSE},
632
{"inactive_shadow_2", NULL, G_TYPE_STRING, FALSE},
633
{"inactive_mid_2", NULL, G_TYPE_STRING, FALSE},
1312
634
/* You can change the order of the following parameters */
1313
{"activate_action", NULL, TRUE},
1314
{"borderless_maximize", NULL, TRUE},
1315
{"box_move", NULL, TRUE},
1316
{"box_resize", NULL, TRUE},
1317
{"button_layout", NULL, TRUE},
1318
{"button_offset", NULL, TRUE},
1319
{"button_spacing", NULL, TRUE},
1320
{"click_to_focus", NULL, TRUE},
1321
{"cycle_hidden", NULL, TRUE},
1322
{"cycle_minimum", NULL, TRUE},
1323
{"cycle_workspaces", NULL, TRUE},
1324
{"dbl_click_time", NULL, TRUE},
1325
{"double_click_action", NULL, TRUE},
1326
{"easy_click", NULL, TRUE},
1327
{"focus_hint", NULL, TRUE},
1328
{"focus_new", NULL, TRUE},
1329
{"frame_opacity", NULL, TRUE},
1330
{"full_width_title", NULL, TRUE},
1331
{"inactive_opacity", NULL, TRUE},
1332
{"keytheme", NULL, TRUE},
1333
{"margin_bottom", NULL, FALSE},
1334
{"margin_left", NULL, FALSE},
1335
{"margin_right", NULL, FALSE},
1336
{"margin_top", NULL, FALSE},
1337
{"maximized_offset", NULL, TRUE},
1338
{"move_opacity", NULL, TRUE},
1339
{"placement_ratio", NULL, TRUE},
1340
{"popup_opacity", NULL, TRUE},
1341
{"prevent_focus_stealing", NULL, TRUE},
1342
{"raise_delay", NULL, TRUE},
1343
{"raise_on_click", NULL, TRUE},
1344
{"raise_on_focus", NULL, TRUE},
1345
{"raise_with_any_button", NULL, TRUE},
1346
{"resize_opacity", NULL, TRUE},
1347
{"restore_on_move", NULL, TRUE},
1348
{"scroll_workspaces", NULL, TRUE},
1349
{"shadow_delta_height", NULL, TRUE},
1350
{"shadow_delta_width", NULL, TRUE},
1351
{"shadow_delta_x", NULL, TRUE},
1352
{"shadow_delta_y", NULL, TRUE},
1353
{"show_app_icon", NULL, TRUE},
1354
{"show_frame_shadow", NULL, TRUE},
1355
{"show_popup_shadow", NULL, TRUE},
1356
{"snap_resist", NULL, TRUE},
1357
{"snap_to_border", NULL, TRUE},
1358
{"snap_to_windows", NULL, TRUE},
1359
{"snap_width", NULL, TRUE},
1360
{"theme", NULL, TRUE},
1361
{"title_alignment", NULL, TRUE},
1362
{"title_font", NULL, FALSE},
1363
{"title_horizontal_offset", NULL, TRUE},
1364
{"title_shadow_active", NULL, TRUE},
1365
{"title_shadow_inactive", NULL, TRUE},
1366
{"title_vertical_offset_active", NULL, TRUE},
1367
{"title_vertical_offset_inactive", NULL, TRUE},
1368
{"toggle_workspaces", NULL, TRUE},
1369
{"unredirect_overlays", NULL, TRUE},
1370
{"use_compositing", NULL, TRUE},
1371
{"workspace_count", NULL, TRUE},
1372
{"wrap_cycle", NULL, TRUE},
1373
{"wrap_layout", NULL, TRUE},
1374
{"wrap_resistance", NULL, TRUE},
1375
{"wrap_windows", NULL, TRUE},
1376
{"wrap_workspaces", NULL, TRUE},
1378
{"add_workspace_key", NULL, TRUE},
1379
{"cancel_key", NULL, TRUE},
1380
{"close_window_key", NULL, TRUE},
1381
{"cycle_windows_key", NULL, TRUE},
1382
{"del_workspace_key", NULL, TRUE},
1383
{"down_workspace_key", NULL, TRUE},
1384
{"fullscreen_key", NULL, TRUE},
1385
{"hide_window_key", NULL, TRUE},
1386
{"left_workspace_key", NULL, TRUE},
1387
{"lower_window_key", NULL, TRUE},
1388
{"maximize_horiz_key", NULL, TRUE},
1389
{"maximize_vert_key", NULL, TRUE},
1390
{"maximize_window_key", NULL, TRUE},
1391
{"move_window_down_key", NULL, TRUE},
1392
{"move_window_down_workspace_key", NULL, TRUE},
1393
{"move_window_left_key", NULL, TRUE},
1394
{"move_window_left_workspace_key", NULL, TRUE},
1395
{"move_window_next_workspace_key", NULL, TRUE},
1396
{"move_window_prev_workspace_key", NULL, TRUE},
1397
{"popup_menu_key", NULL, TRUE},
1398
{"move_window_right_key", NULL, TRUE},
1399
{"move_window_right_workspace_key", NULL, TRUE},
1400
{"move_window_up_key", NULL, TRUE},
1401
{"move_window_up_workspace_key", NULL, TRUE},
1402
{"move_window_workspace_1_key", NULL, TRUE},
1403
{"move_window_workspace_2_key", NULL, TRUE},
1404
{"move_window_workspace_3_key", NULL, TRUE},
1405
{"move_window_workspace_4_key", NULL, TRUE},
1406
{"move_window_workspace_5_key", NULL, TRUE},
1407
{"move_window_workspace_6_key", NULL, TRUE},
1408
{"move_window_workspace_7_key", NULL, TRUE},
1409
{"move_window_workspace_8_key", NULL, TRUE},
1410
{"move_window_workspace_9_key", NULL, TRUE},
1411
{"move_window_workspace_10_key", NULL, TRUE},
1412
{"move_window_workspace_11_key", NULL, TRUE},
1413
{"move_window_workspace_12_key", NULL, TRUE},
1414
{"next_workspace_key", NULL, TRUE},
1415
{"prev_workspace_key", NULL, TRUE},
1416
{"raise_window_key", NULL, TRUE},
1417
{"resize_window_down_key", NULL, TRUE},
1418
{"resize_window_left_key", NULL, TRUE},
1419
{"resize_window_right_key", NULL, TRUE},
1420
{"resize_window_up_key", NULL, TRUE},
1421
{"right_workspace_key", NULL, TRUE},
1422
{"shade_window_key", NULL, TRUE},
1423
{"show_desktop_key", NULL, FALSE},
1424
{"stick_window_key", NULL, TRUE},
1425
{"up_workspace_key", NULL, TRUE},
1426
{"workspace_1_key", NULL, TRUE},
1427
{"workspace_2_key", NULL, TRUE},
1428
{"workspace_3_key", NULL, TRUE},
1429
{"workspace_4_key", NULL, TRUE},
1430
{"workspace_5_key", NULL, TRUE},
1431
{"workspace_6_key", NULL, TRUE},
1432
{"workspace_7_key", NULL, TRUE},
1433
{"workspace_8_key", NULL, TRUE},
1434
{"workspace_9_key", NULL, TRUE},
1435
{"workspace_10_key", NULL, TRUE},
1436
{"workspace_11_key", NULL, TRUE},
1437
{"workspace_12_key", NULL, TRUE},
635
{"activate_action", NULL, G_TYPE_STRING, TRUE},
636
{"borderless_maximize", NULL, G_TYPE_BOOLEAN, TRUE},
637
{"box_move", NULL, G_TYPE_BOOLEAN, TRUE},
638
{"box_resize", NULL, G_TYPE_BOOLEAN, TRUE},
639
{"button_layout", NULL, G_TYPE_STRING, TRUE},
640
{"button_offset", NULL, G_TYPE_INT, TRUE},
641
{"button_spacing", NULL, G_TYPE_INT, TRUE},
642
{"click_to_focus", NULL, G_TYPE_BOOLEAN, TRUE},
643
{"focus_delay", NULL, G_TYPE_INT, TRUE},
644
{"cycle_draw_frame", NULL, G_TYPE_BOOLEAN, TRUE},
645
{"cycle_hidden", NULL, G_TYPE_BOOLEAN, TRUE},
646
{"cycle_minimum", NULL, G_TYPE_BOOLEAN, TRUE},
647
{"cycle_workspaces", NULL, G_TYPE_BOOLEAN, TRUE},
648
{"dbl_click_time", NULL, G_TYPE_INT, TRUE},
649
{"double_click_action", NULL, G_TYPE_STRING, TRUE},
650
{"easy_click", NULL, G_TYPE_STRING, TRUE},
651
{"focus_hint", NULL, G_TYPE_BOOLEAN, TRUE},
652
{"focus_new", NULL, G_TYPE_BOOLEAN,TRUE},
653
{"frame_opacity", NULL, G_TYPE_INT, TRUE},
654
{"full_width_title", NULL, G_TYPE_BOOLEAN, TRUE},
655
{"inactive_opacity", NULL, G_TYPE_INT, TRUE},
656
{"margin_bottom", NULL, G_TYPE_INT, FALSE},
657
{"margin_left", NULL, G_TYPE_INT, FALSE},
658
{"margin_right", NULL, G_TYPE_INT, FALSE},
659
{"margin_top", NULL, G_TYPE_INT, FALSE},
660
{"maximized_offset", NULL, G_TYPE_INT, TRUE},
661
{"move_opacity", NULL, G_TYPE_INT, TRUE},
662
{"placement_ratio", NULL, G_TYPE_INT, TRUE},
663
{"placement_mode", NULL, G_TYPE_STRING, TRUE},
664
{"popup_opacity", NULL, G_TYPE_INT, TRUE},
665
{"prevent_focus_stealing", NULL, G_TYPE_BOOLEAN, TRUE},
666
{"raise_delay", NULL, G_TYPE_INT, TRUE},
667
{"raise_on_click", NULL, G_TYPE_BOOLEAN, TRUE},
668
{"raise_on_focus", NULL, G_TYPE_BOOLEAN, TRUE},
669
{"raise_with_any_button", NULL, G_TYPE_BOOLEAN, TRUE},
670
{"repeat_urgent_blink", NULL, G_TYPE_BOOLEAN, TRUE},
671
{"resize_opacity", NULL, G_TYPE_INT, TRUE},
672
{"restore_on_move", NULL, G_TYPE_BOOLEAN, TRUE},
673
{"scroll_workspaces", NULL, G_TYPE_BOOLEAN, TRUE},
674
{"shadow_delta_height", NULL, G_TYPE_INT, TRUE},
675
{"shadow_delta_width", NULL, G_TYPE_INT, TRUE},
676
{"shadow_delta_x", NULL, G_TYPE_INT, TRUE},
677
{"shadow_delta_y", NULL, G_TYPE_INT, TRUE},
678
{"shadow_opacity", NULL, G_TYPE_INT, TRUE},
679
{"show_app_icon", NULL, G_TYPE_BOOLEAN, TRUE},
680
{"show_dock_shadow", NULL, G_TYPE_BOOLEAN, TRUE},
681
{"show_frame_shadow", NULL, G_TYPE_BOOLEAN, TRUE},
682
{"show_popup_shadow", NULL, G_TYPE_BOOLEAN, TRUE},
683
{"snap_resist", NULL, G_TYPE_BOOLEAN, TRUE},
684
{"snap_to_border", NULL, G_TYPE_BOOLEAN, TRUE},
685
{"snap_to_windows", NULL, G_TYPE_BOOLEAN, TRUE},
686
{"snap_width", NULL, G_TYPE_INT, TRUE},
687
{"theme", NULL, G_TYPE_STRING, TRUE},
688
{"title_alignment", NULL, G_TYPE_STRING, TRUE},
689
{"title_font", NULL, G_TYPE_STRING, FALSE},
690
{"title_horizontal_offset", NULL, G_TYPE_INT, TRUE},
691
{"title_shadow_active", NULL, G_TYPE_STRING, TRUE},
692
{"title_shadow_inactive", NULL, G_TYPE_STRING, TRUE},
693
{"title_vertical_offset_active", NULL, G_TYPE_INT, TRUE},
694
{"title_vertical_offset_inactive", NULL, G_TYPE_INT, TRUE},
695
{"toggle_workspaces", NULL, G_TYPE_BOOLEAN, TRUE},
696
{"unredirect_overlays", NULL, G_TYPE_BOOLEAN, TRUE},
697
{"urgent_blink", NULL, G_TYPE_BOOLEAN, TRUE},
698
{"use_compositing", NULL, G_TYPE_BOOLEAN, TRUE},
699
{"workspace_count", NULL, G_TYPE_INT, TRUE},
700
{"wrap_cycle", NULL, G_TYPE_BOOLEAN, TRUE},
701
{"wrap_layout", NULL, G_TYPE_BOOLEAN, TRUE},
702
{"wrap_resistance", NULL, G_TYPE_INT, TRUE},
703
{"wrap_windows", NULL, G_TYPE_BOOLEAN, TRUE},
704
{"wrap_workspaces", NULL, G_TYPE_BOOLEAN, TRUE},
705
{NULL, NULL, G_TYPE_INVALID, FALSE}
1441
708
TRACE ("entering loadSettings");
1443
710
loadRcData (screen_info, rc);
1444
loadMcsData (screen_info, rc);
711
loadRcData (screen_info, rc);
712
loadXfconfData (screen_info, rc);
1445
713
loadTheme (screen_info, rc);
1446
714
update_grabs (screen_info);
1448
if (!loadKeyBindings (screen_info, rc))
716
loadKeyBindings (screen_info);
1454
718
screen_info->params->borderless_maximize =
1455
!g_ascii_strcasecmp ("true", getValue ("borderless_maximize", rc));
719
getBoolValue ("borderless_maximize", rc);
1456
720
screen_info->params->box_resize =
1457
!g_ascii_strcasecmp ("true", getValue ("box_resize", rc));
721
getBoolValue ("box_resize", rc);
1458
722
screen_info->params->box_move =
1459
!g_ascii_strcasecmp ("true", getValue ("box_move", rc));
723
getBoolValue ("box_move", rc);
1460
724
screen_info->params->click_to_focus =
1461
!g_ascii_strcasecmp ("true", getValue ("click_to_focus", rc));
725
getBoolValue ("click_to_focus", rc);
1462
726
screen_info->params->cycle_minimum =
1463
!g_ascii_strcasecmp ("true", getValue ("cycle_minimum", rc));
727
getBoolValue ("cycle_minimum", rc);
728
screen_info->params->cycle_draw_frame =
729
getBoolValue ("cycle_draw_frame", rc);
1464
730
screen_info->params->cycle_hidden =
1465
!g_ascii_strcasecmp ("true", getValue ("cycle_hidden", rc));
731
getBoolValue ("cycle_hidden", rc);
1466
732
screen_info->params->cycle_workspaces =
1467
!g_ascii_strcasecmp ("true", getValue ("cycle_workspaces", rc));
733
getBoolValue ("cycle_workspaces", rc);
1468
734
screen_info->params->focus_hint =
1469
!g_ascii_strcasecmp ("true", getValue ("focus_hint", rc));
735
getBoolValue ("focus_hint", rc);
1470
736
screen_info->params->focus_new =
1471
!g_ascii_strcasecmp ("true", getValue ("focus_new", rc));
737
getBoolValue ("focus_new", rc);
1472
738
screen_info->params->raise_on_focus =
1473
!g_ascii_strcasecmp ("true", getValue ("raise_on_focus", rc));
739
getBoolValue ("raise_on_focus", rc);
1474
740
screen_info->params->prevent_focus_stealing =
1475
!g_ascii_strcasecmp ("true", getValue ("prevent_focus_stealing", rc));
741
getBoolValue ("prevent_focus_stealing", rc);
1476
742
screen_info->params->raise_delay =
1477
abs (TOINT (getValue ("raise_delay", rc)));
743
getIntValue ("raise_delay", rc);
744
screen_info->params->focus_delay =
745
getIntValue ("focus_delay", rc);
1478
746
screen_info->params->raise_on_click =
1479
!g_ascii_strcasecmp ("true", getValue ("raise_on_click", rc));
747
getBoolValue ("raise_on_click", rc);
1480
748
screen_info->params->raise_with_any_button =
1481
!g_ascii_strcasecmp ("true", getValue ("raise_with_any_button", rc));
749
getBoolValue ("raise_with_any_button", rc);
750
screen_info->params->repeat_urgent_blink =
751
getBoolValue ("repeat_urgent_blink", rc);
752
screen_info->params->urgent_blink =
753
getBoolValue ("urgent_blink", rc);
1482
754
screen_info->params->restore_on_move =
1483
!g_ascii_strcasecmp ("true", getValue ("restore_on_move", rc));
755
getBoolValue ("restore_on_move", rc);
1484
756
screen_info->params->frame_opacity =
1485
abs (TOINT (getValue ("frame_opacity", rc)));
757
CLAMP (getIntValue ("frame_opacity", rc), 0, 100);
1486
758
screen_info->params->inactive_opacity =
1487
abs (TOINT (getValue ("inactive_opacity", rc)));
759
CLAMP (getIntValue ("inactive_opacity", rc), 0, 100);
1488
760
screen_info->params->move_opacity =
1489
abs (TOINT (getValue ("move_opacity", rc)));
761
CLAMP (getIntValue ("move_opacity", rc), 0, 100);
1490
762
screen_info->params->resize_opacity =
1491
abs (TOINT (getValue ("resize_opacity", rc)));
763
CLAMP (getIntValue ("resize_opacity", rc), 0, 100);
1492
764
screen_info->params->popup_opacity =
1493
abs (TOINT (getValue ("popup_opacity", rc)));
765
CLAMP (getIntValue ("popup_opacity", rc), 0, 100);
1494
766
screen_info->params->placement_ratio =
1495
abs (TOINT (getValue ("placement_ratio", rc)));
767
CLAMP (getIntValue ("placement_ratio", rc), 0, 100);
768
screen_info->params->shadow_opacity =
769
CLAMP (getIntValue ("shadow_opacity", rc), 0, 100);
1496
770
screen_info->params->show_app_icon =
1497
!g_ascii_strcasecmp ("true", getValue ("show_app_icon", rc));
771
getBoolValue ("show_app_icon", rc);
772
screen_info->params->show_dock_shadow =
773
getBoolValue ("show_dock_shadow", rc);
1498
774
screen_info->params->show_frame_shadow =
1499
!g_ascii_strcasecmp ("true", getValue ("show_frame_shadow", rc));
775
getBoolValue ("show_frame_shadow", rc);
1500
776
screen_info->params->show_popup_shadow =
1501
!g_ascii_strcasecmp ("true", getValue ("show_popup_shadow", rc));
777
getBoolValue ("show_popup_shadow", rc);
1502
778
screen_info->params->snap_to_border =
1503
!g_ascii_strcasecmp ("true", getValue ("snap_to_border", rc));
779
getBoolValue ("snap_to_border", rc);
1504
780
screen_info->params->snap_to_windows =
1505
!g_ascii_strcasecmp ("true", getValue ("snap_to_windows", rc));
781
getBoolValue ("snap_to_windows", rc);
1506
782
screen_info->params->snap_resist =
1507
!g_ascii_strcasecmp ("true", getValue ("snap_resist", rc));
783
getBoolValue ("snap_resist", rc);
1508
784
screen_info->params->snap_width =
1509
abs (TOINT (getValue ("snap_width", rc)));
1511
set_settings_margin (screen_info, STRUTS_LEFT, TOINT (getValue ("margin_left", rc)));
1512
set_settings_margin (screen_info, STRUTS_RIGHT, TOINT (getValue ("margin_right", rc)));
1513
set_settings_margin (screen_info, STRUTS_BOTTOM, TOINT (getValue ("margin_bottom", rc)));
1514
set_settings_margin (screen_info, STRUTS_TOP, TOINT (getValue ("margin_top", rc)));
1516
set_easy_click (screen_info, getValue ("easy_click", rc));
1518
value = getValue ("activate_action", rc);
785
getIntValue ("snap_width", rc);
786
screen_info->params->toggle_workspaces =
787
getBoolValue ("toggle_workspaces", rc);
788
screen_info->params->unredirect_overlays =
789
getBoolValue ("unredirect_overlays", rc);
790
screen_info->params->use_compositing =
791
getBoolValue ("use_compositing", rc);
792
screen_info->params->wrap_workspaces =
793
getBoolValue ("wrap_workspaces", rc);
795
screen_info->params->wrap_layout =
796
getBoolValue ("wrap_layout", rc);
797
screen_info->params->wrap_windows =
798
getBoolValue ("wrap_windows", rc);
799
screen_info->params->wrap_cycle =
800
getBoolValue ("wrap_cycle", rc);
801
screen_info->params->scroll_workspaces =
802
getBoolValue ("scroll_workspaces", rc);
803
screen_info->params->wrap_resistance =
804
getIntValue ("wrap_resistance", rc);
806
set_settings_margin (screen_info, STRUTS_LEFT, getIntValue ("margin_left", rc));
807
set_settings_margin (screen_info, STRUTS_RIGHT, getIntValue ("margin_right", rc));
808
set_settings_margin (screen_info, STRUTS_BOTTOM, getIntValue ("margin_bottom", rc));
809
set_settings_margin (screen_info, STRUTS_TOP, getIntValue ("margin_top", rc));
811
set_easy_click (screen_info, getStringValue ("easy_click", rc));
813
value = getStringValue ("placement_mode", rc);
814
set_placement_mode (screen_info, value);
816
value = getStringValue ("activate_action", rc);
1519
817
set_activate_action (screen_info, value);
1521
value = getValue ("double_click_action", rc);
819
value = getStringValue ("double_click_action", rc);
1522
820
if (!g_ascii_strcasecmp ("shade", value))
1524
822
screen_info->params->double_click_action = DBL_CLICK_ACTION_SHADE;
1736
1029
g_return_if_fail (screen_info);
1738
if (screen_info->mcs_client)
1740
mcs_client_destroy (screen_info->mcs_client);
1741
screen_info->mcs_client = NULL;
1743
1031
unloadSettings (screen_info);
1035
cb_xfwm4_channel_property_changed(XfconfChannel *channel, const gchar *property_name, const GValue *value, ScreenInfo *screen_info)
1037
if (g_str_has_prefix(property_name, "/general/") == TRUE)
1039
const gchar *name = &property_name[9];
1040
switch (G_VALUE_TYPE(value))
1043
if (!strcmp (name, "double_click_action"))
1045
reloadScreenSettings (screen_info, NO_UPDATE_FLAG);
1047
else if (!strcmp (name, "theme"))
1049
reloadScreenSettings(screen_info, UPDATE_MAXIMIZE | UPDATE_GRAVITY | UPDATE_CACHE);
1051
else if (!strcmp (name, "button_layout"))
1053
reloadScreenSettings (screen_info, UPDATE_FRAME | UPDATE_CACHE);
1055
else if (!strcmp (name, "title_alignment"))
1057
reloadScreenSettings (screen_info, UPDATE_FRAME | UPDATE_CACHE);
1059
else if (!strcmp (name, "title_font"))
1061
reloadScreenSettings (screen_info, UPDATE_FRAME | UPDATE_CACHE);
1063
else if (!strcmp (name, "easy_click"))
1065
reloadScreenSettings (screen_info, UPDATE_BUTTON_GRABS);
1067
else if (!strcmp (name, "activate_action"))
1069
set_activate_action (screen_info, g_value_get_string (value));
1071
else if (!strcmp (name, "placement_mode"))
1073
set_placement_mode (screen_info, g_value_get_string (value));
1075
else if ((!strcmp (name, "title_shadow_active"))
1076
|| (!strcmp (name, "title_shadow_inactive")))
1078
/* These properties are not configurable via xfconf */
1082
g_warning("The property '%s' is not supported", property_name);
1086
if (!strcmp (name, "raise_delay"))
1088
screen_info->params->raise_delay = g_value_get_int (value);
1090
else if (!strcmp (name, "focus_delay"))
1092
screen_info->params->focus_delay = g_value_get_int (value);
1094
else if (!strcmp (name, "snap_width"))
1096
screen_info->params->snap_width = g_value_get_int (value);
1098
else if (!strcmp (name, "wrap_resistance"))
1100
screen_info->params->wrap_resistance = g_value_get_int (value);
1102
else if (!strcmp (name, "margin_left"))
1104
set_settings_margin (screen_info, STRUTS_LEFT, g_value_get_int (value));
1106
else if (!strcmp (name, "margin_right"))
1108
set_settings_margin (screen_info, STRUTS_RIGHT, g_value_get_int (value));
1110
else if (!strcmp (name, "margin_bottom"))
1112
set_settings_margin (screen_info, STRUTS_BOTTOM, g_value_get_int (value));
1114
else if (!strcmp (name, "margin_top"))
1116
set_settings_margin (screen_info, STRUTS_TOP, g_value_get_int (value));
1118
else if (!strcmp (name, "workspace_count"))
1120
workspaceSetCount(screen_info, g_value_get_int (value));
1122
else if (!strcmp (name, "frame_opacity"))
1124
screen_info->params->frame_opacity = g_value_get_int(value);
1125
reloadScreenSettings (screen_info, UPDATE_FRAME);
1127
else if (!strcmp (name, "inactive_opacity"))
1129
screen_info->params->inactive_opacity = g_value_get_int(value);
1130
reloadScreenSettings (screen_info, UPDATE_FRAME);
1131
clientUpdateAllOpacity (screen_info);
1133
else if (!strcmp (name, "move_opacity"))
1135
screen_info->params->move_opacity = g_value_get_int (value);
1137
else if (!strcmp (name, "resize_opacity"))
1139
screen_info->params->resize_opacity = g_value_get_int (value);
1141
else if (!strcmp (name, "popup_opacity"))
1143
screen_info->params->popup_opacity = g_value_get_int (value);
1144
reloadScreenSettings (screen_info, UPDATE_FRAME);
1146
else if (!strcmp (name, "placement_ratio"))
1148
screen_info->params->placement_ratio = g_value_get_int (value);
1150
else if ((!strcmp (name, "button_offset"))
1151
|| (!strcmp (name, "button_spacing"))
1152
|| (!strcmp (name, "dbl_click_time"))
1153
|| (!strcmp (name, "maximized_offset"))
1154
|| (!strcmp (name, "shadow_delta_height"))
1155
|| (!strcmp (name, "shadow_delta_width"))
1156
|| (!strcmp (name, "shadow_delta_x"))
1157
|| (!strcmp (name, "shadow_delta_y"))
1158
|| (!strcmp (name, "shadow_opacity"))
1159
|| (!strcmp (name, "title_horizontal_offset"))
1160
|| (!strcmp (name, "title_vertical_offset_active"))
1161
|| (!strcmp (name, "title_vertical_offset_inactive")))
1163
/* These properties are not configurable via xfconf */
1167
g_warning("The property '%s' is not supported", property_name);
1170
case G_TYPE_BOOLEAN:
1171
if (!strcmp (name, "box_move"))
1173
screen_info->params->box_move = g_value_get_boolean (value);
1175
else if (!strcmp (name, "box_resize"))
1177
screen_info->params->box_resize = g_value_get_boolean (value);
1179
else if (!strcmp (name, "click_to_focus"))
1181
screen_info->params->click_to_focus = g_value_get_boolean (value);
1182
update_grabs (screen_info);
1184
else if (!strcmp (name, "focus_new"))
1186
screen_info->params->focus_new = g_value_get_boolean (value);
1188
else if (!strcmp (name, "raise_on_focus"))
1190
screen_info->params->raise_on_focus = g_value_get_boolean (value);
1192
else if (!strcmp (name, "raise_on_click"))
1194
screen_info->params->raise_on_click = g_value_get_boolean (value);
1195
update_grabs (screen_info);
1197
else if (!strcmp (name, "repeat_urgent_blink"))
1199
screen_info->params->repeat_urgent_blink = g_value_get_boolean (value);
1201
else if (!strcmp (name, "urgent_blink"))
1203
screen_info->params->urgent_blink = g_value_get_boolean (value);
1205
else if (!strcmp (name, "snap_to_border"))
1207
screen_info->params->snap_to_border = g_value_get_boolean (value);
1209
else if (!strcmp (name, "snap_to_windows"))
1211
screen_info->params->snap_to_windows = g_value_get_boolean (value);
1213
else if (!strcmp (name, "wrap_workspaces"))
1215
screen_info->params->wrap_workspaces = g_value_get_boolean (value);
1216
placeSidewalks (screen_info, screen_info->params->wrap_workspaces);
1218
else if (!strcmp (name, "wrap_windows"))
1220
screen_info->params->wrap_windows = g_value_get_boolean (value);
1222
else if (!strcmp (name, "borderless_maximize"))
1224
screen_info->params->borderless_maximize = g_value_get_boolean (value);
1225
reloadScreenSettings (screen_info, UPDATE_MAXIMIZE);
1227
else if (!strcmp (name, "cycle_minimum"))
1229
screen_info->params->cycle_minimum = g_value_get_boolean (value);
1231
else if (!strcmp (name, "cycle_draw_frame"))
1233
screen_info->params->cycle_draw_frame = g_value_get_boolean (value);
1235
else if (!strcmp (name, "cycle_hidden"))
1237
screen_info->params->cycle_hidden = g_value_get_boolean (value);
1239
else if (!strcmp (name, "cycle_workspaces"))
1241
screen_info->params->cycle_workspaces = g_value_get_boolean (value);
1243
else if (!strcmp (name, "focus_hint"))
1245
screen_info->params->focus_hint = g_value_get_boolean (value);
1247
else if (!strcmp (name, "show_dock_shadow"))
1249
screen_info->params->show_dock_shadow = g_value_get_boolean (value);
1250
reloadScreenSettings (screen_info, UPDATE_FRAME);
1252
else if (!strcmp (name, "show_frame_shadow"))
1254
screen_info->params->show_frame_shadow = g_value_get_boolean (value);
1255
reloadScreenSettings (screen_info, UPDATE_FRAME);
1257
else if (!strcmp (name, "show_popup_shadow"))
1259
screen_info->params->show_popup_shadow = g_value_get_boolean (value);
1260
reloadScreenSettings (screen_info, UPDATE_FRAME);
1262
else if (!strcmp (name, "snap_resist"))
1264
screen_info->params->snap_resist = g_value_get_boolean (value);
1266
else if (!strcmp (name, "prevent_focus_stealing"))
1268
screen_info->params->prevent_focus_stealing = g_value_get_boolean (value);
1270
else if (!strcmp (name, "raise_with_any_button"))
1272
screen_info->params->raise_with_any_button = g_value_get_boolean (value);
1273
update_grabs (screen_info);
1275
else if (!strcmp (name, "restore_on_move"))
1277
screen_info->params->restore_on_move = g_value_get_boolean (value);
1279
else if (!strcmp (name, "scroll_workspaces"))
1281
screen_info->params->scroll_workspaces = g_value_get_boolean (value);
1283
else if (!strcmp (name, "toggle_workspaces"))
1285
screen_info->params->toggle_workspaces = g_value_get_boolean (value);
1287
else if (!strcmp (name, "unredirect_overlays"))
1289
screen_info->params->unredirect_overlays = g_value_get_boolean (value);
1291
else if (!strcmp (name, "use_compositing"))
1293
screen_info->params->use_compositing = g_value_get_boolean (value);
1294
compositorActivateScreen (screen_info,
1295
screen_info->params->use_compositing);
1297
else if (!strcmp (name, "wrap_layout"))
1299
screen_info->params->wrap_layout = g_value_get_boolean (value);
1301
else if (!strcmp (name, "wrap_cycle"))
1303
screen_info->params->wrap_cycle = g_value_get_boolean (value);
1305
else if ((!strcmp (name, "full_width_title"))
1306
|| (!strcmp (name, "show_app_icon")))
1308
/* These properties are not configurable via xfconf */
1312
g_warning("The property '%s' is not supported", property_name);
1316
if (!strcmp (name, "workspace_names"))
1318
/* These properties are not configurable via xfconf */
1322
g_warning("The property '%s' is not supported", property_name);
1330
cb_keys_changed (GdkKeymap *keymap, ScreenInfo *screen_info)
1332
initModifiers (myScreenGetXDisplay (screen_info));
1333
reloadSettings (screen_info->display_info, UPDATE_BUTTON_GRABS);
1337
cb_shortcut_added (XfceShortcutsProvider *provider, const gchar *shortcut,
1338
ScreenInfo *screen_info)
1344
g_return_if_fail (XFCE_IS_SHORTCUTS_PROVIDER (provider));
1345
g_return_if_fail (shortcut);
1346
g_return_if_fail (screen_info);
1348
sc = xfce_shortcuts_provider_get_shortcut (provider, shortcut);
1355
dpy = myScreenGetXDisplay (screen_info);
1357
for (i = 0; i < KEY_COUNT; ++i)
1359
if (g_str_equal (screen_info->params->keys[i].internal_name, sc->command))
1361
parseKeyString (dpy, &screen_info->params->keys[i], shortcut);
1363
myScreenUngrabKeys (screen_info);
1364
myScreenGrabKeys (screen_info);
1369
xfce_shortcut_free (sc);
1373
cb_shortcut_removed (XfceShortcutsProvider *provider, const gchar *shortcut,
1374
ScreenInfo *screen_info)
1380
g_return_if_fail (XFCE_IS_SHORTCUTS_PROVIDER (provider));
1381
g_return_if_fail (screen_info);
1382
g_return_if_fail (shortcut);
1384
dpy = myScreenGetXDisplay (screen_info);
1386
parseKeyString (dpy, &key, shortcut);
1388
for (i = 0; i < KEY_COUNT; ++i)
1390
if (screen_info->params->keys[i].keycode == key.keycode &&
1391
screen_info->params->keys[i].modifier == key.modifier)
1393
screen_info->params->keys[i].keycode = 0;
1394
screen_info->params->keys[i].modifier = 0;
1396
myScreenUngrabKeys (screen_info);
1397
myScreenGrabKeys (screen_info);
1404
parseShortcut (ScreenInfo *screen_info, int index, const gchar *name,
1408
const gchar *shortcut;
1410
g_return_if_fail (screen_info);
1411
g_return_if_fail (index >= 0 && index < KEY_COUNT);
1413
dpy = myScreenGetXDisplay (screen_info);
1414
shortcut = getShortcut (name, shortcuts);
1415
parseKeyString (dpy, &screen_info->params->keys[index], shortcut);
1417
screen_info->params->keys[index].internal_name = g_strdup (name);
1420
static const gchar *
1421
getShortcut (const gchar *name, GList *shortcuts)
1423
XfceShortcut *shortcut;
1425
const gchar *result = NULL;
1427
for (iter = shortcuts; iter != NULL; iter = g_list_next (iter))
1429
shortcut = iter->data;
1431
if (g_str_equal (shortcut->command, name))
1433
result = shortcut->shortcut;